KatInterview

practice a little every day — you've got this ♡

Arrays & Hashing Interview Problems

Practice 5980 original coding, SQL, system design, machine learning and behavioral problems across 15 topics. Coding and SQL problems run against hidden test cases right in your browser; every problem has hints and a worked solution, free.

5980
Problems
2215
Auto-graded
15
Topics
272
Added today

Showing 271–300 of 437 results

  • Arrays & HashingMediumAuto-graded
    Find Gaps in Traffic Segment Assignments

    Tests set-based membership filtering over a bounded integer range, with duplicate and out-of-bounds input handling.

    Arrays & Hashingsetsfilteringranges
  • Arrays & HashingMediumAuto-graded
    Check for Subarray Summing to Target

    Tests the ability to use prefix sums and a hash set to detect whether any contiguous slice of an array sums to a given value.

    Arrays & Hashingprefix-sumhash-setsubarray
  • Arrays & HashingMediumAuto-graded
    Locate Symbol-Structure Templates in a Number Grid

    Tests 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.

    Arrays & Hashinghash-mappattern-matchingmatrixisomorphism
  • Arrays & HashingHardAuto-graded
    Bayesian Coin Identification from Flip Observations

    Compute exact posterior probabilities over three weighted coins from a sequence of flips, plus the predictive probability the next flip is heads.

    Arrays & Hashingbayes-theoremprobabilityfractionsposterior-predictive
  • Arrays & HashingHardAuto-graded
    Backtest a Mean-Reversion Trading System

    Tests ability to implement a complete trading backtest with entry/exit logic, transaction costs, performance metrics, train/test splits, and statistical validation.

    Arrays & Hashingbacktestingtime-seriesfinancesimulation
  • Arrays & HashingMediumAuto-graded
    Sequential Shape Placement on a Matrix

    Tests matrix manipulation, collision detection, and ordered simulation by placing fixed shapes onto a grid.

    Arrays & Hashingmatrixsimulationgreedy
  • Arrays & HashingEasyAuto-graded
    Next Red Card: Conditional Draw Probability

    Tests conditional probability under sampling without replacement from a fixed-composition deck given observed draw history.

    Arrays & Hashingprobabilitycombinatoricsconditional-probability
  • Arrays & HashingMediumAuto-graded
    Session-Based Account Risk Scoring with Bayesian Updates

    Tests probabilistic modeling with the Binomial distribution, Bayes' theorem, two-stage classification pipelines, and F1-optimal threshold selection in a risk-scoring context.

    Arrays & Hashingprobabilitybayes-theorembinomial-distribution
  • Arrays & HashingMediumAuto-graded
    Compute Correlation from Three Variance Values

    Tests whether a candidate can apply the variance-of-a-sum identity to extract correlation, and correctly handle the case where one variance is missing.

    Arrays & Hashingstatisticsmathprobability
  • Arrays & HashingEasyAuto-graded
    Probability Inventory Covers Random Demand

    Compute the binomial CDF: the chance that at most s of n independent customers request a limited item.

    Arrays & Hashingprobabilitybinomial-distributioncombinatoricscdf
  • Arrays & HashingMediumAuto-graded
    Identify Customers With Unmet Service Needs

    Tests spatial hashing and set union logic to find customers whose required service tags are not collectively offered by any nearby vendor within a radius.

    Arrays & Hashingspatial-hashingset-operationsgrid-bucketing
  • Arrays & HashingMediumAuto-graded
    K-th Missing Positive and Sliding-Window Duplicate Events

    Tests order-statistics reasoning for k-th missing positive integers and time-window frequency tracking to detect repeated log events.

    Arrays & Hashingarrayssortingsliding-window
  • Arrays & HashingEasyAuto-graded
    Repeated Values and Longest Two-Distinct Subarray

    Tests hash-based duplicate detection alongside a sliding window that finds the longest subarray containing exactly two distinct integer values.

    Arrays & Hashingsliding-windowhashingtwo-pointers
  • Arrays & HashingMediumAuto-graded
    Leftmost Busiest Slot After Range Increments

    Apply many inclusive range additions over a possibly huge array and return the index holding the largest total, breaking ties toward the smallest index.

    Arrays & Hashingdifference-arrayprefix-suminterval-updatestie-break
  • Arrays & HashingMediumAuto-graded
    Assign Minimum Consistent Ranks to Matrix Cells

    Tests greedy assignment of ranks by processing elements in sorted order while maintaining row and column constraints.

    Arrays & Hashingsortinggreedymatrix
  • Arrays & HashingMediumAuto-graded
    Layer-by-Layer Matrix Traversal Without Extra Storage

    Tests boundary-tracking traversal under strict space and immutability constraints, requiring careful handling of single-row and single-column edge cases.

    Arrays & Hashingmatrixtraversalconstant-spaceboundary-tracking
  • Arrays & HashingMediumAuto-graded
    Collapse Image Bursts and Rank a Content Stream

    Tests the ability to merge consecutive same-user image posts into gallery items and then apply a stable descending-timestamp sort to the resulting stream.

    Arrays & Hashingsimulationsortingtwo-pointers
  • Arrays & HashingMediumAuto-graded
    Tracking Aligned Prefix Moments in a Permutation Sequence

    Tests the ability to recognize when a running maximum equals the current index in a permutation, using invariant reasoning to avoid simulation.

    Arrays & Hashingpermutationsprefix-conditionrunning-maximuminvariants
  • Arrays & HashingMediumAuto-graded
    Find All Triplets That Sum to a Target Value

    Tests efficient two-pointer technique with sorted arrays, duplicate handling, and edge-case reasoning.

    Arrays & Hashingtwo-pointerssortingdeduplication
  • Arrays & HashingMediumAuto-graded
    Longest Circular Run of Ones with One Flip

    Tests sliding window technique on a circular binary array to find the maximum consecutive ones achievable by flipping at most one zero.

    Arrays & Hashingsliding-windowcircular-arraytwo-pointers
  • Arrays & HashingMediumAuto-graded
    Maximum Vacation Length and Efficient Distinct Value Counting

    Tests sliding window technique for contiguous subarrays with constraints and binary search optimization for counting distinct values in sorted arrays.

    Arrays & Hashingsliding-windowbinary-searchtwo-pointeroptimization
  • Arrays & HashingMediumAuto-graded
    Longest Subarray with Bounded Pairwise Spread

    Tests 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.

    Arrays & Hashingarraystwo pointerssliding window
  • Arrays & HashingHardAuto-graded
    Tiered Subscription Invoice with Mid-Cycle Proration

    Tests ability to combine prorated flat fees with two-tier volume pricing over a half-open time window.

    Arrays & Hashingsimulationmathaggregation
  • Arrays & HashingHardAuto-graded
    Experiment Sample Size and Runtime Calculator

    Tests ability to apply the two-sample normal approximation for A/B test sizing and convert a required sample count into a minimum experiment duration.

    Arrays & Hashingstatisticsexperimentationa-b-testing
  • Arrays & HashingMediumAuto-graded
    Grid Sentinels: Match Robots by Barrier Distance Profile

    Tests efficient 2-D prefix sweeps to compute each robot's nearest-wall distance in four directions and filter by an exact profile query.

    Arrays & Hashingmatrixprefix-scansimulation
  • Arrays & HashingMediumAuto-graded
    Find Most Common Elements Without Built-in Max

    Tests manual maximum-finding across a frequency dictionary, tie-breaking by first occurrence, and working with stringified keys.

    Arrays & Hashinghash-mapfrequency-countingiteration
  • Arrays & HashingEasyAuto-graded
    Random Assignment Statistics with Replacement

    Compute expected allocation count, reachability probability, and expected coverage when distributing items randomly with replacement.

    Arrays & Hashingprobabilityexpectationbinomialcomplement-rule
  • Arrays & HashingMediumAuto-graded
    Find Pair with Given Sum

    Tests the ability to use hash-based lookups for constant-time complement checking and handle input validation rigorously.

    Arrays & Hashinghash-tabletwo-pointersarray
  • Arrays & HashingMediumAuto-graded
    Cluster Viewers by Recent Watch Set

    Tests dictionary grouping, set operations on list suffixes, and canonical key construction for equivalence classes.

    Arrays & Hashinghash-mapset-operationsgrouping
  • Arrays & HashingMediumAuto-graded
    Verify Safe Spacing During Multi-Vehicle Forward Simulation

    Tests discrete-time physics simulation with kinematic updates and safety constraint checking across multiple moving objects.

    Arrays & Hashingsimulationphysicsiteration