KatInterview

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

Arrays & Hashing Interview Problems

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

5974
Problems
2212
Auto-graded
15
Topics
269
Added today

Showing 151–180 of 476 results

  • 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 & HashingMediumModel answer
    Uniform Random Array Partitioning into K Segments

    Divide an array into K non-empty contiguous slices such that every valid partition is equally likely to be selected.

    Arrays & Hashingarraysmath-bitsheaps-sorting
  • 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 & HashingMediumModel answer
    Paginated API Fetching and Data Merging

    Fetch paginated JSON payloads from two separate endpoints, defensively clean and transform records, and merge them on a common key preserving the original sequence.

    Arrays & Hashingpaginationhttp-requestshash-tabledata-cleaning
  • 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
  • Arrays & HashingEasyAuto-graded
    Static Array Range Sum Queries

    Process a sequence of range sum queries on an immutable array efficiently using prefix sums.

    Arrays & Hashingarraysprefix-sumdata-structures
  • Arrays & HashingMediumAuto-graded
    Survey Click-Through and Score Averages from Impression Logs

    Group survey impression records to compute a click rate, a plain score average, and an average of each user's earliest score per survey, with careful handling of missing values.

    Arrays & Hashinghash-mapgroupingsortingnull-handling
  • Arrays & HashingMediumAuto-graded
    Can Your Unfinished Poker Hand Overtake a Showdown Hand?

    Decide whether a 3 or 4 card poker hand can be filled from the unseen deck into a five-card hand that strictly outranks a revealed five-card hand.

    Arrays & Hashingsimulationbrute-forcecombinationspoker
  • Arrays & HashingMediumModel answer
    Modern Java 8 Toolkit: Lambdas, Streams, Optional, java.time

    Explain the major Java 8 language and library additions, when each one fits, and the common pitfalls, using short code examples.

    Arrays & Hashingjavajava-8lambdasstreams
  • Arrays & HashingEasyAuto-graded
    Simulate Slice Appending in Go

    Simulate how slicing and slice appending mutate backing arrays and slice headers in Go.

    Arrays & Hashingarrayssimulation
  • Arrays & HashingEasyAuto-graded
    Target Token Loss and Exponential Uncertainty Score

    Compute the mean negative log-likelihood across target tokens and convert it into perplexity for a given logarithm base.

    Arrays & Hashingmachine-learningmathnlp
  • Arrays & HashingEasyAuto-graded
    Bayesian Origin Probability for Sampled Items

    Calculate the posterior probability that two black items came from a specific facility using Bayes' Theorem.

    Arrays & Hashingstatisticsprobabilitybayes-theorem
  • Arrays & HashingEasyAuto-graded
    Overlap Ratio of Two Token Lists

    Compute the overlap ratio between the distinct strings of two lists using hash sets, with exact string matching and a defined result when both lists are empty.

    Arrays & Hashinghash-setsetsstringsedge-cases
  • Arrays & HashingMediumAuto-graded
    Most Popular Three-Page Browsing Path Across Users

    Group visit logs by user, order them by time, and find the three-page ordered path shared by the most distinct users, with a lexicographic tie-break.

    Arrays & Hashinghashingsortingcombinationscounting
  • Arrays & HashingHardAuto-graded
    Calculate Expected Roll Counts for Target Dice Sequences

    Evaluate expected values for geometric process waiting times and pattern completion using Markov chain state transitions.

    Arrays & Hashingprobabilityexpected-valuemarkov-chainscombinatorics
  • Arrays & HashingEasyAuto-graded
    Find Minimum and Mode of an Integer Array

    Find the minimum element and the most frequent element (mode) in an unsorted list of integers.

    Arrays & Hashingarrayshash-tablefrequency-counting
  • Arrays & HashingEasyAuto-graded
    Reverse Array Segment Between First Two Target Occurrences

    Reverse the subsegment of an array from the first occurrence of a target value up to its second occurrence.

    Arrays & Hashingarraystwo-pointersslicing
  • Arrays & HashingMediumAuto-graded
    Runners on a Road Frozen by a Sweeping Guard

    Simulate runners advancing along a road while a guard turns at given seconds and freezes anyone in view, using parity of duplicate turn times and strict event ordering.

    Arrays & Hashingsimulationhash-mapcountingparity
  • Arrays & HashingEasyAuto-graded
    Push Zeros Left While Keeping Other Values in Order

    Rearrange an integer list in place so all zeros come first and the non-zero values keep their original relative order, using a right-to-left two-pointer pass.

    Arrays & Hashingarraystwo-pointersin-place
  • Arrays & HashingMediumAuto-graded
    Four-Position Target Sum Finder Preserving Original Indices

    Find all increasing index quadruples whose values add up to a target, treating equal values at different positions as distinct answers; tests hashing pair sums and ordering.

    Arrays & Hashinghash-mapmeet-in-the-middlek-sumindices
  • Arrays & HashingEasyAuto-graded
    Softmax-Weighted Value Mixing for Query Rows

    Implement scaled dot-product attention on nested lists using a numerically stable softmax and a weighted average of value rows.

    Arrays & Hashingmatrixsoftmaxnumerical-stabilityattention
  • Arrays & HashingEasyAuto-graded
    Find the Modal Number, Smallest on a Tie

    Tests frequency counting with a hash map and a deterministic numeric tie-break, returning the value itself without altering the input list.

    Arrays & Hashinghash-mapcountingtie-breaking
  • Arrays & HashingMediumAuto-graded
    Merge Sensor Readings into Qualifying State Runs

    Group consecutive identical-state readings into runs, then keep only runs whose last-minus-first timestamp span meets a minimum threshold.

    Arrays & Hashingrun-lengthsingle-passsimulationgrouping
  • Arrays & HashingMediumAuto-graded
    Widest Window With an Exact Total in a Signed Sequence

    Find the longest contiguous run in an integer list (negatives and zeros allowed) whose total equals a target, using prefix sums and a hash map of earliest positions.

    Arrays & Hashingprefix-sumhash-mapsubarray