KatInterview

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

Arrays & Hashing Interview Problems

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

5972
Problems
2212
Auto-graded
15
Topics
273
Added today

Showing 361–390 of 476 results

  • Arrays & HashingMediumAuto-graded
    Sample Size Calculator for Two-Proportion Z-Test

    Tests ability to implement statistical power calculations for comparing two binary outcome rates in experimental design.

    Arrays & Hashingexperimentationstatisticspower-analysis
  • Arrays & HashingMediumAuto-graded
    Rotation Distance: Sum Absolute Differences Across All Shifts

    Tests array rotation mechanics, computing position-wise absolute differences for every cyclic offset, and returning results in sorted order.

    Arrays & Hashingarraysrotationsorting
  • Arrays & HashingMediumAuto-graded
    Contiguous Subarray Sum Count

    Tests prefix sum technique with hash maps to count subarrays matching a target sum in linear time

    Arrays & Hashingprefix-sumhash-mapsubarray
  • Arrays & HashingMediumAuto-graded
    Identify All Projects with Maximum Team Size

    Group assignment pairs by project, count members per project, and return every project tied for the largest team.

    Arrays & Hashingarrayshashinggroupingcounting
  • Arrays & HashingMediumAuto-graded
    Minimum Operations to Equalize Array by Selective Increments

    Tests insight that incrementing all-but-one is equivalent to decrementing one, leading to a sum-based formula instead of simulation.

    Arrays & Hashingmatharraysgreedy
  • Arrays & HashingEasyAuto-graded
    Best-of-Five: Probability All Five Games Are Played

    Tests whether a candidate can derive the closed-form probability that a best-of-five series requires all five games, using combinatorial reasoning.

    Arrays & Hashingprobabilitycombinatoricsmath
  • Arrays & HashingEasyAuto-graded
    Expected Coin Flips to Observe Heads Then Tails

    Tests ability to model a probabilistic process with states and solve expectation equations.

    Arrays & Hashingprobabilityexpected-valuemarkov-chains
  • Arrays & HashingMediumAuto-graded
    Sample Mean: Expected Value and Variance Under Correlation

    Tests ability to compute the expected value and variance of a sample mean when observations share a common correlation, plus limiting behavior in boundary cases.

    Arrays & Hashingstatisticsprobabilityexpected-valuevariance
  • Arrays & HashingHardAuto-graded
    Find All Contiguous Segments with Target Total

    Tests prefix sum tracking with hash maps to efficiently count all contiguous subsequences that sum to a target value.

    Arrays & Hashingprefix-sumhash-maparray
  • Arrays & HashingEasyAuto-graded
    Daily-Deal Voucher: Restaurant Profit & Break-Even Analysis

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

    Arrays & Hashingunit economicscontribution marginbreak-even analysis
  • Arrays & HashingEasyAuto-graded
    Tight Probability Bounds for the Union of Two Events

    Tests whether a candidate can derive the Fréchet bounds on P(A ∪ B) given only the marginal probabilities of two events with unspecified dependence.

    Arrays & Hashingprobabilityboundsinclusion-exclusion
  • Arrays & HashingEasyAuto-graded
    Mean Distinct Item Count Per Group

    Tests ability to deduplicate items within groups, handle null values, and compute aggregated metrics with proper rounding.

    Arrays & Hashinghash-mapsetaggregationdata-processing
  • Arrays & HashingMediumAuto-graded
    Seven-Segment Display 180° Rotation Symmetry

    Determine if a sequence of seven-segment digits appears identical when the entire display is flipped upside down.

    Arrays & Hashingarrayssimulationmapping
  • Arrays & HashingMediumAuto-graded
    Group and Rank Users by Average Value

    Tests efficient grouping and aggregation over dictionaries, plus multi-key sorting to produce ordered output.

    Arrays & Hashingaggregationdictionariessorting
  • Arrays & HashingEasyAuto-graded
    Filter and Sort Items by Embedding Similarity Score

    Tests vector scoring with dot products, stable sorting with tie-breaking, and set-based filtering of excluded indices.

    Arrays & Hashingarrayssortingfiltering
  • Arrays & HashingMediumAuto-graded
    Suffix Maximum Frequency Count

    Computes how many times the largest element appears in each suffix of an array using a single backward scan.

    Arrays & Hashingarrayssuffix-queriessingle-pass
  • Arrays & HashingEasyAuto-graded
    Rank Nearest Neighbors by Mean Squared Error

    Tests k-nearest neighbors search with distance computation, NULL handling, and top-k selection with tie-breaking.

    Arrays & Hashingsimilaritydistance-metricsrankingdata-processing
  • Arrays & HashingMediumModel answer
    Proportional Stratified Sampling with Largest Remainder Allocation

    Sample records from grouped data while preserving stratum proportions, using the largest remainder method to allocate exact counts and seeded random selection.

    Arrays & Hashingsamplinggroupinghash-tablerandomization
  • Arrays & HashingMediumAuto-graded
    Zero-Sum Triplets in an Array

    Tests two-pointer technique on sorted arrays, duplicate avoidance, and quadratic complexity optimization for finding triplet combinations.

    Arrays & Hashingtwo-pointerssortingarray-traversal
  • Arrays & HashingMediumAuto-graded
    Sliding Window Average over an Integer Sequence

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

    Arrays & Hashingsliding-windowarraystwo-pointers
  • Arrays & HashingMediumAuto-graded
    Collect Characters by Walking a Grid

    Tests grid traversal with directional commands, run-length encoding, and boundary/obstacle validation.

    Arrays & Hashingmatrixsimulationstring-building
  • Arrays & HashingMediumAuto-graded
    Reorganize Array Elements by Hash-Based Bucket Assignment

    Tests understanding of parallel counting, prefix sums, and scatter operations to group array elements into contiguous buckets.

    Arrays & Hashingcountingprefix-sumpartitioning
  • Arrays & HashingMediumAuto-graded
    Difference in Proportions Confidence Interval

    Tests understanding of statistical inference by computing a confidence interval for the difference between two independent proportions.

    Arrays & Hashingstatisticshypothesis-testingconfidence-intervalsexperimental-design
  • Arrays & HashingMediumAuto-graded
    Repair a Looping Script by Swapping One Instruction

    Tests simulation, cycle detection, and brute-force search by finding the single jmp/nop swap that lets a small virtual machine terminate cleanly.

    Arrays & Hashingsimulationcycle-detectionbrute-force
  • Arrays & HashingEasyAuto-graded
    Classify Temperatures into Three Weather Bands

    Tests careful boundary handling by bucketing integer temperatures into cold, mild, and hot ranges and returning the three counts in order.

    Arrays & Hashingarrayscountingboundary conditions
  • Arrays & HashingMediumAuto-graded
    Rectangular Stamp Overlap Counter

    Tests whether a candidate can use a 2D difference array to efficiently count how many rectangular regions overlap each cell of a grid.

    Arrays & Hashing2d-arrayprefix-sumdifference-array
  • Arrays & HashingEasyAuto-graded
    Find Days Available to All Participants

    Tests set intersection logic and handling of multiple collections to find common elements across all inputs.

    Arrays & Hashingsetsintersectionarrays
  • Arrays & HashingMediumAuto-graded
    Puddles in a Valley: Water Volume Between Terrain Columns

    Tests whether a candidate can compute trapped water volume across a height profile using the two-pointer O(1)-space technique.

    Arrays & Hashingtwo-pointersprefix-maxarrays
  • Arrays & HashingHardAuto-graded
    Distinct Value Sum Across Peak-Score Square Ring Windows

    Tests 2D prefix sums, border enumeration, multi-way tie tracking, and cross-frame value deduplication on square ring-shaped windows of a matrix.

    Arrays & Hashing2d-prefix-summatrixsliding-window
  • Arrays & HashingMediumAuto-graded
    Best Single-Breakpoint Step-Function Fit

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

    Arrays & Hashingarraysmathprefix-sums