KatInterview

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

Arrays & Hashing Interview Problems

Practice 5967 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.

5967
Problems
2210
Auto-graded
15
Topics
272
Added today

Showing 451–475 of 475 results

  • Arrays & HashingEasyAuto-graded
    Combine Two Ordered Sequences

    Tests your ability to merge two pre-sorted arrays into a single sorted result using the classic two-pointer technique.

    Arrays & Hashingtwo-pointerssortingmerge
  • Arrays & HashingEasyAuto-graded
    Track Target Occurrence Patterns Across Array Regions

    Identifies whether a target value occurs at even/odd indices and in the first/second half of an even-length array in one pass.

    Arrays & Hashingarray-traversalboolean-flagsearly-termination
  • Arrays & HashingEasyAuto-graded
    Apply Range Paint Operations and Count Final Colors

    Tests ability to use difference arrays to efficiently apply multiple range-update operations and decode the final state.

    Arrays & Hashingarraysdifference arrayprefix sumshashing
  • Arrays & HashingMediumAuto-graded
    Population Size from Two-Sample Overlap

    Apply the capture-recapture estimator to infer total population size from overlapping detection counts.

    Arrays & Hashingstatisticsestimationprobability
  • Arrays & HashingMediumAuto-graded
    Event Log Analysis: Distinct Users and Session Duration

    Tests grouping, deduplication, and timestamp arithmetic over semi-structured event records.

    Arrays & Hashinggroupingaggregationtimestampsdata-wrangling
  • Arrays & HashingMediumModel answer
    Chess Queen Line-of-Sight Attack Counting

    Calculate how many chess queens can attack each query position, first without obstacles, then accounting for blocking pieces on the board.

    Arrays & Hashinggeometryhash-mapbinary-searchsorting
  • Arrays & HashingMediumAuto-graded
    Ride Service Demand Under Weather Conditions

    Apply the Law of Total Probability and Bayes' Theorem to compute ride request likelihoods and conditional weather probabilities.

    Arrays & Hashingprobabilitybayes-theoremconditional-probability
  • Arrays & HashingMediumAuto-graded
    Retrieve Minimum and Mode from Array

    Tests efficient computation of two simple aggregate statistics using optimal data structures and complexity analysis.

    Arrays & Hashinghash-mapscountingcomplexity-analysis
  • Arrays & HashingMediumAuto-graded
    Validate Partially Filled Sudoku Grid

    Tests ability to check constraint satisfaction across multiple overlapping groups using efficient duplicate detection.

    Arrays & Hashinghash-setconstraint-checkingmatrix
  • Arrays & HashingMediumAuto-graded
    Calculate Upper-Tail Probability for Binomial Distribution

    Compute the exact cumulative probability P(X ≥ k) for a binomial random variable, testing understanding of numerical stability in probability calculations.

    Arrays & Hashingprobabilitybinomial-distributionnumerical-methods
  • Arrays & HashingHardAuto-graded
    Bayesian A/B Test Launch Decision with Cost Tradeoffs

    Tests whether a candidate can combine Bayesian posterior updating with expected-value analysis to make a statistically grounded product launch decision.

    Arrays & Hashingbayesian-inferencedecision-analysisab-testing
  • Arrays & HashingMediumAuto-graded
    Peak Subarray, Lone Value, and Spiral Grid Traversal

    Tests Kadane's algorithm with tie-breaking, frequency-based minimum selection, and counterclockwise skip-step grid simulation in one combined function.

    Arrays & Hashingarraysdynamic-programmingsimulation
  • Arrays & HashingEasyAuto-graded
    Correcting Sampling Bias When Counting Children Per Household

    Tests whether a candidate can identify and reverse length-biased sampling to recover true household-level proportions from child-level survey data.

    Arrays & Hashingprobabilitysampling-biasweighted-estimation
  • Arrays & HashingMediumModel answer
    Build an Annotation Assignment Schedule

    Construct a valid work schedule assigning human reviewers to tasks under minimum-coverage and no-repeat constraints, then extend it to stay balanced in every prefix.

    Arrays & Hashingconstructiveschedulingcombinatorics
  • Arrays & HashingMediumAuto-graded
    Coffee Quality Comparison Probability

    Calculate the probability that one person's coffee selections outperform another's under different definitions of "better"

    Arrays & Hashingprobabilitycombinatoricssymmetry
  • Arrays & HashingEasyAuto-graded
    Complete the Run: Find the Gap in a Five-Card Sequence

    Tests ability to handle encoded card ranks, Ace-as-low/high semantics, ambiguous endpoints, and missing-element logic in a fixed consecutive sequence.

    Arrays & Hashingarraysstringsenumeration
  • Arrays & HashingEasyAuto-graded
    Find the First Character Appearing Exactly Once

    Tests the ability to use hash counting (frequency maps) to efficiently locate the first character in a string that appears exactly once.

    Arrays & Hashingarrays & hashinghash countingstrings
  • Arrays & HashingEasyAuto-graded
    Find the Most Frequent Character Difference

    Tests whether a candidate can use hash counting to find the pair of distinct characters whose absolute frequency difference is largest in a given string.

    Arrays & Hashingarrays & hashinghash countingstrings
  • Arrays & HashingEasyAuto-graded
    Longest Subarray with Sum At Most K

    Tests the ability to apply a sliding window to find the longest contiguous subarray whose element sum does not exceed a given limit.

    Arrays & Hashingarrayssliding windowprefix sums
  • Arrays & HashingHardAuto-graded
    Minimum Window Containing All Balanced Bracket Types

    Tests ability to use hash counting with a sliding window to find the shortest contiguous subarray that contains at least k complete pairs of each bracket type.

    Arrays & Hashingarrayshash mapsliding windowtwo pointers
  • Arrays & HashingMediumAuto-graded
    Partition Array by Parity of Frequency

    Tests in-place partitioning using a hash map to precompute element frequencies, then a two-pointer scheme to rearrange elements without extra array allocation.

    Arrays & Hashingarrayshash mapstwo pointersin-place partitioning
  • Arrays & HashingMediumAuto-graded
    Partition Array Into Alternating Parity Groups

    Tests in-place partitioning by rearranging an integer array so all even-indexed positions hold even numbers and all odd-indexed positions hold odd numbers, without allocating a new array.

    Arrays & Hashingarraystwo pointersin-place partitioning
  • Arrays & HashingEasyAuto-graded
    Longest Subarray with At Most K Distinct Flavors

    Tests the classic sliding window pattern for finding the longest contiguous subarray containing at most K distinct values.

    Arrays & Hashingarrayssliding windowhash map
  • Arrays & HashingEasyAuto-graded
    Bouquet Sales: Count Days With Enough Flowers

    Tests the difference-array technique by efficiently applying ranged inventory updates and then scanning totals to answer threshold queries.

    Arrays & Hashingarraysdifference arrayprefix sumshashing
  • Arrays & HashingEasyAuto-graded
    Range Sum Queries on a Mutating Snapshot

    Tests ability to use prefix sums to efficiently answer multiple range-sum queries on a fixed array.

    Arrays & Hashingarraysprefix sumshashing