KatInterview

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

Interview Practice Problems

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

5966
Problems
2209
Auto-graded
15
Topics
271
Added today

Showing 5911–5940 of 5966 results

  • Math & Bit ManipulationHardAuto-graded
    Minimum LCM Spanning Value of a Sequence

    Tests deep understanding of GCD/LCM relationships by finding the smallest integer ≥ 1 that, when inserted into an array, minimises the LCM of the entire resulting sequence.

    Math & Bit Manipulationmathgcd/lcmnumber theory
  • Greedy & IntervalsMediumAuto-graded
    Minimum Penalty Class Schedule with Fixed Breaks

    Tests whether a candidate can apply an exchange-argument greedy to order tasks with deadlines and penalties to minimize total weighted lateness, with fixed unavailable time windows.

    Greedy & Intervalsgreedyintervalsschedulingexchange argument
  • Statistics & ExperimentsEasyModel answer
    Calculate minimum sample size for a checkout button A/B test

    Given a baseline conversion rate and a target minimum detectable effect, compute the required per-variant sample size from first principles.

    Statistics & Experimentsstatisticsa/b testingsample sizehypothesis testing
  • BehavioralMediumModel answer
    Convince a Skeptical Peer Team to Adopt a New Standard

    Describe a time you persuaded colleagues you had no authority over to change how they worked, despite their resistance.

    Behavioralbehavioralinfluencing without authoritycross-functionalstakeholder management
  • Statistics & ExperimentsEasyModel answer
    Interpret a 95% Confidence Interval for Average Order Value

    Given a sample of customer orders and a reported confidence interval, explain what it means and what common misinterpretations to avoid.

    Statistics & Experimentsstatisticsconfidence intervalsinferenceexperimentation
  • Math & Bit ManipulationHardAuto-graded
    Balanced-Radix Digital Root Collision Finder

    Tests mastery of base conversion and number theory by finding all integers in a range whose digital roots are identical across two different bases.

    Math & Bit Manipulationmathbit manipulationbase conversionnumber theory
  • Statistics & ExperimentsEasyModel answer
    Calculate the required sample size for a checkout A/B test

    Derive the minimum per-group sample size for a two-sample proportion test given baseline conversion, MDE, and standard error and power requirements.

    Statistics & Experimentsstatisticsa/b testingsample sizehypothesis testing
  • SQL & DataMediumAuto-graded
    Deduplicate and Canonicalize Customer Records

    Tests ability to clean a list of raw customer record dicts by resolving duplicates, normalizing fields, and returning one canonical record per customer.

    SQL & Datadata cleaningdeduplicationdictionariessorting
  • Math & Bit ManipulationMediumAuto-graded
    Smallest Integer Divisible by All Values in Every Subarray of Length K

    Tests the ability to combine sliding-window enumeration with LCM/GCD reasoning to find the minimum positive integer that is simultaneously divisible by every contiguous subarray LCM.

    Math & Bit Manipulationmathgcd/lcmsliding window
  • Math & Bit ManipulationMediumAuto-graded
    Modular Exponentiation Tower (Tetration mod M)

    Tests mastery of modular arithmetic by computing a power tower (iterated exponentiation) modulo M using Euler's theorem and recursive modular exponentiation.

    Math & Bit Manipulationmathmodular arithmeticnumber theory
  • Stacks & QueuesEasyAuto-graded
    Find the Nearest Taller Building to the Left

    Tests the ability to use a monotonic stack to efficiently find, for each building in a skyline, the index of the nearest building to its left that is strictly taller.

    Stacks & Queuesmonotonic stackarraysstack
  • Data Structure DesignEasyAuto-graded
    Flatten and Iterate a Nested Registry

    Tests the ability to implement a depth-first iterator over arbitrarily nested lists and dicts that yields leaf values in traversal order.

    Data Structure Designdata structuresiterationrecursion
  • Dynamic ProgrammingEasyAuto-graded
    Minimum Cost to Visit All Booths at a Fair

    Tests bitmask DP on small n by finding the minimum total travel cost to visit every booth at a fair, starting and ending at the entrance.

    Dynamic Programmingdynamic programmingbitmask DPgraphs
  • Stacks & QueuesHardAuto-graded
    Maximum Visible Buildings on a Skyline Strip

    Tests ability to use a monotonic stack to compute, for each building, how many previous buildings it "blocks" and find the building that maximally reduces the visible skyline count.

    Stacks & Queuesmonotonic stackarrayssimulation
  • Linked ListsEasyAuto-graded
    Merge K Sorted Linked-List Segments Into One

    Tests ability to merge multiple sorted runs stored as a flat list of values, exercising the core linked-list merge-sorted-runs technique in pure Python.

    Linked Listslinked listsmergingsorting
  • BehavioralMediumModel answer
    Respond Constructively to Critical Performance Review Feedback

    Demonstrate how you processed and acted on unexpectedly harsh feedback from a manager or senior stakeholder without becoming defensive.

    Behavioralbehavioralfeedbackself-awarenessgrowth mindset
  • Math & Bit ManipulationHardAuto-graded
    Count Permutations With Exact Inversion Pairs

    Tests deep combinatorics knowledge by counting permutations of 1..n that have exactly k inversions, using the Mahonian distribution and efficient DP with modular arithmetic.

    Math & Bit Manipulationcombinatoricsdynamic programmingnumber theory
  • Linked ListsHardAuto-graded
    Find All Rho-Shape Cycle Tails in a Functional Graph

    Tests cycle detection via Floyd's / index-chasing on a pure-array functional graph, requiring candidates to identify every node's "tail length" before it enters a cycle.

    Linked Listslinked listscycle detectiongraphsarrays
  • Dynamic ProgrammingHardAuto-graded
    Collect Keys on a Grid with Locked Doors

    Tests grid-path DP where the traveler must collect keys to unlock doors, requiring bitmask state to track which keys have been picked up.

    Dynamic Programmingdynamic programmingbitmaskgridBFS/DP
  • Linked ListsMediumAuto-graded
    Find the Start of a Cycle in a Functional Graph

    Tests cycle detection on index arrays by finding the entry node of a rho-shaped path in a functional graph encoded as a plain list.

    Linked Listslinked listscycle detectiontwo pointers
  • SQL & DataMediumAuto-graded
    Reconcile Employee Project Hours Across Two Tables

    Tests the ability to join two lists of dicts (employees and time-log entries) and compute per-employee aggregated project statistics, mimicking a SQL left join + GROUP BY.

    SQL & Datadata manipulationjoiningaggregation
  • Heaps, Sorting & SearchEasyAuto-graded
    Running Median of a Sliding Window

    Tests median maintenance by computing the running median after each element is inserted into a growing sequence, using a two-heap approach.

    Heaps, Sorting & Searchheapssortingmedian maintenance
  • Stacks & QueuesEasyAuto-graded
    Evaluate a Simple Postfix (RPN) Arithmetic Expression

    Tests whether a candidate can use a stack to correctly evaluate a postfix arithmetic expression involving integers and the four basic operators.

    Stacks & Queuesstacksexpression evaluationsimulation
  • System DesignMediumModel answer
    Design a Per-User API Rate Limiter Service

    Design a distributed rate limiting service that enforces per-user request quotas across a fleet of API gateway nodes at high throughput.

    System Designsystem designrate limitingdistributed systemsredis
  • Stacks & QueuesMediumAuto-graded
    Simulate a Printer Queue with Priority Levels

    Tests queue simulation by processing print jobs where higher-priority jobs preempt lower-priority ones, requiring candidates to track position and reorder the queue correctly.

    Stacks & Queuesqueuesimulationgreedy
  • Arrays & HashingEasyAuto-graded
    Bouquet Sales: Count Days With Enough Flowers

    Tests the difference-array technique by efficiently applying ranged inventory updates and then scanning totals to answer threshold queries.

    Arrays & Hashingarraysdifference arrayprefix sumshashing
  • Arrays & HashingEasyAuto-graded
    Range Sum Queries on a Mutating Snapshot

    Tests ability to use prefix sums to efficiently answer multiple range-sum queries on a fixed array.

    Arrays & Hashingarraysprefix sumshashing
  • Greedy & IntervalsHardAuto-graded
    Minimum Penalty Task Schedule with Deadlines

    Tests the classic exchange-argument greedy insight that scheduling jobs by deadline minimizes total weighted lateness on a single machine.

    Greedy & Intervalsgreedyintervalsschedulingexchange-argument
  • Greedy & IntervalsMediumAuto-graded
    Maximum Coverage From Non-Overlapping Intervals

    Tests ability to merge overlapping intervals and use a greedy sweep to find the maximum total length covered by selecting at most K non-overlapping merged segments.

    Greedy & Intervalsgreedyintervalssorting
  • Linked ListsMediumAuto-graded
    Reorder Linked List Nodes by Alternating Ends

    Tests pointer-manipulation intuition by reordering a singly linked list (given as an array) in a front-back-front-back zigzag pattern.

    Linked Listslinked liststwo pointersarray manipulation