practice a little every day — you've got this ♡
Interview Practice Problems
Practice 5997 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.
- 5997
- Problems
- 2221
- Auto-graded
- 15
- Topics
- 270
- Added today
Showing 511–540 of 3776 results
- Machine LearningHardModel answerDebiasing Click Logs for Ranking: Propensities, IPS, Offline Eval
Design a pipeline that models, estimates and corrects position bias in click-trained feed rankers, then evaluates a new ranker offline using only logged impressions.
Machine Learningposition-biaslearning-to-rankinverse-propensity-scoringcounterfactual-evaluation - Trees & GraphsMediumModel answerSliding Block Minimums and Dependency-Ordered Cooking Plan
Compute the minimum of every K x K window in a grid, then order recipes so that every derived ingredient is made before the dish that uses it, detecting cycles.
Trees & Graphstopological-sortmonotonic-dequesliding-windowkahns-algorithm - Statistics & ExperimentsHardModel answerPlan a Pilot A/B Test for a Paid Messaging Add-On
Design a randomized pilot for 1,200 businesses to measure a paid add-on's effect on revenue and 24-hour resolution, covering power, interference, compliance, monitoring and a decision rule.
Statistics & Experimentsexperiment-designpower-analysisinterferenceinstrumental-variables - StringsMediumModel answerDefine and Implement a Streaming Unicode Word Counter
Specify precise tokenization rules for counting words in text, then build a Unicode-aware counter that works on huge streams, with tests and a regex versus scanner comparison.
Stringstokenizationunicodestreamingstate-machine - System DesignMediumModel answerBuild a Link-Shortening Service That Scales to Billions
Design a service that maps long URLs to compact aliases and redirects visitors quickly, covering APIs, storage, code generation, caching, and sharding.
System Designsystem-designurl-shortenercachingsharding - BehavioralMediumModel answerDiscuss a Highlight Technical Achievement End-to-End
Present a high-impact technical project you led, detailing the problem, your explicit contributions, architectural trade-offs, measurable metrics, and key retrospective takeaways.
Behavioralbehavioralleadershiptechnical-deep-diveproject-ownership - Greedy & IntervalsMediumModel answerTrim Overlapping Ranges to Limit Capacity
Truncate overlapping integer intervals so no point is covered by more than k ranges while minimizing the total removed coverage.
Greedy & Intervalsintervalssweep-lineheapgreedy - System DesignMediumModel answerDesigning and Building an In-Memory RESTful Q&A Service
Architect and implement a minimal Q&A web service with HTTP endpoints for question creation, retrieval, and search, including pagination and data validation.
System Designapi-designsystem-designpythonrest-api - Machine LearningMediumModel answerSupport Chatbot: Combining Doc Retrieval and Order Lookups
Design a shopping-support assistant that answers product questions from a document index and checks order data through safe, typed tools, covering routing, guardrails, sampling and evaluation.
Machine Learningllm-agentsragtool-callingguardrails - Statistics & ExperimentsEasyModel answerPlan, Run and Read Out a Product Experiment From Scratch
Describe how you would take a product change from hypothesis to launch decision using a randomized controlled experiment, covering metrics, power, validity checks, analysis and pitfalls.
Statistics & Experimentsab-testingexperimentationpower-analysissrm - System DesignMediumModel answerHigh-Throughput Alert Delivery Pipeline for Spiky Traffic
Design a multi-channel alert delivery platform that survives spikes of roughly one million writes per second, with a justified storage engine and protection against duplicate sends.
System Designsystem-designmessage-queuecassandraidempotency - Machine LearningMediumModel answerFix a Broken Tiny Transformer and Hand-Derive Matmul Gradients
Debug a small decoder-only transformer whose generation is wrong, add a KV cache, then derive and implement a custom matmul autograd op and discuss parallel scans.
Machine Learningpytorchtransformerkv-cacheautograd - System DesignMediumModel answerDesigning a High-Throughput Financial Ledger Service
Design an accurate, idempotent, and highly concurrent banking ledger database schema and transaction pipeline.
System Designsystem-designdatabase-designconcurrencyfinancial-systems - SQL & DataMediumModel answerFeature Activation, Time-to-First-Purchase, and Region Switching in SQL
Write SQL over users and transactions for regional activation and purchase rates, first-purchase latency with percentiles, and flagging purchases made outside a user's first-purchase region.
SQL & Datasqlwindow-functionspercentilescohort-metrics - Data Structure DesignMediumModel answerBuilding a Multi-Level Credit Ledger with Timed Transfers and Merges
Build an in-memory ledger of credit-holding workspaces in four stages: transfers with a top-k ranking, timed transfers with cancellation, workspace merges, and point-in-time balance lookups.
Data Structure Designclass-designheapbinary-searchsimulation - Data Structure DesignMediumModel answerPrefix-Caching Transform Runner with Single-Flight and LRU
Build a thread-safe runner for chains of deterministic byte transforms that reuses cached prefixes, collapses concurrent duplicate work into one execution, and bounds memory with LRU eviction.
Data Structure Designconcurrencylru-cachehashingsingle-flight - Statistics & ExperimentsMediumModel answerRenew or Sell? Valuing a Streaming Show Against Its Audience
A business case on whether to renew a 2-year deal for two shows, compute their profit, boost one show's economics, and find the break-even price for selling it.
Statistics & Experimentsbusiness-casenpvopportunity-costincrementality - Math & Bit ManipulationMediumModel answerBuild an Endless Fibonacci Stream with Python Generators
Explain how lazy evaluation works in Python and write a generator that yields Fibonacci numbers indefinitely, with safe ways to consume it and the reasoning behind its state handling.
Math & Bit Manipulationpythongeneratorslazy-evaluationfibonacci - Machine LearningMediumModel answerRanking Sponsored Posts in a Feed: Objective, Features, Evaluation
Design a sponsored-post ranking system for a social feed: define the objective, choose features, evaluate offline, and monitor in production under a tight latency limit.
Machine Learningads-rankingcalibrationfeature-engineeringoffline-evaluation - Machine LearningMediumModel answerScoring Property Photos and Predicting Listing Appeal
Design a two-stage ML system that scores listing photos and predicts overall listing appeal to improve ranking and bookings, including targets, features, imbalance, cold start, metrics and fairness.
Machine Learningrankingcomputer-visioncold-startposition-bias - Trees & GraphsMediumModel answerFind a Money-Making Loop in a Table of Exchange Rates
Given directed currency exchange quotes, decide whether some round trip returns more than it started with, and output one such round trip as an ordered list of currencies.
Trees & Graphsgraphbellman-fordnegative-cyclefloating-point - Arrays & HashingMediumModel answerCyclic Shifts and Cell-Level Keyword Lookup in CSV Text
Shift an integer array left or right by k using modular arithmetic, then locate every occurrence of one or more keywords in a simple CSV string, reporting row, column and offset in the cell.
Arrays & Hashingarray-rotationmodular-arithmeticstring-searchcsv-parsing - Data Structure DesignMediumModel answerBuild a Sampler That Picks Items in Proportion to Mutable Weights
Design a structure holding items with positive integer weights that supports insert, delete and a weight-proportional random pick, each in logarithmic time.
Data Structure Designfenwick-treeweighted-samplingrandomizationdata-structure-design - Data Structure DesignMediumModel answerDealing and Ranking Three-Card Hands With an Extensible Rule Set
Build a small card game that deals three cards per player from one deck, ranks hands by category, picks the winner, then extend the ranking with a suit-based category.
Data Structure Designobject-oriented-designsimulationcomparisonextensibility - Machine LearningHardModel answerMaximizing a Fixed Linear SVM Through Better Features and Validation
Raise held-out accuracy of a fixed LinearSVC classifier using preprocessing, feature engineering and leak-free tuning, then justify the improvement credibly without touching the test set.
Machine Learninglinear-svmfeature-engineeringcross-validationdata-leakage - System DesignHardModel answerDesign an In-Memory Music Player and Playlist Engine in Go
Design an in-memory music player engine in Go supporting playlists, deduplication, list merging, playback operations, and safe concurrent access.
System Designsystem designgoconcurrencydata structures - Machine LearningHardModel answerRanking Pipelines for Location Suggestions and Push Alerts
Design two ML ranking systems: one that suggests nearby places to a moving mobile user, and one that decides which push notifications to send, order, or suppress.
Machine Learningml-system-designrecommender-systemsrankingonline-serving - SQL & DataMediumModel answerMonthly Channel Cohorts: Measuring First-Month Account Usage
Write a SQL report of how many new banking users make three or more completed debits totaling at least $50 in their first 30 days, grouped by signup month and channel, excluding immature cohorts.
SQL & Datasqlcohort-analysisleft-joinconditional-aggregation - Data Structure DesignMediumModel answerSearchable Dropdown Input with Live Async Suggestions in React
Implement a React search box whose dropdown fills with suggestions from an abortable async source and works fully by keyboard and mouse, without ever showing outdated results.
Data Structure Designreacthooksasyncaccessibility - Data Structure DesignHardModel answerDynamic Room Occupancy Tracker with Top-K Ranking Query
Design an in-memory system tracking occupancy and entry times across rooms, returning the busiest rooms in optimal logarithmic time per update.
Data Structure Designdesign-dsheaps-sortinghash-map