Topic
Arrays & Hashing interview problems
Two pointers, prefix sums, hash maps and sliding windows. 476 original problems, each with hidden test cases you can run in the browser.
136 easy303 medium37 hard
Showing 151–180 of 476 results
Compute the modular product of all elements in an array except the current element for each index without division.
Auto-gradedarraysprefix-summathProcess interleaved time-ordered scanner events to compute cumulative segment-based charges across all entities.
Auto-gradedhash-maparraysimulationFind the top average speed over any time window covering exactly a target distance, given piecewise-constant speeds. Tests prefix sums, interpolation and binary search.
Auto-gradedprefix-sumsbinary-searchinterpolationtwo-pointersSimulate 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.
Auto-gradedsimulation2d-gridclippingstringsBuild an N by M grid in which each crop forms one edge-connected region, using a snake-order fill with a fixed, deterministic output.
Auto-gradedgridconstructionsimulationserpentineDivide an array into K non-empty contiguous slices such that every valid partition is equally likely to be selected.
Model answerarraysmath-bitsheaps-sortingFilter log entries within a half-open time interval, compute occurrence frequencies, and retrieve the top k error codes sorted by frequency and string order.
Auto-gradedArrays & HashingSortingHash TableValidate 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.
Auto-gradedsimulationvalidationmatrix-transformfilteringFetch paginated JSON payloads from two separate endpoints, defensively clean and transform records, and merge them on a common key preserving the original sequence.
Model answerpaginationhttp-requestshash-tabledata-cleaningCompute the minimum sample size required per group for a two-sample z-test given standard deviation, MDE, power, and significance level.
Auto-gradedstatisticsa-b-testinghypothesis-testingmathImplement 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.
Auto-gradedgradient-descentlinear-regressionnumericalsimulationProcess a sequence of range sum queries on an immutable array efficiently using prefix sums.
Auto-gradedarraysprefix-sumdata-structuresGroup 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.
Auto-gradedhash-mapgroupingsortingnull-handlingDecide 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.
Auto-gradedsimulationbrute-forcecombinationspokerExplain the major Java 8 language and library additions, when each one fits, and the common pitfalls, using short code examples.
Model answerjavajava-8lambdasstreamsSimulate how slicing and slice appending mutate backing arrays and slice headers in Go.
Auto-gradedarrayssimulationCompute the mean negative log-likelihood across target tokens and convert it into perplexity for a given logarithm base.
Auto-gradedmachine-learningmathnlpCalculate the posterior probability that two black items came from a specific facility using Bayes' Theorem.
Auto-gradedstatisticsprobabilitybayes-theoremCompute 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.
Auto-gradedhash-setsetsstringsedge-casesGroup 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.
Auto-gradedhashingsortingcombinationscountingEvaluate expected values for geometric process waiting times and pattern completion using Markov chain state transitions.
Auto-gradedprobabilityexpected-valuemarkov-chainscombinatoricsFind the minimum element and the most frequent element (mode) in an unsorted list of integers.
Auto-gradedarrayshash-tablefrequency-countingReverse the subsegment of an array from the first occurrence of a target value up to its second occurrence.
Auto-gradedarraystwo-pointersslicingSimulate 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.
Auto-gradedsimulationhash-mapcountingparityRearrange 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.
Auto-gradedarraystwo-pointersin-placeFind 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.
Auto-gradedhash-mapmeet-in-the-middlek-sumindicesImplement scaled dot-product attention on nested lists using a numerically stable softmax and a weighted average of value rows.
Auto-gradedmatrixsoftmaxnumerical-stabilityattentionTests frequency counting with a hash map and a deterministic numeric tie-break, returning the value itself without altering the input list.
Auto-gradedhash-mapcountingtie-breakingGroup consecutive identical-state readings into runs, then keep only runs whose last-minus-first timestamp span meets a minimum threshold.
Auto-gradedrun-lengthsingle-passsimulationgroupingFind 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.
Auto-gradedprefix-sumhash-mapsubarray