KatInterview

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

Interview Practice Problems

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

6058
Problems
2243
Auto-graded
15
Topics
272
Added today

Showing 4441–4470 of 6058 results

  • Linked ListsMediumAuto-graded
    Detect Functional-Graph Cycle Start on an Index Array

    Tests cycle detection (Floyd's or similar) on an implicit linked list encoded as a next-pointer array, requiring the candidate to find where the cycle begins.

    Linked Listslinked listscycle detectiontwo pointersFloyd's algorithm
  • System DesignMediumModel answer
    Design a Durable Multi-Threaded Append-Only Log Writer

    Design a thread-safe writer that lets thousands of threads durably append sub-1KB opaque records to one local file, with crash-safe framing and safe error handling.

    System Designconcurrencydurabilityfile-iobatching
  • BehavioralMediumModel answer
    Career Narrative, Ownership, Ambiguity, and Engineering Trade-offs

    Four behavioral prompts covering your motivation to change roles, a project you owned, handling unclear requirements, and a real engineering trade-off.

    Behavioralbehavioralleadershipsystem-designengineering-judgment
  • Machine LearningMediumModel answer
    Add Positional Encoding to a Transformer Language Model

    Implement sinusoidal or learned positional encodings in PyTorch, explain the math and tensor shapes, integrate them into a Transformer LM, and diagnose what breaks without them.

    Machine Learningtransformerspositional-encodingpytorchlanguage-models
  • Data Structure DesignHardModel answer
    Ride-Share Wallet: Credit Vouchers, Zone Surcharges, and Refunds

    Simulate a ride-share payment ledger that drains expiring vouchers in priority order, applies zone-based surcharges to card charges, and splits refunds between card and new store credit.

    Data Structure Designsimulationpriority-queueinteger-mathstate-machine
  • Trees & GraphsMediumAuto-graded
    Answer Reachability Queries on an Undirected Graph

    Build connected components from an edge list with Union-Find, then answer many connectivity queries quickly.

    Trees & Graphsunion-findgraphdisjoint-setconnectivity
  • Machine LearningHardModel answer
    Model Optimization and Distributed Training Parallelism Strategies

    Explain key techniques for reducing training and inference cost, then compare how tensor parallelism and pipeline parallelism split work across GPUs.

    Machine Learningdeep-learningdistributed-traininginference-optimizationLLMs
  • Trees & GraphsMediumAuto-graded
    Best Meeting Point Across All Stations in a City Grid

    Tests multi-source BFS on a grid to find the open cell with the smallest total shortest-path distance to every station, respecting walls and blocked cells.

    Trees & Graphsbfsgridshortest-path
  • BehavioralMediumModel answer
    Turning Uncomfortable Feedback Into a Measurable Change

    Walk through a time you received feedback you initially pushed back on, how you investigated it objectively, and what concrete habit you built from it.

    Behavioralgrowth mindsetself-awarenessfeedbackSTAR method
  • Data Structure DesignMediumAuto-graded
    Mini Spreadsheet: Cell Formulas and Cycle Detection

    Tests dependency graph modeling, cycle detection on writes, and correct value propagation across a simple formula-based spreadsheet engine.

    Data Structure Designgraphsdfsdesign
  • Statistics & ExperimentsHardModel answer
    End-to-End A/B Test Design for a Credit Card Launch

    Design a rigorous A/B test for a new credit card offer, covering randomization, metrics, sample size, bias, interference, and regulatory constraints.

    Statistics & Experimentsexperimentationcausal-inferencepower-analysisfinancial-products
  • System DesignMediumModel answer
    Unified Login Across Independently Hosted Domains Using OIDC

    Design a shared identity layer that lets users sign in once and move freely between two separate domains, then scale the same pattern to many sites and delegated API access.

    System Designauthenticationoauthoidcsso
  • Heaps, Sorting & SearchMediumAuto-graded
    Collapse Repeat Visits and Order the Result

    Tests array manipulation, hash-based deduplication, and implementing an O(n log n) sort from scratch without relying on built-in sort utilities.

    Heaps, Sorting & Searcharrayssortinghashingheapsort
  • System DesignHardModel answer
    Configurable N×N Tic-Tac-Toe in React with O(N) Win Detection

    Build a two-player, grid-size-configurable Tic-Tac-Toe React component with efficient win detection, prop reactivity, and full keyboard/screen-reader accessibility.

    System Designreacttypescriptaccessibilitystate-management
  • Dynamic ProgrammingMediumAuto-graded
    Find Maximum Strictly Ascending Subsequence Length

    Tests dynamic programming optimization using binary search to efficiently compute the longest strictly increasing subsequence in O(n log n) time.

    Dynamic Programmingbinary-searchsubsequencesgreedy
  • BehavioralMediumModel answer
    Secure Password Verification in Express Without Blocking

    Fix a Node.js authentication endpoint: validate input, compare passwords asynchronously, return safe errors, and prevent event-loop blocking.

    Behavioralnode.jsexpresssecurityasync
  • Dynamic ProgrammingMediumAuto-graded
    Ways to Decode a Numeric String into Letters

    Tests dynamic programming reasoning on sequential digit-to-letter mappings, including careful handling of zeros and invalid two-digit pairs.

    Dynamic Programmingdynamic-programmingstringsrecursion
  • Trees & GraphsMediumAuto-graded
    Longest Path in an Undirected Tree

    Tests whether a candidate can find the longest edge-path in a tree using two linear-time traversals and reason about why the approach is correct.

    Trees & Graphsbfstreesgraph-traversal
  • System DesignMediumModel answer
    Single-Elevator Control Policy for a Four-Stop Building

    Design the scheduling logic for one elevator serving a basement plus three floors, covering objectives, state, dispatch strategy, data structures, and simulation.

    System Designelevatorschedulingstate-machinesimulation
  • Statistics & ExperimentsMediumModel answer
    Design an Experiment for Interest-Based Friend Recommendations

    Design a randomized experiment to measure whether recommending connections based on predicted interest improves discovery and retention.

    Statistics & Experimentsexperimentationcausal-inferenceproduct-metricsa-b-testing
  • System DesignHardModel answer
    Shared Account Balance API: Preventing Double-Spend at Scale

    Design an API for a shared payment account that keeps the balance consistent when multiple users submit payments simultaneously, at high throughput.

    System Designconcurrencypaymentsdistributed-systemsidempotency
  • BehavioralEasyModel answer
    Adapt to teammates and give feedback that sticks

    Demonstrate collaboration, style flexibility, constructive feedback, and documentation ownership through concrete stories from your past work.

    Behavioralcollaborationfeedbackdocumentationinclusion
  • System DesignMediumModel answer
    Build a Fault-Tolerant Payment Execution Engine

    Implement a payout processor that guarantees exactly-once delivery against an unreliable ledger by persisting state and resolving ambiguous responses before retrying.

    System Designidempotencyfault-tolerancedistributed-systemsstate-machines
  • StringsMediumAuto-graded
    Longest Window of Unique Characters

    Tests whether a candidate can apply a sliding window with a character index map to find the longest contiguous run of non-repeating characters.

    Stringssliding-windowhash-maptwo-pointers
  • System DesignHardModel answer
    Build an in-memory rate limiter using token buckets

    Design a fast, memory-efficient rate limiter for an API that tracks per-client quotas using a token-bucket algorithm with lazy refill.

    System Designrate-limitingscalabilityalgorithmsconcurrency
  • Statistics & ExperimentsMediumModel answer
    Measuring Treatment Effect from Experiment and Event Data

    Define a user-level outcome from experiment assignment and event logs, then estimate the average treatment effect with a confidence interval.

    Statistics & Experimentsexperimentationcausal-inferenceconfidence-intervals
  • StringsMediumAuto-graded
    Total Palindrome Substring Count

    Tests the ability to efficiently enumerate all palindromic substrings using center expansion and handle both odd and even-length cases.

    Stringspalindromestwo-pointersstring-manipulation
  • StringsMediumAuto-graded
    Reconcile Payments with Invoices Using Memo and Amount

    Tests multi-pattern substring search, hash-based indexing, and greedy reconciliation with priority-based tie-breaking across two matching strategies.

    Stringsstring-matchinghash-mapgreedyaho-corasick
  • Machine LearningMediumModel answer
    Validating a Probability of Default Model End to End

    Walk through every stage of PD model validation — data checks, discrimination, calibration, stability, and backtesting — explaining the key metrics and their limitations.

    Machine Learningcredit-riskmodel-validationclassification
  • System DesignMediumModel answer
    Build a Reference-Counted Smart Pointer in C++

    Design a shared-ownership pointer class: explain the control block, copy/move semantics, destruction invariants, and the boundaries of reference counting.

    System Designc++memory-managementsmart-pointersownership