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 241–270 of 437 results

  • Arrays & HashingMediumAuto-graded
    Longest Contiguous Subarray with a Target Sum

    Tests prefix-sum reasoning, hash-map lookups, and precise tie-breaking to find the longest subarray summing to exactly k.

    Arrays & Hashingprefix-sumshash-maparrays
  • Arrays & HashingEasyAuto-graded
    Aggregate Parallel Pipeline Results Safely

    Fix async pool usage so results are collected in order, worker errors surface, and one JSON file is written.

    Arrays & Hashingmultiprocessingconcurrencydebuggingfile-io
  • Arrays & HashingMediumAuto-graded
    Compress Sorted Array to Unique Elements

    Tests in-place array manipulation with two-pointer technique to remove duplicates from a sorted sequence.

    Arrays & Hashingtwo-pointersin-placesorted-array
  • Arrays & HashingMediumAuto-graded
    Three-Dice Payout: Expected Value by Match Type

    Tests ability to count outcome classes for three N-sided dice and combine probability-weighted payoffs into an expected value, including a sign-flip variant.

    Arrays & Hashingexpected-valueprobabilitycounting
  • Arrays & HashingMediumAuto-graded
    K-Means Clustering: Assignment, Update, and Convergence

    Tests ability to implement the full k-means loop — initialization, Euclidean assignment, centroid update, convergence check, and empty-cluster handling — in plain Python.

    Arrays & Hashingclusteringiterative-algorithmsnumerical
  • Arrays & HashingMediumAuto-graded
    Align Time Series with Linear Interpolation

    Tests piecewise-linear interpolation, binary search, and boundary handling for sampling two time series at common timestamps.

    Arrays & Hashinginterpolationbinary-searchtime-series
  • Arrays & HashingMediumAuto-graded
    Profit, Collinearity, and Identity Merging in Three Parts

    Tests one-pass array scanning, integer-arithmetic collinear point detection, and union-find graph component grouping in a single combined function.

    Arrays & Hashingarraysmathunion-find
  • Arrays & HashingMediumAuto-graded
    Grid Walker with Blocked Cells

    Tests simulation with hash-based obstacle lookup, movement logic, and tracking a running maximum over coordinate positions.

    Arrays & Hashingsimulationhash-setgrid
  • Arrays & HashingMediumAuto-graded
    Single Buy-Sell Transaction for Maximum Gain

    Tests optimal single-pass tracking of minimum buy price to maximize profit from one stock transaction.

    Arrays & Hashingarraysgreedyoptimizationsingle-pass
  • Arrays & HashingMediumAuto-graded
    Build Sorted Email Event Timeline for Subscriptions

    Tests date arithmetic, multi-level sort stability, and designing a rule system that cleanly handles event ordering and extensibility.

    Arrays & Hashingsortingdatessimulation
  • Arrays & HashingMediumAuto-graded
    Count Members With Continuous Subscription at Final Timestamp

    Tests per-entity state simulation where a subscription can only be renewed while still active, and any lapsed subscription is permanently void.

    Arrays & Hashingsimulationhash-mapstate-machine
  • Arrays & HashingMediumAuto-graded
    Posterior Probability of Facility Given Red Samples

    Tests Bayesian reasoning: computing the posterior probability of a hypothesis using likelihoods and equal priors.

    Arrays & Hashingprobabilitybayes-theoremmathematical-reasoning
  • Arrays & HashingMediumAuto-graded
    All Orderings and Subsets of Distinct Integers

    Tests recursive backtracking by building every permutation and every k-length subset of a list of distinct integers in a single function.

    Arrays & Hashingbacktrackingrecursioncombinatorics
  • Arrays & HashingHardAuto-graded
    Cell Absorption Simulation: Dominant Cell After Feeding Rounds

    Simulate a row of cells that absorb weaker neighbors across repeated left-to-right rounds and identify the largest survivor at equilibrium.

    Arrays & Hashingsimulationarrayslist-mutation
  • Arrays & HashingMediumAuto-graded
    Merge Two Sorted Lists Into a Padded Buffer

    Merge a sorted list into the sorted prefix of a larger list that ends with unused slots, writing in place with constant extra memory.

    Arrays & Hashingtwo-pointersin-placesorted-arraysmerge
  • Arrays & HashingMediumAuto-graded
    Count Close Triplets Within a Value Range

    Tests sorting, sliding window, and combinatorial counting to find how many index-distinct triplets fit within a given value spread.

    Arrays & Hashingsliding-windowsortingcombinatorics
  • Arrays & HashingMediumAuto-graded
    Grid Walk With Clockwise Redirects at Walls and Obstacles

    Tests grid simulation by traversing a matrix in a right-biased clockwise walk that turns at boundaries, visited cells, and blocked positions until no move is possible.

    Arrays & Hashingmatrixsimulationgrid
  • Arrays & HashingMediumAuto-graded
    Stable Grouping and Column Gravity

    Tests stable partitioning of categorized strings and simulating gravity on independent grid columns

    Arrays & Hashingarrayssortingsimulationtwo-pointers
  • Arrays & HashingHardAuto-graded
    Estimating the Probability of a Dice Sum Exceeding a Target

    Apply the central limit theorem and continuity correction to approximate the tail probability of a sum of independent discrete random variables.

    Arrays & Hashingprobabilitycentral-limit-theoremnormal-approximationcontinuity-correction
  • Arrays & HashingMediumAuto-graded
    Evaluate Request Status from Rule Matches

    Tests rule-based decision logic with subset matching and outcome priority resolution when multiple rules apply simultaneously.

    Arrays & Hashingset-operationslogicprecedence
  • Arrays & HashingMediumAuto-graded
    Instrument-Based Estimator for a Randomized Encouragement Trial

    Tests whether a candidate can implement ITT, first-stage, and IV/Wald (LATE) estimators from a randomized encouragement design, including a balance check on pre-treatment activity.

    Arrays & Hashingcausal-inferencea-b-testinginstrumental-variables
  • Arrays & HashingMediumAuto-graded
    Deduplicate Coordinate List with Index Mapping

    Tests the ability to extract distinct elements while preserving first-occurrence order and building an index array for reconstruction.

    Arrays & Hashinghashingdeduplicationindexing
  • Arrays & HashingMediumAuto-graded
    Alternating Chain Assembly from Both Ends

    Tests two-pointer simulation with alternating turns, conditional greedy selection rules, tie-breaking logic, and strict-increase constraints.

    Arrays & Hashingsimulationtwo-pointersarrays
  • Arrays & HashingHardAuto-graded
    Difference-in-Differences Estimator with Baseline Gap Check

    Tests understanding of causal inference mechanics by computing a DID treatment effect and flagging baseline imbalance from panel observations.

    Arrays & Hashingcausal-inferencedata-analysisdifference-in-differences
  • Arrays & HashingHardAuto-graded
    Data-Driven Fare Policy Rule Engine

    Evaluate stored fare and per-driver policy rules over a trip table with generic field/operator conditions and exact integer-cent sums.

    Arrays & Hashinghash-mapsortingrule-enginesimulation
  • Arrays & HashingMediumAuto-graded
    Transform a Sorted Array with a Quadratic

    Evaluate a quadratic expression at every element of a sorted array and emit the results in ascending order in linear time.

    Arrays & Hashingtwo-pointerssortingmathmonotonic
  • Arrays & HashingHardAuto-graded
    All MEX Values After One Optional Increment

    Find every possible MEX after incrementing at most one array element by 1, respecting an upper-bound constraint.

    Arrays & Hashingarraysgreedymathcase-analysis
  • Arrays & HashingEasyAuto-graded
    Count Strictly Rising Signal Windows

    Count how many contiguous subarrays of length exactly k have strictly increasing values in a signal array.

    Arrays & Hashingarrayssliding-windowcounting
  • Arrays & HashingMediumAuto-graded
    Length of the Longest Run of Consecutive Integers

    Tests whether a candidate can find the longest chain of consecutive integers in an unsorted array in linear time using a hash set.

    Arrays & Hashinghash-setarrayssequences
  • Arrays & HashingMediumAuto-graded
    Longest Strictly Increasing Contiguous Run

    Tests whether a candidate can scan an array in a single linear pass to find the length of the longest strictly increasing contiguous run.

    Arrays & Hashingarrayssliding-windowgreedy