Interview questions
Find a company or topic. Read the sources, then practice.
Loading the question library…
Find a company or topic. Read the sources, then practice.
Loading the question library…
Showing 1,776–1,800
Given an m x n binary grid, count all upward- and downward-pointing isosceles triangular regions made entirely of 1s (pyramids/inverse pyramids) with height > 1…
General practice
Count the number of index pairs (i<j) in an array whose values sum to a power of two, returning the result modulo 1e9+7. The challenge…
General practice
Count the number of length-n digit strings where digits at even indices must be even (5 choices) and digits at odd indices must be prime…
General practice
Companies: Amazon, BNY Mellon, Harness, Microsoft
Array · Bit Manipulation · Monotonic Stack · Stack
Count the number of value triplets (x,y,z) in two permutations of 0..n−1 such that the indices of x,y,z are strictly increasing in both arrays (they…
General practice
Count how many hills and valleys appear in an array, where a position (or contiguous block of equal values) is a hill if its value…
General practice
Count the number of valid ways to choose or label houses arranged in a circle subject to local constraints (for example, restrictions on adjacent selections…
General practice
Count the number of index quadruplets (i<j<k<l) in a permutation nums of 1..n such that nums[i] < nums[k] < nums[j] < nums[l]. With n up…
General practice
Maintain a dynamic set of closed integer intervals that supports adding an interval (merging overlaps) and returning the total number of distinct integers covered by…
General practice
Count how many positive integers ≤ num have an even sum of digits. With num ≤ 1000 this is easily solved by computing each number's…
General practice
Count the number of 4-directionally connected components of positive cells (islands) whose sum of cell values is divisible by k. The core challenge is to…
General practice
Given a list of items where each item is [type, color, name] and a ruleKey (type/color/name) plus ruleValue, return how many items have the corresponding…
General practice
Count how many positive integers less than n (given as binary string s) reach 1 within at most k iterations of replacing a number by…
General practice
Find the k distinct characters whose counts f(c) in s maximize the sum (beauty), then count how many k-length subsequences (distinct index choices) realize that…
General practice