Topic
Arrays & Hashing interview problems
Two pointers, prefix sums, hash maps and sliding windows. 475 original problems, each with hidden test cases you can run in the browser.
135 easy303 medium37 hard
Showing 361–390 of 475 results
Tests array rotation mechanics, computing position-wise absolute differences for every cyclic offset, and returning results in sorted order.
Auto-gradedarraysrotationsortingTests prefix sum technique with hash maps to count subarrays matching a target sum in linear time
Auto-gradedprefix-sumhash-mapsubarrayGroup assignment pairs by project, count members per project, and return every project tied for the largest team.
Auto-gradedarrayshashinggroupingcountingTests insight that incrementing all-but-one is equivalent to decrementing one, leading to a sum-based formula instead of simulation.
Auto-gradedmatharraysgreedyTests whether a candidate can derive the closed-form probability that a best-of-five series requires all five games, using combinatorial reasoning.
Auto-gradedprobabilitycombinatoricsmathTests ability to model a probabilistic process with states and solve expectation equations.
Auto-gradedprobabilityexpected-valuemarkov-chainsTests ability to compute the expected value and variance of a sample mean when observations share a common correlation, plus limiting behavior in boundary cases.
Auto-gradedstatisticsprobabilityexpected-valuevarianceTests prefix sum tracking with hash maps to efficiently count all contiguous subsequences that sum to a target value.
Auto-gradedprefix-sumhash-maparrayTests whether you can build a contribution-margin model for a voucher partnership, solve break-even and sensitivity equations, and decompose a profit change into its drivers.
Auto-gradedunit economicscontribution marginbreak-even analysisTests whether a candidate can derive the Fréchet bounds on P(A ∪ B) given only the marginal probabilities of two events with unspecified dependence.
Auto-gradedprobabilityboundsinclusion-exclusionTests ability to deduplicate items within groups, handle null values, and compute aggregated metrics with proper rounding.
Auto-gradedhash-mapsetaggregationdata-processingDetermine if a sequence of seven-segment digits appears identical when the entire display is flipped upside down.
Auto-gradedarrayssimulationmappingTests efficient grouping and aggregation over dictionaries, plus multi-key sorting to produce ordered output.
Auto-gradedaggregationdictionariessortingTests vector scoring with dot products, stable sorting with tie-breaking, and set-based filtering of excluded indices.
Auto-gradedarrayssortingfilteringComputes how many times the largest element appears in each suffix of an array using a single backward scan.
Auto-gradedarrayssuffix-queriessingle-passTests k-nearest neighbors search with distance computation, NULL handling, and top-k selection with tie-breaking.
Auto-gradedsimilaritydistance-metricsrankingdata-processingSample records from grouped data while preserving stratum proportions, using the largest remainder method to allocate exact counts and seeded random selection.
Model answersamplinggroupinghash-tablerandomizationTests two-pointer technique on sorted arrays, duplicate avoidance, and quadratic complexity optimization for finding triplet combinations.
Auto-gradedtwo-pointerssortingarray-traversalTests whether a candidate can compute consecutive fixed-width window averages in O(n) time by maintaining a running sum instead of recomputing each window from scratch.
Auto-gradedsliding-windowarraystwo-pointersTests grid traversal with directional commands, run-length encoding, and boundary/obstacle validation.
Auto-gradedmatrixsimulationstring-buildingTests understanding of parallel counting, prefix sums, and scatter operations to group array elements into contiguous buckets.
Auto-gradedcountingprefix-sumpartitioningTests understanding of statistical inference by computing a confidence interval for the difference between two independent proportions.
Auto-gradedstatisticshypothesis-testingconfidence-intervalsexperimental-designTests simulation, cycle detection, and brute-force search by finding the single jmp/nop swap that lets a small virtual machine terminate cleanly.
Auto-gradedsimulationcycle-detectionbrute-forceTests careful boundary handling by bucketing integer temperatures into cold, mild, and hot ranges and returning the three counts in order.
Auto-gradedarrayscountingboundary conditionsTests whether a candidate can use a 2D difference array to efficiently count how many rectangular regions overlap each cell of a grid.
Auto-graded2d-arrayprefix-sumdifference-arrayTests set intersection logic and handling of multiple collections to find common elements across all inputs.
Auto-gradedsetsintersectionarraysTests whether a candidate can compute trapped water volume across a height profile using the two-pointer O(1)-space technique.
Auto-gradedtwo-pointersprefix-maxarraysTests 2D prefix sums, border enumeration, multi-way tie tracking, and cross-frame value deduplication on square ring-shaped windows of a matrix.
Auto-graded2d-prefix-summatrixsliding-windowTests whether a candidate can derive an O(n) prefix-aggregate sweep to find the one split index that minimizes total squared error for a two-segment constant model.
Auto-gradedarraysmathprefix-sumsTests pairwise comparison aggregation, majority voting with tie-breaking, and ranking by win totals.
Auto-gradedarrayssortingaggregation