KatInterview

Topic

Arrays & Hashing interview problems

Two pointers, prefix sums, hash maps and sliding windows. 475 original problems, each with hidden test cases you can run in the browser.

Problems475

135 easy303 medium37 hard

Showing 451–475 of 475 results

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

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

    Auto-gradedarray-traversalboolean-flagsearly-termination
  • Tests ability to use difference arrays to efficiently apply multiple range-update operations and decode the final state.

    Auto-gradedarraysdifference arrayprefix sumshashing
  • Apply the capture-recapture estimator to infer total population size from overlapping detection counts.

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

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

    Model answergeometryhash-mapbinary-searchsorting
  • Apply the Law of Total Probability and Bayes' Theorem to compute ride request likelihoods and conditional weather probabilities.

    Auto-gradedprobabilitybayes-theoremconditional-probability
  • Tests efficient computation of two simple aggregate statistics using optimal data structures and complexity analysis.

    Auto-gradedhash-mapscountingcomplexity-analysis
  • Tests ability to check constraint satisfaction across multiple overlapping groups using efficient duplicate detection.

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

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

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

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

    Auto-gradedprobabilitysampling-biasweighted-estimation
  • 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.

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

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

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

    Auto-gradedarrays & hashinghash countingstrings
  • 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.

    Auto-gradedarrays & hashinghash countingstrings
  • Tests the ability to apply a sliding window to find the longest contiguous subarray whose element sum does not exceed a given limit.

    Auto-gradedarrayssliding windowprefix sums
  • 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.

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

    Auto-gradedarrayshash mapstwo pointersin-place partitioning
  • 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.

    Auto-gradedarraystwo pointersin-place partitioning
  • Tests the classic sliding window pattern for finding the longest contiguous subarray containing at most K distinct values.

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

    Auto-gradedarraysdifference arrayprefix sumshashing
  • Tests ability to use prefix sums to efficiently answer multiple range-sum queries on a fixed array.

    Auto-gradedarraysprefix sumshashing

More topics