practice a little every day — you've got this ♡
Interview Practice Problems
Practice 6021 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.
- 6021
- Problems
- 2229
- Auto-graded
- 15
- Topics
- 272
- Added today
Showing 931–960 of 6021 results
- 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 - Stacks & QueuesMediumAuto-gradedEvaluate a Spaced Arithmetic String Without Parentheses
Evaluate an integer expression with +, -, *, / using standard precedence and truncating division, in a single pass over a string with arbitrary spacing.
Stacks & Queuesparsingstringstackoperator-precedence - 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 - Data Structure DesignMediumAuto-gradedExpiring Compute Credits: Earliest-Expiry-First Ledger Simulation
Simulate a credit ledger replaying a command list, spending the soonest-expiring grants first, with all-or-nothing spends and time-based expiry.
Data Structure Designheapsimulationgreedydesign - 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 - Data Structure DesignMediumAuto-gradedLinked Cell Grid with Cycle-Safe Formula Updates
Simulate a 26x26 grid whose cells hold integers or one-reference offset formulas, answering lookups lazily and rejecting any formula assignment that would close a dependency loop.
Data Structure Designgraphcycle-detectionsimulationhash-map - Trees & GraphsMediumAuto-gradedEarliest Safe Starting Cell in a Jump Array
Find the smallest start index in a jump array whose walk never goes below index 0, handling cycles and right exits, ideally in linear time.
Trees & Graphsfunctional-graphcycle-detectionmemoizationarrays - Arrays & HashingEasyAuto-gradedCollapse Round-Trip Routes into Distinct City Pairs
Normalize directed city pairs into unordered ones, remove duplicates, and return them in sorted order, testing canonicalization with hashing and sorting.
Arrays & Hashinghashingsortingdeduplicationcanonical-form - SQL & DataMediumAuto-gradedTop Three Categories by Average October Sale Value
Filter records to one month, group by key, apply a minimum-count threshold, compute a rounded average, and return the top three groups, mirroring a SQL WHERE/GROUP BY/HAVING/ORDER BY/LIMIT pipeline.
SQL & Dataaggregationhash-mapgroup-bysorting - 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 - Trees & GraphsMediumAuto-gradedRoute Between Two Nodes of an Implicit Recursive Tree
Find the unique path between two pre-order-indexed nodes in a huge recursively defined tree, using subtree sizes to navigate without building it.
Trees & Graphstreelcarecursionpre-order - 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 - Arrays & HashingMediumAuto-gradedBusiest Network Addresses With Tie-Inclusive Top Ten Cutoff
Normalize IPv4/IPv6 strings, skip invalid ones, count occurrences, and return the top ten addresses while keeping every address tied at the tenth-place frequency.
Arrays & Hashinghash-mapcountingsortingstring-parsing - Machine LearningHardModel answerBuilding a Permission-Aware Document Q&A Assistant with Citations
Design a retrieval-augmented question-answering assistant over internal company documents, with ML detail on each stage, document-level access control, grounded cited answers and failure handling.
Machine Learningragretrievalrerankingllm-fine-tuning - Statistics & ExperimentsMediumModel answerDiagnosing a Quarterly Decline in Driver Satisfaction Scores
A ride-hailing platform's driver satisfaction index fell 10% quarter over quarter. Diagnose the cause, then design and evaluate an intervention in a two-sided marketplace.
Statistics & Experimentsroot-cause-analysisexperiment-designmetric-decompositionmarketplace - Statistics & ExperimentsMediumModel answerChoosing a Count Model for Contacts per Caller and Checking Fit
Pick a probability model for how many distinct people each caller contacts in a period, estimate it, and show with tests and diagnostics that it describes the data well enough for capacity planning.
Statistics & Experimentscount-datapoissonnegative-binomialoverdispersion - Trees & GraphsMediumAuto-gradedStrongest Signal Route in a Lossy Link Network
Find the route between two nodes in an undirected graph that maximizes the product of per-link delivery probabilities, using a Dijkstra-style search with a max-priority queue.
Trees & Graphsgraphdijkstraheapshortest-path - Machine LearningMediumModel answerPreprocessing a Mixed Tabular Dataset Across Model Families
Design leak-safe preprocessing for zero-heavy counts, skewed money, a binary flag and two collinear measurements, and compare choices for linear, tree and k-NN models.
Machine Learningfeature-engineeringscalingmulticollinearitymissing-data - System DesignMediumModel answerBuild a Reliable Private Messaging Backend for Two-Person Chats
Design a backend for private two-person chats that stores messages durably, keeps them in order, tolerates retries, replays to offline devices, and restricts access to participants.
System Designsystem-designmessagingwebsocketidempotency - Statistics & ExperimentsMediumModel answerDesigning Metrics and A/B Tests for Harmful Feed Content
Define a severity-aware metric for harmful content exposure, then design a randomized experiment to test a feed intervention despite rare outcomes, costly labels, and adversaries.
Statistics & Experimentsab-testingmetricstrust-and-safetysampling - System DesignMediumModel answerPaging Through a Huge Ledger Without Gaps or Slowdowns
Design a paginated transaction-history API over a PostgreSQL table with billions of rows, staying fast on deep pages and correct while new rows keep arriving.
System Designpaginationkeyset-paginationpostgresqlindexing - System DesignHardModel answerDesign an In-Memory Auto-Complete Service and Scale It Self-Contained
Design an autocompletion engine using a custom in-memory trie, cover node memory optimizations and hot swaps, and scale out horizontally without adding third-party clusters.
System Designsystem-designtriecachingscaling - BehavioralEasyModel answerData Science Internship Screen: Four Behavioral Prompts
Prepare structured, specific answers to four behavioral prompts for a data science internship screen, covering introduction, a project deep dive, a hard project, and fast learning.
Behavioralbehavioraldata-scienceinternshipproject-deep-dive - Statistics & ExperimentsMediumModel answerQuantifying Business Value from ETA Reduction in Ride-Hailing
Evaluate the business impact of a 10% lower pickup ETA using robust experimental design, interference-aware causal methods, and an NPV framework accounting for cross-tier cannibalization.
Statistics & ExperimentsA/B TestingExperiment DesignCausal InferenceMarketplace Economics - Statistics & ExperimentsHardModel answerSynthetic Control for a Single-Unit Rollout: Validity and Inference
Defend synthetic control as a causal design for one treated unit, covering its assumptions, predictor selection, regularization, permutation-based inference, and fallback options.
Statistics & Experimentssynthetic-controlcausal-inferenceplacebo-testspanel-data