KatInterview

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

Interview Practice Problems

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

6057
Problems
2242
Auto-graded
15
Topics
273
Added today

Showing 1501–1530 of 6057 results

  • Data Structure DesignMediumAuto-graded
    Closest Pair Gaps Between Words in a Fixed List

    Answer many closest-index-distance queries over a fixed word list by building a position index, precomputing same-word gaps, and binary searching the smaller list.

    Data Structure Designinverted-indexbinary-searchpreprocessinghash-map
  • System DesignHardModel answer
    Build a Fault-Tolerant Money Transfer Ledger at Scale

    Design a distributed ledger for account-to-account transfers that stays strictly consistent, avoids overdrafts and duplicate charges, and survives crashes at any point.

    System Designsystem-designledgeracididempotency
  • Stacks & QueuesMediumModel answer
    Simulated Stock Trading Signals and Two-Char String Reduction

    Solve two streaming state problems: daily stock trading based on sign patterns in O(N) time and two-character substring elimination using an in-place stack.

    Stacks & Queuesstacks-queuesarraysstringsmath-bits
  • BehavioralMediumModel answer
    Navigating Critical Feedback and Delivering Beyond Baseline Requirements

    Learn how to present two behavioral narratives detailing how you constructively resolved negative feedback and how you safely exceeded project requirements with measurable impact.

    Behavioralbehavioralstar-frameworkleadership-principlescommunication
  • Linked ListsMediumAuto-graded
    Flip Every Complete Block of K in a Sequence

    Reverse each full consecutive block of k items in a list, leaving a shorter leftover tail unchanged; tests pointer-style reversal logic and boundary handling.

    Linked Listslinked-listin-place-reversaltwo-pointerssimulation
  • Heaps, Sorting & SearchMediumAuto-graded
    Top K Highest Scores in Descending Order

    Select the k greatest values from an unsorted integer list, duplicates included, returned from largest to smallest, ideally in O(n log k) time using a bounded min-heap.

    Heaps, Sorting & Searchheaptop-ksortingarrays
  • Greedy & IntervalsMediumAuto-graded
    Fewest Brackets to Add for a Balanced String

    Count the fewest parenthesis insertions needed to make a string of brackets balanced, using a single left-to-right pass with a running counter.

    Greedy & Intervalsgreedystringsparenthesescounter
  • Trees & GraphsMediumAuto-graded
    Find Minimum Network Distance Between Users

    Compute the shortest path distance between two nodes in an unweighted undirected graph using Breadth-First Search.

    Trees & Graphsbfsgraphshortest-pathbreadth-first-search
  • BehavioralMediumModel answer
    Mastering the Engineering Manager Behavioral & Technical Leadership Screen

    A framework for answering technical leadership prompts covering mission alignment, org structures, AI developer tooling, and measurable team impact.

    Behavioralengineering-managementleadershipai-assisted-developmentbehavioral-interview
  • Statistics & ExperimentsMediumModel answer
    Diagnosing Slow, Costly Support Complaints from Three Tables

    Use complaint, resolution and rating tables to find insights, propose and prioritize fixes, design a rollout test, and discuss bias and confounding.

    Statistics & Experimentsexperimentationcausal-inferencemetricscustomer-support
  • StringsEasyModel answer
    Round Decimal Strings to a Power-of-Ten Step, No Floats

    Round a decimal string to the nearest integer, then to a power-of-ten step such as 100 or 0.1, using only string and digit operations and a clearly stated tie-breaking rule.

    Stringsstringsroundingbig-numberscarry
  • Machine LearningMediumModel answer
    Bias-Variance, Normalization Axes, and Gradient Decay in Deep Nets

    Explain the bias-variance tradeoff, compare batch and layer normalization, and describe why gradients vanish in deep networks and how architecture can prevent it.

    Machine Learningbias-variancebatch-normalizationlayer-normalizationvanishing-gradients
  • Trees & GraphsMediumAuto-graded
    Reconstruct Alphabet Order from Sorted Vocabulary

    Determine character precedence in an unfamiliar alphabet using a sorted list of terms, returning the lexicographically first valid character sequence or an empty string for invalid inputs.

    Trees & Graphstrees-graphsheaps-sortingstrings
  • Dynamic ProgrammingMediumAuto-graded
    Stock Trading With a Per-Sale Commission

    Compute the best total gain from repeatedly buying and selling a single share of a stock when each sale costs a flat commission, using a two-state dynamic program.

    Dynamic Programmingdynamic-programmingstate-machinestocksgreedy
  • Arrays & HashingMediumAuto-graded
    Prefix Value Blocks in a Shuffled Sequence

    Decide, for every k, whether the values 1..k occupy a contiguous block of a permutation, using value positions and a running span instead of scanning subarrays.

    Arrays & Hashingpermutationindex-mappingrunning-min-maxstring-output
  • Data Structure DesignMediumModel answer
    Non-Blocking Concurrent Log Writer with Bounded Buffer

    Build a thread-safe logger whose callers never wait on slow sink I/O, preserving submission order, bounding memory, and flushing every accepted message on shutdown.

    Data Structure Designconcurrencyproducer-consumerbounded-queuebackpressure
  • System DesignHardModel answer
    Multi-Tenant File Vault with Per-User Limits and Compression

    Design a multi-user file storage backend that handles uploads, downloads and copies, enforces per-user space limits, and transparently compresses data, with durability, security and testing covered.

    System Designsystem-designstoragequotascompression
  • System DesignMediumModel answer
    Design a Persistent Local Key-Value Store

    Architect an in-memory key-value cache backed by persistent disk storage, focusing on crash resilience, append-only logging, compaction, and high-volume value optimizations.

    System Designsystem-designcachingstoragedurability
  • Machine LearningMediumModel answer
    Comparing RLHF with Reward Models against Direct Preference Optimization

    Analyze the architecture, loss functions, training complexity, and theoretical connections between traditional PPO-based RLHF and Direct Preference Optimization (DPO).

    Machine LearningLLMsRLHFDPOAlignment
  • BehavioralMediumModel answer
    Walking Through Your Track Record as a Mentor

    Explain how you have guided other engineers: the scale and duration, the goals and results, your working methods, and one difficult mentoring relationship and what came of it.

    Behavioralmentorshipleadershipcoachingstar-method
  • Dynamic ProgrammingMediumAuto-graded
    Rearrangements of 1..m With a Fixed Number of Out-of-Order Pairs

    Count arrangements of 1..m with exactly n out-of-order pairs, modulo 10^9+7, using a DP over insertion positions optimized with a sliding-window sum.

    Dynamic Programmingdynamic-programmingcombinatoricspermutationssliding-window
  • System DesignMediumModel answer
    Design a Multi-Agent AI Chat Platform for Financial Services

    Design a scalable and secure backend system for an LLM-powered multi-agent financial assistant with real-time streaming, conversation persistence, and strict compliance controls.

    System Designsystem-designllm-architecturestreamingdistributed-systems
  • StringsEasyAuto-graded
    Earliest Non-Repeating Character with Optional Case Folding

    Find the position of the earliest character that occurs exactly once in a string, with a flag that switches between case-sensitive and case-insensitive matching.

    Stringsstringshash-mapcountingcase-folding
  • Math & Bit ManipulationEasyAuto-graded
    Calculate Expected Return from Two Six-Sided Dice

    Computes the expected payoff of a game played with two independent six-sided dice, rounded to two decimal places.

    Math & Bit Manipulationmath-bitsprobabilitysimulation
  • Statistics & ExperimentsHardModel answer
    Planning Runtime and Stopping Rules for a Delivery Add-On Test

    Size an A/B test on a 22% conversion metric with household clustering, plan weekly sequential looks, and estimate how variance reduction shortens the run.

    Statistics & Experimentspower-analysissample-sizedesign-effectgroup-sequential
  • StringsMediumAuto-graded
    List Every Well-Formed Bracket Sequence in Dictionary Order

    Enumerate all well-formed bracket sequences using n pairs, returned in dictionary order, testing pruned backtracking and reasoning about output ordering.

    Stringsbacktrackingrecursioncombinatoricsstrings
  • Machine LearningHardModel answer
    Automated Diagnosis Coding Engine for Long Clinical Notes

    Design a service that reads long clinical notes, suggests ICD-10 codes with calibrated confidence and cited evidence, and learns from medical coder corrections over time.

    Machine Learningnlpextreme-multi-labelml-system-designlong-documents
  • BehavioralMediumModel answer
    Recruiter Culture Screen for a Streaming Ads Engineer

    Prepare short, honest, well-structured answers for a 30-minute non-technical recruiter call covering motivation, background, a hard challenge, a core value and feedback.

    Behavioralbehavioralrecruiter-screenstar-methodculture-fit
  • System DesignHardModel answer
    Fault-Tolerant Router for Multiple LLM API Vendors

    Design a client library that spreads LLM calls across several vendors, enforcing limits, isolating failures, and choosing providers by cost and latency while staying thread-safe and observable.

    System Designcircuit-breakerrate-limitingload-balancingretries
  • SQL & DataMediumModel answer
    Gap Between a User's Two Latest Views of the Same Ad

    Write one SQL query returning, per user and ad with at least two views, the newest and second-newest timestamps plus the gap between them in seconds.

    SQL & Datasqlwindow-functionsrow-numbertimestamp-arithmetic