KatInterview

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

Interview Practice Problems

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

6064
Problems
2246
Auto-graded
15
Topics
274
Added today

Showing 1621–1650 of 6064 results

  • System DesignMediumModel answer
    Batch-Apply Transform Chains to a Folder of Photos

    Apply every transform chain to every photo, in order, with deterministic output names, no repeated decoding, and a design that parallelizes cleanly.

    System Designparallelismbatch-processingimage-processingmultiprocessing
  • BehavioralMediumModel answer
    Leading a Cross-Team Program From Ambiguity to Launch

    Walk through a program you drove end to end, explaining how you scoped and ranked work, handled disagreements between teams, and reduced delivery and launch risk.

    Behavioralprogram-managementprioritizationstakeholder-managementrisk-mitigation
  • System DesignMediumModel answer
    Lazy Iteration and Function Wrapping in Python: Generators and Decorators

    Explain how Python generators suspend and resume execution to stream data lazily, and how decorators wrap functions, including a correct wrapper that preserves metadata.

    System Designpythongeneratorsdecoratorslazy-evaluation
  • Data Structure DesignMediumAuto-graded
    Nested Transaction Log for an In-Memory Dictionary

    Simulate a key-value store with nested begin, commit and rollback by replaying a command list and recording each read result.

    Data Structure Designhash-mapstacktransactionsundo-log
  • Trees & GraphsMediumAuto-graded
    Count Clusters of Linked Playlists from a Match Grid

    Count connected components in an undirected graph given as an n x n adjacency matrix, where links chain together transitively.

    Trees & Graphsgraphconnected-componentsdfsunion-find
  • Greedy & IntervalsMediumAuto-graded
    Biggest Cabin Party Respecting Everyone's Companion Limits

    Find the largest group size k where at least k people accept exactly k-1 companions, using interval counting with a difference array in linear time.

    Greedy & Intervalsdifference-arrayintervalscountingprefix-sum
  • Trees & GraphsMediumAuto-graded
    Find the K-th Smallest Element in a BST

    Find the k-th smallest key in a binary search tree represented as a level-order array.

    Trees & Graphstrees-graphstreesin-order-traversalbinary-search-tree
  • Arrays & HashingEasyAuto-graded
    Smallest Axis-Aligned Box Around Scattered Points

    Scan a list of integer 2D points once to find the extreme x and y values, then report the enclosing axis-aligned box as a corner plus width and height.

    Arrays & Hashingarraysgeometrymin-maxsingle-pass
  • System DesignMediumModel answer
    Build a Ranked Daily Reading Feed from Thousands of Publishers

    Design a platform that pulls articles from many external publishers and serves each of millions of daily users a ranked, tailored feed in under 200ms, while staying up when sources fail.

    System Designsystem-designrecommendationrankingcaching
  • Machine LearningHardModel answer
    KV Cache, RoPE, and Nucleus Sampling with Temperature

    Explain why decoder-only transformers use a KV cache and rotary embeddings, then implement a temperature-scaled nucleus (top-p) sampler over next-token logits.

    Machine Learningtransformerskv-cacheropetop-p-sampling
  • Arrays & HashingEasyAuto-graded
    Calculate Spend Percentage of High-Volume Spenders

    Compute the share of 2023 total expenditure contributed by users who met a high-tier spending threshold in 2022.

    Arrays & Hashingarrayshash tabledata manipulationcohort analysis
  • Arrays & HashingEasyAuto-graded
    Uncovered Integer Gaps Within a Closed Window

    Scan a sorted list of distinct integers once to report every maximal run of integers in a closed window that the list skips, formatting single gaps as one-element lists.

    Arrays & Hashingarraysintervalstwo-pointersedge-cases
  • Heaps, Sorting & SearchHardAuto-graded
    Narrowest Window Touching Every Sorted Array

    Find the tightest inclusive interval that holds at least one value from each of several sorted arrays, using a k-way merge with a min-heap and a tracked maximum.

    Heaps, Sorting & Searchheapk-way-mergesorted-liststwo-pointers
  • StringsMediumAuto-graded
    Bracket Depth Scoring of a Nested Integer String

    Scan a bracketed string of non-negative integers and sum each integer times its bracket nesting level, handling multi-digit numbers, whitespace and empty lists.

    Stringsstring-parsingnested-structuressingle-passbracket-depth
  • Data Structure DesignMediumModel answer
    Pluggable Scoring Pipeline for Ranking Concert and Show Listings

    Design an object-oriented ranking engine where scoring and filtering rules can be chained, weighted, reordered and isolated from failures, with a backfill tier when too few results come back.

    Data Structure Designobject-oriented-designstrategy-patternrankingfallback
  • Arrays & HashingMediumAuto-graded
    Validate a Shuffled Start/Stop Service Log for Each Component

    Replay timestamped start/stop events in time order, with ties broken by input position, tracking one active job per category, and confirm the log is valid and fully closed.

    Arrays & Hashinghash-setsortingsimulationstate-tracking
  • SQL & DataMediumModel answer
    Evaluating Content Performance by Audience Relationship Type

    Analyze video engagement and interaction rates segmented by viewer relationship types over a rolling 7-day window using SQL aggregations and joins.

    SQL & Datasqlaggregationjoins
  • Heaps, Sorting & SearchMediumAuto-graded
    Lowest K Values in Ascending Order with Duplicates

    Select the k smallest values from an unsorted integer list, keeping duplicates and returning them sorted ascending, which tests heap, sorting and selection trade-offs.

    Heaps, Sorting & Searchheapsortingselectiontop-k
  • Heaps, Sorting & SearchMediumAuto-graded
    Determine Available Range on Number Line

    Evaluate dynamic range-query operations on 1D coordinates to test whether continuous subsegments contain obstacles.

    Heaps, Sorting & Searchheaps-sortingbinary-searchfenwick-treesegment-tree
  • StringsHardAuto-graded
    Fewest Neighbor Swaps to Mirror a Word

    Compute the minimum number of adjacent character swaps needed to rearrange a lowercase string into a palindrome, or report -1 if no palindrome is possible.

    Stringsgreedytwo-pointersstringspalindrome
  • Data Structure DesignMediumModel answer
    Build a CSV Data Frame and Assembly of Sequence Fragments

    Parse RFC 4180 CSV into an in-memory table with query support, and reconstruct chained sequences from directed or undirected overlapping fragments.

    Data Structure Designdesign-dsstringstrees-graphs
  • BehavioralMediumModel answer
    Two Behavioral Stories: A Proud Project and Tough Feedback

    Prepare two structured behavioral answers: a project you're proud of with measurable impact, and a time you got critical feedback and changed your behavior in a lasting way.

    Behavioralbehavioralstar-methodownershipfeedback
  • System DesignMediumModel answer
    Build a Real-Time Risk Scoring Gateway for Card Payments

    Design a low-latency, highly available service that scores each payment attempt using analyst-owned rules plus ML models and returns an explainable approve, block, step-up, or review verdict.

    System Designsystem-designfraud-detectionfeature-storerules-engine
  • Heaps, Sorting & SearchMediumAuto-graded
    Evaluate a Piecewise Linear Curve From Shuffled Sample Points

    Build a piecewise linear function from unordered sample points and evaluate it at one query, extending the end segments outward, using sorting and binary search.

    Heaps, Sorting & Searchbinary-searchsortinginterpolationfloating-point
  • Arrays & HashingMediumAuto-graded
    Detect Target Pair in Spiral Matrix Order

    Determine if two distinct cells in a 2D matrix sum to a target integer while processing elements in spiral order.

    Arrays & Hashingarrayshash-tablematrix
  • System DesignMediumModel answer
    Design a Multi-Vendor Book Aggregator & Automated Ordering Service

    Design an asynchronous system that aggregates quotes across hundreds of vendor APIs to find the best price for an ISBN, places an order within a target bid, and manages payment consistency.

    System Designsystem-designdistributed-systemsfault-toleranceconcurrency
  • System DesignHardModel answer
    Testing Plan: Hardware Queue, Rotating Arbiter, Ready/Valid Link

    Plan the verification of three small digital blocks (a FIFO, a round-robin arbiter and a valid/ready link) covering testbench structure, random stimulus, assertions and coverage.

    System Designdesign-verificationsystemverilogscoreboardassertions
  • BehavioralMediumModel answer
    Deep Dive on Your Highest-Impact Engineering Project

    Present one significant project you owned from problem to results, covering design choices, your personal role, a hard debugging episode, and what you would do differently.

    Behavioralbehavioralproject-deep-diveownershiptradeoffs
  • Dynamic ProgrammingHardAuto-graded
    Trim Letters to Reach a Mirror String Within a Budget

    Decide whether a string can become a palindrome after removing no more than k characters, testing interval dynamic programming and palindromic subsequence reasoning.

    Dynamic Programmingdynamic-programmingpalindromestringssubsequence
  • Dynamic ProgrammingMediumAuto-graded
    Count Step Sequences with Custom Prime Jumps

    Find the number of unique sequences of steps to reach a target using 1-unit steps or prime steps ending in digit 3.

    Dynamic Programmingdynamic-programmingmathsievemodular-arithmetic