KatInterview

practice a little every day — you've got this ♡

Interview Practice Problems

Practice 6126 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.

6126
Problems
2272
Auto-graded
15
Topics
274
Added today

Showing 3211–3240 of 6126 results

  • Trees & GraphsMediumAuto-graded
    Grid Contagion with Neighbor-Count Thresholds

    Compute when each grid cell becomes infected under a synchronous neighbor-count rule, using a multi-source BFS that updates counts incrementally instead of rescanning each round.

    Trees & Graphsbfsgridsimulationmulti-source-bfs
  • Machine LearningHardModel answer
    Targeting Discounts with Causal ML on Logged Data

    Design a causal ML pipeline that learns who should receive a standing promotion from observational logs, covering estimators, overlap, off-policy evaluation, fairness and a safe rollout.

    Machine Learningcausal-inferenceuplift-modelingoff-policy-evaluationdoubly-robust
  • Machine LearningHardModel answer
    Fix a Broken From-Scratch Extra-Trees Forest in NumPy

    Debug a NumPy random-split decision-tree ensemble that crashes on constant columns and returns wrong shapes, until it matches scikit-learn's accuracy.

    Machine Learningdebuggingextra-treesrandom-forestnumpy
  • Data Structure DesignMediumModel answer
    In-Memory Ledger with Ranking by Total Money Sent

    Build an in-memory ledger supporting account creation, deposits and transfers, plus a query returning the top n senders by cumulative outgoing amount with deterministic tie-breaking.

    Data Structure Designdata-structure-designhash-mapheaptop-k
  • System DesignHardModel answer
    Per-User Credit Ledger Ordered by Vector-Clock Expiry

    Design a service that adds expiring credits and spends them earliest-expiry-first, where expiry and spend times are vector clocks that are only partially ordered.

    System Designvector-clocksidempotencyconcurrency-controlordered-set
  • BehavioralMediumModel answer
    Resolving a Clash Between Two Colleagues: Method and Story

    Explain how you handle a situation where two people hold opposing views, and ground your method in a specific episode from your own work, including the outcome and lessons.

    Behavioralbehavioralconflict-resolutioncommunicationcollaboration
  • SQL & DataMediumAuto-graded
    Coupon Campaign Conversion and 48-Hour Spend Report

    Build a per-user cohort from coupon events, then join transactions by time window to compute cohort size, converters, and spend within 48 hours.

    SQL & Datajoinshash-mapdatetimeaggregation
  • Heaps, Sorting & SearchMediumAuto-graded
    Expiring Compute Credits: Offline Ledger Replay

    Replay a shuffled log of credit grants, spends and balance queries in time order, spending the soonest-expiring credits first, using a heap and sorting.

    Heaps, Sorting & Searchheapsortingsimulationoffline-processing
  • Trees & GraphsMediumAuto-graded
    Leftmost and Rightmost Nodes per Depth from a Serialized Tree

    Given a level-order serialized binary tree, return the first and last node value at each depth, testing BFS over an array-encoded tree and careful handling of null slots.

    Trees & Graphsbinary-treebfslevel-orderserialization
  • Machine LearningMediumModel answer
    Choosing Between a Linear Classifier and a Forest on Small Data

    Discuss when a regularized linear probabilistic classifier beats a bagged tree ensemble on a small binary task, and how it compares with boosting.

    Machine Learninglogistic-regressionrandom-forestregularizationoverfitting
  • Heaps, Sorting & SearchMediumAuto-graded
    Median Tracker for an Incoming Number Feed

    Maintain the median of a growing sequence after each new value arrives, testing efficient order-statistic upkeep with a pair of heaps.

    Heaps, Sorting & Searchheaptwo-heapsstreamingmedian
  • Trees & GraphsMediumAuto-graded
    Longest Path Between Any Two Nodes in an Indexed Binary Tree

    Find the longest path, counted in edges, between any two nodes of a binary tree stored as a child-index list, testing tree height computation and avoiding deep recursion.

    Trees & Graphsbinary-treedfsbfstree-height
  • BehavioralEasyModel answer
    Six Behavioral Prompts for a Banking Tech Internship Screen

    Draft concise, structured answers to six common behavioral prompts for a finance-technology internship: motivation, commitments, teamwork, decisions, initiative, and staying current.

    BehavioralbehavioralSTAR methodinternshipmotivation
  • SQL & DataMediumAuto-graded
    Tally Faulty and Clean Submissions per Company

    Aggregate two conditional counts per group from two related row lists, keeping groups with no matching rows and handling both boolean and string status values.

    SQL & Dataconditional-aggregationleft-joinhash-mapgroup-by
  • Greedy & IntervalsMediumAuto-graded
    Pick One Day Per Workshop Within Its Availability Window

    Choose a distinct day for as many workshops as possible, each within its own window, using an earliest-deadline-first greedy with a min-heap.

    Greedy & Intervalsgreedyheapintervalssorting
  • Linked ListsMediumAuto-graded
    Clone a Linked Chain with Arbitrary Jump Links

    Build a singly linked list with extra jump pointers from index arrays, deep-copy it without sharing nodes, and report the copy's structure by index.

    Linked Listslinked-listhash-mapdeep-copypointers
  • StringsMediumModel answer
    Repair a Rewards Calculator: Three Red Tests in a Java Service

    Diagnose and fix three failing JUnit tests in a Java rewards service by touching at most three files, then explain how to keep similar bugs from coming back.

    Stringsjavadebuggingunit-testingjunit
  • SQL & DataEasyAuto-graded
    Sessionize Clickstream Events with a 30-Minute Inactivity Gap

    Deduplicate retried events, split each user's activity into sessions on gaps over 30 minutes, and summarize each session with its start, end and distinct page count.

    SQL & Datasessionizationwindow-functionsdeduplicationgaps-and-islands
  • Arrays & HashingMediumAuto-graded
    Reconcile Payments Against Open Invoices in Three Tiers

    Process payments in order, pairing each with an invoice by ID plus amount, then by unique amount, then by closest amount within a percentage tolerance.

    Arrays & Hashinghash-mapsimulationmatchingfloating-point
  • BehavioralMediumModel answer
    Walk Through a Component You Designed and Are Proud Of

    Present one piece of code you built, covering its API, protected invariants, test strategy, and why it beat the obvious approach, with depth beyond a simple project recap.

    Behavioralbehavioralapi-designinvariantstesting
  • Arrays & HashingEasyAuto-graded
    Sliding Marble on a Tiltable Grid with Scheduled Tilts

    Simulate a marble on a grid whose tilt changes at scheduled times, and find its final cell efficiently when the end time can reach a billion seconds.

    Arrays & Hashingsimulationgridtime-segmentstwo-pointers
  • Machine LearningHardModel answer
    Defending Your ML Project and Explaining Diffusion Model Design

    Present one of your own ML research projects so it survives repeated probing on model choices and coding practice, then explain how diffusion models are trained, built, conditioned and sampled.

    Machine Learningdiffusion-modelsresearch-communicationgenerative-modelsddpm
  • Arrays & HashingMediumAuto-graded
    Best Single Round-Trip Gain Across Tickers in an Unordered Log

    Find the largest gain from buying and later selling the same ticker on a strictly later date, given an unsorted log with duplicate dates; tests grouping, sorting and careful running-minimum updates.

    Arrays & Hashinghash-mapsortinggreedytime-series
  • Arrays & HashingEasyAuto-graded
    Count Repeated Strings in a Large List

    Tests hash-map frequency counting: find every string occurring more than once in a list and report its count, using exact comparison.

    Arrays & Hashinghash-mapcountingstringsfrequency
  • Trees & GraphsMediumAuto-graded
    Rebuild a Search Tree from Its Preorder Listing

    Rebuild a binary search tree from its preorder listing of distinct integers in linear time, then report it in level order with null placeholders. Tests stack-based construction and BFS serialization.

    Trees & Graphsbinary-search-treestackpreorderbfs
  • Statistics & ExperimentsMediumModel answer
    Early Attrition Metrics and a Guided Onboarding A/B Test

    Critique a "no first payroll in 30 days" churn definition for a B2B payroll product, handle late returners, and design a business-level A/B test for a new guided onboarding flow.

    Statistics & Experimentsab-testingchurnmetric-designsurvival-analysis
  • Stacks & QueuesMediumModel answer
    Predicting Output Order with the Browser Event Loop

    Work out the print order of a short script mixing timers, promises and microtasks, then explain how the browser event loop schedules each kind of task.

    Stacks & Queuesjavascriptevent-loopasyncmicrotasks
  • Data Structure DesignHardModel answer
    Crash-Safe Job Dispatcher with Lease Timeouts and Dependency Graphs

    Build an in-memory job dispatcher where workers hold timed leases, stale workers are fenced off, jobs form a dependency DAG, and you justify the delivery guarantees.

    Data Structure Designleasesfencing-tokensdagtopological-sort
  • System DesignMediumModel answer
    Durable, Ordered Messaging Backend for 1:1 and Group Chat

    Design a messaging backend where an acknowledged message is never lost, each conversation has a deterministic order, and reconnecting clients catch up without gaps or duplicates.

    System Designmessagingdurabilityorderingfan-out
  • Statistics & ExperimentsMediumModel answer
    Estimating Sign-up Lift from a Two-City Outdoor Ad Launch

    Design a causal study to measure how much a 30-day outdoor ad push in two metros raised new registrations, covering control selection, confounders, spillover, and validation of a 5% lift.

    Statistics & Experimentscausal-inferencesynthetic-controldifference-in-differencesgeo-experiment