Topic
Arrays & Hashing interview problems
Two pointers, prefix sums, hash maps and sliding windows. 477 original problems, each with hidden test cases you can run in the browser.
137 easy303 medium37 hard
Showing 301–330 of 477 results
Tests whether a candidate can scan an array in a single linear pass to find the length of the longest strictly increasing contiguous run.
Auto-gradedarrayssliding-windowgreedyTests set-based membership filtering over a bounded integer range, with duplicate and out-of-bounds input handling.
Auto-gradedsetsfilteringrangesTests the ability to use prefix sums and a hash set to detect whether any contiguous slice of an array sums to a given value.
Auto-gradedprefix-sumhash-setsubarrayTests whether a candidate can slide a letter-template over an integer grid and detect every position where symbols and values form a valid one-to-one correspondence.
Auto-gradedhash-mappattern-matchingmatrixisomorphismCompute exact posterior probabilities over three weighted coins from a sequence of flips, plus the predictive probability the next flip is heads.
Auto-gradedbayes-theoremprobabilityfractionsposterior-predictiveDetermine which function name occurs most often in a list of log entries and report its occurrence count.
Model answerhash-mapfrequency-countingiterationTests ability to implement a complete trading backtest with entry/exit logic, transaction costs, performance metrics, train/test splits, and statistical validation.
Auto-gradedbacktestingtime-seriesfinancesimulationTests matrix manipulation, collision detection, and ordered simulation by placing fixed shapes onto a grid.
Auto-gradedmatrixsimulationgreedyTests conditional probability under sampling without replacement from a fixed-composition deck given observed draw history.
Auto-gradedprobabilitycombinatoricsconditional-probabilitySolve three independent problems: tournament match counting, grid traversal with movement commands, and finding maximum sum of digit-disjoint pairs.
Model answersimulationgraph-traversalbit-manipulationdfsTests probabilistic modeling with the Binomial distribution, Bayes' theorem, two-stage classification pipelines, and F1-optimal threshold selection in a risk-scoring context.
Auto-gradedprobabilitybayes-theorembinomial-distributionTests whether a candidate can apply the variance-of-a-sum identity to extract correlation, and correctly handle the case where one variance is missing.
Auto-gradedstatisticsmathprobabilityCompute the binomial CDF: the chance that at most s of n independent customers request a limited item.
Auto-gradedprobabilitybinomial-distributioncombinatoricscdfTests spatial hashing and set union logic to find customers whose required service tags are not collectively offered by any nearby vendor within a radius.
Auto-gradedspatial-hashingset-operationsgrid-bucketingTests order-statistics reasoning for k-th missing positive integers and time-window frequency tracking to detect repeated log events.
Auto-gradedarrayssortingsliding-windowTests hash-based duplicate detection alongside a sliding window that finds the longest subarray containing exactly two distinct integer values.
Auto-gradedsliding-windowhashingtwo-pointersApply many inclusive range additions over a possibly huge array and return the index holding the largest total, breaking ties toward the smallest index.
Auto-gradeddifference-arrayprefix-suminterval-updatestie-breakTests greedy assignment of ranks by processing elements in sorted order while maintaining row and column constraints.
Auto-gradedsortinggreedymatrixTests boundary-tracking traversal under strict space and immutability constraints, requiring careful handling of single-row and single-column edge cases.
Auto-gradedmatrixtraversalconstant-spaceboundary-trackingTests the ability to merge consecutive same-user image posts into gallery items and then apply a stable descending-timestamp sort to the resulting stream.
Auto-gradedsimulationsortingtwo-pointersTests the ability to recognize when a running maximum equals the current index in a permutation, using invariant reasoning to avoid simulation.
Auto-gradedpermutationsprefix-conditionrunning-maximuminvariantsTests efficient two-pointer technique with sorted arrays, duplicate handling, and edge-case reasoning.
Auto-gradedtwo-pointerssortingdeduplicationTests sliding window technique on a circular binary array to find the maximum consecutive ones achievable by flipping at most one zero.
Auto-gradedsliding-windowcircular-arraytwo-pointersTests sliding window technique for contiguous subarrays with constraints and binary search optimization for counting distinct values in sorted arrays.
Auto-gradedsliding-windowbinary-searchtwo-pointeroptimizationTests ability to use the two-pointer (sliding window) technique to find the longest contiguous subarray where the difference between the max and min elements stays within a given limit.
Auto-gradedarraystwo pointerssliding windowTests ability to combine prorated flat fees with two-tier volume pricing over a half-open time window.
Auto-gradedsimulationmathaggregationTests ability to apply the two-sample normal approximation for A/B test sizing and convert a required sample count into a minimum experiment duration.
Auto-gradedstatisticsexperimentationa-b-testingTests efficient 2-D prefix sweeps to compute each robot's nearest-wall distance in four directions and filter by an exact profile query.
Auto-gradedmatrixprefix-scansimulationTests manual maximum-finding across a frequency dictionary, tie-breaking by first occurrence, and working with stringified keys.
Auto-gradedhash-mapfrequency-countingiterationCompute expected allocation count, reachability probability, and expected coverage when distributing items randomly with replacement.
Auto-gradedprobabilityexpectationbinomialcomplement-rule