KatInterview

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

Arrays & Hashing Interview Problems

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

5973
Problems
2212
Auto-graded
15
Topics
271
Added today

Showing 121–150 of 436 results

  • Arrays & HashingEasyAuto-graded
    Order Each Neighboring Couple in a List, Skipping a Lone Tail

    Reorder the two values inside every consecutive couple of a list so the smaller comes first, keeping couples in place and leaving an unpaired final value alone.

    Arrays & Hashingarraystwo-pointerssimulationindex-handling
  • Arrays & HashingMediumAuto-graded
    2D Matrix Cross-Correlation Filter

    Compute the 2D cross-correlation between a grid matrix and a filter kernel using valid padding and stride 1.

    Arrays & Hashingarraysmatrix
  • Arrays & HashingEasyAuto-graded
    Binomial Process Modeling and Moment Computation

    Return theoretical properties and compute the expected value and variance for a Binomial random variable given sample size n and success probability p.

    Arrays & Hashingbinomialprobabilitystatisticsmath
  • Arrays & HashingMediumAuto-graded
    Most Common Values with First-Seen Tie-Breaking

    Return the k most frequent values in an integer list, ordered by count and then by first appearance, using hash counting and frequency buckets for linear time.

    Arrays & Hashinghash-mapbucket-sortfrequency-counttop-k
  • Arrays & HashingEasyAuto-graded
    Square Windows Containing Each Marked Cell

    Map each marked grid cell to the sorted top-left corners of all in-bounds 2x2 windows that contain it, testing coordinate arithmetic and bounds handling.

    Arrays & Hashinggridhash-mapcoordinatesenumeration
  • Arrays & HashingEasyAuto-graded
    Screening a Vendor Identity-Check Response

    Validate a nested vendor response with strict type checks, then apply ordered business rules to return the first failing reason code.

    Arrays & Hashingvalidationhash-maptype-checkingsimulation
  • Arrays & HashingMediumAuto-graded
    Next Lexicographic Ordering Plus Left-to-Right Calculator

    Rearrange an array in place into its next lexicographic ordering, and evaluate a parenthesis-free arithmetic string with truncating division, both in linear time.

    Arrays & Hashingnext-permutationtwo-pointersexpression-parsingin-place
  • Arrays & HashingEasyAuto-graded
    Dot Product of Two Run-Length Encoded Vectors

    Compute the dot product of two run-length encoded integer vectors by walking both run lists together, without expanding them into full arrays.

    Arrays & Hashingtwo-pointersrun-length-encodingsimulation
  • Arrays & HashingEasyAuto-graded
    Calculate Mean and Variance for the Sum of Two Variables

    Compute the expected value and total variance of the combined sum of two random variables given their individual means, variances, and covariance.

    Arrays & Hashingstatisticsprobabilitymath
  • Arrays & HashingMediumAuto-graded
    Resolve Callable Names from Argument Type Lists

    Match call argument types against registered signatures, some with a trailing repeatable parameter, and return the sorted names of every signature that fits each call.

    Arrays & Hashinghashingstringsvariadic-matchingprefix-keys
  • Arrays & HashingEasyAuto-graded
    Increment Large Integer Represented as Digits

    Process an array of decimal digits representing a non-negative integer by adding one, correctly handling carry propagation and list expansion.

    Arrays & Hashingarraysmath-bitseasy
  • Arrays & HashingEasyAuto-graded
    Activity Windows from Sensor Readings Over a Cutoff

    Scan sorted timestamped sensor readings once and group consecutive readings strictly above a cutoff into [first_time, last_time] windows.

    Arrays & Hashingarraystwo-pointersintervalssimulation
  • Arrays & HashingMediumAuto-graded
    Firebreak Choice in a Spreading Crop Disease Grid

    Simulate a synchronous grid disease model with delayed death or recovery, then try every single-row or single-column firebreak to minimize dead plants.

    Arrays & Hashingsimulationgridbrute-forcecellular-automaton
  • Arrays & HashingMediumAuto-graded
    Calculate Welch's T-Test P-Value for Experiment Rides

    Process user experiment assignments and ride telemetry data to calculate a Welch's two-sample t-test p-value under strict filtering rules.

    Arrays & Hashingstatisticsdata-processinghypothesis-testing
  • Arrays & HashingMediumAuto-graded
    Per-Unit Coupon Pricing with Half-Even Cent Rounding

    Total a shopping cart where each coupon discounts one unit of its item, with percent discounts rounded half-to-even in exact integer arithmetic.

    Arrays & Hashinghash-mapsimulationroundinginteger-math
  • Arrays & HashingEasyAuto-graded
    Compute Post-Match Standardized Mean Differences

    Evaluate post-matching covariate balance by computing the absolute standardized mean difference across features.

    Arrays & Hashingstatisticsmath-bitsarrays
  • Arrays & HashingEasyAuto-graded
    Rollout Impact: Diff-in-Diff Estimate with Baseline Drift Check

    Aggregate per-group, per-window means from daily records, compute a difference-in-differences estimate, and flag baseline drift between two pre-period sub-windows.

    Arrays & Hashinghashingaggregationstatisticsdate-windows
  • Arrays & HashingEasyAuto-graded
    Generate Cartesian Product of Search Space Parameters

    Construct all explicit configurations from a dictionary mapping parameter names to lists of candidate values using Cartesian product generation.

    Arrays & Hashingcartesian-productgeneratorarraysdictionary-manipulation
  • Arrays & HashingMediumAuto-graded
    Find Most Overlapping Pair of Sets

    Find the pair of set keys with the highest intersection size, using Jaccard similarity and lexicographical order as tie-breakers via an inverted index approach.

    Arrays & Hashinginverted-indexhash-tablearraysstring
  • Arrays & HashingMediumAuto-graded
    Grid Editor: Flip Rows, Swap Rows, and Turn Clockwise

    Simulate a sequence of string commands (row reversal, row swap, 90-degree clockwise turn) on a rectangular grid whose shape changes after each turn.

    Arrays & Hashingmatrixsimulationstring-parsingrotation
  • Arrays & HashingMediumAuto-graded
    Product of Two Mostly-Zero Grids

    Compute the product of two mostly-zero integer matrices by precomputing nonzero positions so that no work is spent on zero operands.

    Arrays & Hashingmatrixsparsesimulationhashing
  • Arrays & HashingEasyAuto-graded
    Modular Product Exclude Current Element

    Compute the modular product of all elements in an array except the current element for each index without division.

    Arrays & Hashingarraysprefix-summath
  • Arrays & HashingEasyAuto-graded
    Compute Aggregate Distance Tolls for Interleaved Logs

    Process interleaved time-ordered scanner events to compute cumulative segment-based charges across all entities.

    Arrays & Hashinghash-maparraysimulation
  • Arrays & HashingMediumAuto-graded
    Quickest Way to Cover a Set Distance From Per-Interval Odometer Data

    Find the top average speed over any time window covering exactly a target distance, given piecewise-constant speeds. Tests prefix sums, interpolation and binary search.

    Arrays & Hashingprefix-sumsbinary-searchinterpolationtwo-pointers
  • Arrays & HashingMediumAuto-graded
    Paint Stacked Boxes onto a Character Grid

    Simulate painting bordered, filled boxes onto a fixed-size text grid, clipping to the grid while keeping border and interior status based on the full box.

    Arrays & Hashingsimulation2d-gridclippingstrings
  • Arrays & HashingEasyAuto-graded
    Fill a Grid With Connected Crop Strips in Snake Order

    Build an N by M grid in which each crop forms one edge-connected region, using a snake-order fill with a fixed, deterministic output.

    Arrays & Hashinggridconstructionsimulationserpentine
  • Arrays & HashingEasyAuto-graded
    Most Frequent Log Error Codes in Time Interval

    Filter log entries within a half-open time interval, compute occurrence frequencies, and retrieve the top k error codes sorted by frequency and string order.

    Arrays & HashingArrays & HashingSortingHash Table
  • Arrays & HashingMediumAuto-graded
    Validated Config-Driven LiDAR Scan Processor

    Validate a declarative list of crop and rigid-transform steps up front, then apply them in order to a point list while tracking metadata, without mutating the inputs.

    Arrays & Hashingsimulationvalidationmatrix-transformfiltering
  • Arrays & HashingEasyAuto-graded
    Calculate Sample Size per Variant for A/B Testing

    Compute the minimum sample size required per group for a two-sample z-test given standard deviation, MDE, power, and significance level.

    Arrays & Hashingstatisticsa-b-testinghypothesis-testingmath
  • Arrays & HashingMediumAuto-graded
    Fit a Line by Full-Batch Gradient Descent on Squared Error

    Implement full-batch gradient descent for a one-feature linear model, using gradients from the old parameters at every step to update the slope and intercept together.

    Arrays & Hashinggradient-descentlinear-regressionnumericalsimulation