KatInterview

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

Interview Practice Problems

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

6010
Problems
2227
Auto-graded
15
Topics
275
Added today

Showing 721–750 of 6010 results

  • System DesignMediumModel answer
    Circular Waits and Lock Contention: Spotting and Preventing Deadlocks

    Explain what a deadlock is, the conditions that make one possible, realistic scenarios, and the engineering techniques used to prevent, avoid, detect and recover from them.

    System Designconcurrencydeadlocklockingoperating-systems
  • BehavioralMediumModel answer
    Motivation, Setbacks, and Leading a Team Through Delivery Pressure

    A two-part behavioral practice problem on explaining why you want a specific role, responding to a rejection, and describing how you would manage delivery, upward pressure, and extra effort.

    Behavioralbehavioralleadershipmotivationconflict-resolution
  • Data Structure DesignMediumAuto-graded
    Top-of-Book Quotes per Venue and Across All Venues

    Aggregate order records by price level to answer per-venue and market-wide best bid and ask queries, summing the size at the best price.

    Data Structure Designhash-mapaggregationorder-booksimulation
  • Arrays & HashingMediumAuto-graded
    Enumerate All Index Pairs Adding Up to a Goal Value

    Tests hash-map indexing of duplicate values to list every index pair i < j whose values sum to a goal, in a specific sorted output order.

    Arrays & Hashinghash-maptwo-sumduplicatesenumeration
  • Arrays & HashingMediumAuto-graded
    Seven-Day Spend Grid per Shopper Using Only String Dates

    Aggregate (shopper, date, amount) records into per-shopper totals for a 7-day window, using hand-written ISO date stepping and hashing instead of date libraries.

    Arrays & Hashinghashingaggregationstring-datessimulation
  • SQL & DataEasyAuto-graded
    Unify Two Yearly Sales Record Lists With a Mismatched Key

    Tests normalizing records from two sources with a misspelled field name, casting a numeric field to float, and concatenating the lists in order without mutating inputs.

    SQL & Datadata-cleaningdictionariesschema-alignmentconcatenation
  • BehavioralMediumModel answer
    Running a Production Incident from Page to Postmortem

    Describe how you own an on-call shift and drive a production incident from the first page through mitigation, communication, verified recovery, and lasting fixes.

    Behavioralon-callincident-responsepostmortemcommunication
  • SQL & DataMediumAuto-graded
    Find Riders Idle Through the Latest Week of Activity

    Given user and ride records, return users with no ride in the 7-day window ending at the latest ride date, including users who never rode, sorted by user_id.

    SQL & Dataanti-joindate-windowhash-setfiltering
  • System DesignMediumModel answer
    Cutting Duplicate HTTP Calls in a curl-Driven Workflow

    Instrument an HTTP client to count and attribute its calls, detect wasteful repeats, reduce them safely, and prove the change is correct and stays fixed.

    System Designobservabilityhttpcachingbatching
  • Greedy & IntervalsMediumAuto-graded
    Peak Overlap of Half-Open Time Ranges

    Compute the largest number of simultaneously running half-open time ranges using a sweep over sorted start and end events, with correct handling of ties at boundaries.

    Greedy & Intervalssweep-lineintervalssortinghalf-open-intervals
  • StringsEasyAuto-graded
    Shared Starting Sequence in String Array

    Determine the longest initial substring shared across every word in a given list.

    Stringsstringsarraysprefix
  • Greedy & IntervalsMediumAuto-graded
    Maximum Number With Even Counts of Ones and Twos

    Delete characters from a string of 1s and 2s so both digit counts are even, and return the largest possible number. Tests greedy subsequence construction with count constraints.

    Greedy & Intervalsgreedystringssubsequencelexicographic
  • Heaps, Sorting & SearchMediumAuto-graded
    Rank Point Pairs by Bounding Hyperrectangle Volume

    Enumerate point pairs in d dimensions, compute the volume of the box they span, drop flat boxes, and return the rest in a strict multi-key order.

    Heaps, Sorting & Searchsortingpair-enumerationgeometrymulti-key-sort
  • Dynamic ProgrammingHardAuto-graded
    Coin Pile Fusion: Who Makes the Last Merge?

    Decide the winner of a two-player impartial game where piles are fused under a size cap, using memoized game-tree search over canonical multiset states.

    Dynamic Programminggame-theorymemoizationbacktrackingbitmask-states
  • System DesignMediumModel answer
    How the JVM Allocates and Reclaims Memory Without Manual Freeing

    Walk through how the JVM places objects in memory, decides which are dead, reclaims them with different collectors, and why leaks and resource problems still occur.

    System Designjavajvmgarbage-collectionmemory-management
  • SQL & DataMediumModel answer
    Calculate Top Customer Revenue Share and 7-Day Growth by Product Model

    Write a SQL query to compute 7-day revenue growth and identify top spenders per product model with tie-breaking logic based on historical purchase date.

    SQL & Datasqlwindow-functionsaggregationsjoins
  • Trees & GraphsMediumAuto-graded
    Lexicographically Smallest Valid Task Schedule

    Decide whether tasks with prerequisite constraints can all be run, and if so produce the lexicographically smallest valid run order, using topological sorting with a min-heap.

    Trees & Graphstopological-sortgraphheapcycle-detection
  • Dynamic ProgrammingMediumAuto-graded
    Booth Assignment Plan: Cheapest Non-Repeating Color Sequence

    Choose one of three colors per day to minimize total cost with no color on two adjacent days, then return the actual sequence using DP with backtracking.

    Dynamic Programmingdynamic-programmingpath-reconstructionarrays
  • Data Structure DesignMediumAuto-graded
    Seat Assignment with Forward-Only Probing on a Fixed Row

    Decide whether every request in a sequence can be seated in a fixed row when taken spots push it to the next free higher slot; tests efficient next-free-slot lookup, e.g. with union-find.

    Data Structure Designunion-findsimulationarraysgreedy
  • StringsEasyAuto-graded
    Screen Pasted Card Numbers: Format, Issuer Prefix and Luhn

    Filter strings by a character and length rule, an issuer-prefix range and the Luhn checksum, returning the original text of each valid entry in input order.

    Stringsstringsvalidationluhnsimulation
  • System DesignHardModel answer
    Exactly-Once Click Event Cleanup in a Streaming Lake Pipeline

    Design a Spark Structured Streaming job that removes retry-induced duplicate click events at 10M/s with a 24-hour window, handling late data, hot keys, idempotent writes, and backfills.

    System Designsparkstructured-streamingdeduplicationdata-skew
  • Trees & GraphsMediumAuto-graded
    Rank Suggested Connections by Shared Friends

    Build an undirected graph from friendship pairs, then rank every non-friend of a target user by mutual friends, degree and ID using a composite sort key.

    Trees & Graphsgraphadjacency-listsortingsets
  • Heaps, Sorting & SearchMediumModel answer
    Ordering a Hundred Million Decimal Digits in Place

    Order a huge byte array holding only the values 0 to 9 in linear time with constant extra memory, then reason about storage layout, memory bandwidth and expected runtime.

    Heaps, Sorting & Searchcounting-sortin-placememory-bandwidthbytearray
  • BehavioralHardModel answer
    Ten Leadership Stories Every Product Manager Should Prepare

    Build a bank of structured, metric-backed stories that answer ten common product leadership prompts, from high-impact launches to disagreeing and committing.

    Behavioralbehavioralproduct-managementleadershipstar-method
  • Dynamic ProgrammingMediumAuto-graded
    Maximum Earnings from Back-to-Back Booking Slots

    Pick non-overlapping time slots, where one may begin exactly as another finishes, to maximize total payout; tests weighted interval scheduling with sorting, DP and binary search.

    Dynamic Programmingdynamic-programmingbinary-searchintervalssorting
  • SQL & DataMediumAuto-graded
    Weekly Totals with 3-Week Rolling Sum in Pacific Time

    Bucket timestamped payments into Pacific-time Monday weeks, fill empty weeks with zero, and report weekly and trailing three-week totals.

    SQL & Datatime zonesdate bucketingrolling windowaggregation
  • Arrays & HashingEasyAuto-graded
    Compute Usage and Quality Metrics from Workplace Search Logs

    Aggregate a list of search log records into funnel, quality, latency and repeat-usage metrics, handling empty input and even-length medians.

    Arrays & Hashinghash-mapaggregationsimulationmedian
  • Trees & GraphsMediumAuto-graded
    Schedule Courses Under Prerequisite Rules

    Produce a deterministic course order that respects prerequisite pairs using a queue-based topological sort, or an empty list if the prerequisites contain a cycle.

    Trees & Graphstopological-sortgraphbfscycle-detection
  • StringsMediumModel answer
    Round a Decimal String Without Using Floats

    Round a decimal number given as a string to the nearest integer, then to its last significant digit, using digit-level arithmetic and carry handling instead of floating-point types.

    Stringsstringscarry-propagationroundingparsing
  • System DesignMediumModel answer
    Counting Nodes in a Distributed Tree Network

    Design a distributed algorithm and protocol to count all nodes in an N-ary tree using asynchronous message passing, local state, and deduplication.

    System Designdistributed-systemsconcurrencytrees-graphssystem-design