practice a little every day — you've got this ♡
Arrays & Hashing Interview Problems
Practice 5976 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.
- 5976
- Problems
- 2213
- Auto-graded
- 15
- Topics
- 271
- Added today
Showing 151–180 of 437 results
- Arrays & HashingMediumAuto-gradedFit 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-gradedStatic 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-gradedSurvey 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-gradedCan 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 & HashingEasyAuto-gradedSimulate Slice Appending in Go
Simulate how slicing and slice appending mutate backing arrays and slice headers in Go.
Arrays & Hashingarrayssimulation - Arrays & HashingEasyAuto-gradedTarget 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-gradedBayesian 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-gradedOverlap 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-gradedMost 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-gradedCalculate 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-gradedFind 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-gradedReverse 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-gradedRunners 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-gradedPush 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-gradedFour-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-gradedSoftmax-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-gradedFind 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-gradedMerge 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-gradedWidest 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 - Arrays & HashingHardAuto-gradedReachable Smallest Missing Values After a Single Increment
Find every possible smallest-missing value of an array after at most one capped +1 edit, using counting and MEX case analysis in linear time.
Arrays & Hashingmexcountingcase-analysisfrequency-array - Arrays & HashingMediumAuto-gradedCheck a Partially Filled Number Grid for Rule Violations
Scan a 9x9 digit grid once and decide whether any row, column, or 3x3 block repeats a digit, using per-group bitmasks or sets.
Arrays & Hashinghashingbitmaskmatrixsimulation - Arrays & HashingMediumAuto-gradedMaximum Score Level Backed by Enough Servers
Find the largest k such that at least k scores are k or higher, using counting with capped values to reach linear time.
Arrays & Hashingcountingh-indexbucketarrays - Arrays & HashingMediumAuto-gradedConfirmed Connections from Invites and Replies
Match reply events to earlier directed invites, normalize each user pair, and keep the earliest valid reply date per pair, sorted by pair.
Arrays & Hashinghash-mapgroupingdeduplicationdates - Arrays & HashingMediumAuto-gradedMost Common Item Pair Across Shopping Baskets
Find the two products that appear together in the most orders, handling duplicate lines, mirrored pairs, ties, and orders with fewer than two distinct products.
Arrays & Hashinghash-mapcombinationscountinggrouping - Arrays & HashingMediumAuto-gradedPrice Card Payments with Tiered Rates and Running Merchant Totals
Parse comma-separated payment rows, build a per-row rate from several rules plus a per-merchant running total, and round fees exactly to whole cents.
Arrays & Hashinghash-mapparsingsimulationrounding - Arrays & HashingMediumAuto-gradedFind Accounts With Five Distinct Contacts in a Week
Sliding-window distinct counting per group: find callers who reach at least five different receivers within any 7-day span of their call log.
Arrays & Hashingsliding-windowhash-mapgroupingtimestamps - Arrays & HashingMediumAuto-gradedAudit Purchase Events Against a Payment Ledger
Aggregate daily purchase metrics from event logs and reconcile two event snapshots against a ledger to judge whether a tracking fix worked, using hash-map grouping.
Arrays & Hashinghashingaggregationreconciliationdictionaries - Arrays & HashingEasyAuto-gradedMost Frequently Booked Vehicle
Count how many booking records each vehicle has and return the ID with the highest count, breaking ties by the smallest ID.
Arrays & Hashinghash-mapcountingtie-breaking - Arrays & HashingMediumAuto-gradedInner Product of Two Index-Value Lists
Compute the inner product of two sparse vectors given as sorted index-value pairs by intersecting their indices with a linear merge, without building dense arrays.
Arrays & Hashingtwo-pointerssparse-vectorsorted-mergesimulation - Arrays & HashingEasyAuto-gradedScore a Top-k Search Result Against Labeled Files
Clean a noisy ranked result list (missing, duplicated, unknown, or oversized) and compute precision and recall against ground-truth labels.
Arrays & Hashinghashingsetsmetricsinput-validation