KatInterview

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

Interview Practice Problems

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

6126
Problems
2272
Auto-graded
15
Topics
274
Added today

Showing 2701–2730 of 6126 results

  • SQL & DataMediumModel answer
    Cleaning Account Data in R and Selecting Top Half of Students in SQL

    Clean a customer CSV with ordered null-handling rules and compute two averages in tidyverse R, then write one MySQL 8 query returning the top half of students by average grade.

    SQL & Datasqlrtidyversewindow-functions
  • Heaps, Sorting & SearchMediumAuto-graded
    Resume a Sorted Score Listing from a Last-Seen Key

    Filter records by a minimum score, order them by score then id, and return one page after a (score, id) cursor along with the cursor for the following page.

    Heaps, Sorting & Searchpaginationsortingtuple-comparisonheap
  • SQL & DataMediumAuto-graded
    Prefix Totals by Value Across Duplicate-Heavy Records

    Compute, for each record, the total of all values in the dataset that do not exceed its own value, handling ties and large inputs efficiently via grouping and a running total.

    SQL & Dataaggregationprefix-sumsortinghash-map
  • System DesignHardModel answer
    Speeding Up a Pillow Photo Pipeline with Workers

    Build a per-photo Pillow pipeline that applies a fixed series of edits, then cut wall-clock time with parallelism and justify processes vs threads and the worker count.

    System Designpythonpillowmultiprocessinggil
  • Stacks & QueuesMediumAuto-graded
    Evaluate Nested Prefix Expressions with Scoped Bindings

    Parse and evaluate a parenthesized prefix language with sum, prod and set, handling lexical scoping, strict validation and 32-bit overflow rules.

    Stacks & Queuesparsingrecursionscopingstack
  • Data Structure DesignMediumAuto-graded
    Subtree Totals Under Collapse and Graft Operations

    Maintain per-node totals in a rooted tree while nodes are collapsed into leaves or have a subtree grafted onto a leaf, answering total queries after each change.

    Data Structure Designtreehash-mapsimulationparent-pointers
  • Data Structure DesignMediumAuto-graded
    Alive-Node Graph Simulator with Gated Edge Insertion

    Simulate a sequence of node toggles, edge edits, and connectivity queries on an undirected graph where only alive nodes count and edges are only added between alive endpoints.

    Data Structure Designunion-findgraphsimulationconnected-components
  • Arrays & HashingEasyAuto-graded
    Share of Users Who Cancel and Never Come Back

    Group booking records by user, find each canceller's earliest cancellation, and compute the percentage with no later confirmed or returned booking.

    Arrays & Hashinghash-maptimestampsgroupingpercentage
  • BehavioralMediumModel answer
    Narrating Your Career and Standout Project as a Data Engineer

    Deliver a structured walkthrough of your career as a data engineer, covering each role's scope, impact, and transitions, then a deep dive on your proudest project and a candid retrospective.

    Behavioralbehavioraldata-engineeringstorytellingstar-method
  • System DesignMediumModel answer
    Deadline-Aware Task Dispatcher with Dependencies and Leases

    Build a task dispatcher that serves the earliest-deadline runnable task, handles prerequisites, and grows into a fault-tolerant multi-worker service.

    System Designschedulerpriority-queuetopological-sortdistributed-systems
  • Stacks & QueuesMediumAuto-graded
    Finish Times for a Single Worker with a Limited Waiting Line

    Simulate a one-worker FIFO queue with a capped waiting line and report each job's finish time or -1 if it was rejected, using a deque of finish times.

    Stacks & Queuesqueuedequesimulationamortized-analysis
  • System DesignMediumModel answer
    Scheduling Collision Detection for a Shared Calendar Service

    Design the backend that detects and handles scheduling collisions when users create or edit events, covering recurrence, attendees, privacy, time zones, and concurrent edits at massive scale.

    System Designsystem-designcalendarconflict-detectionrecurrence
  • Statistics & ExperimentsMediumModel answer
    Designing a Success Framework for a Third-Party App Marketplace

    Build a measurement system for a merchant-and-developer app marketplace: north-star metric, per-side metrics, guardrails, required tables and joins, and how to test ranking changes.

    Statistics & Experimentsproduct-metricsmarketplacenorth-star-metricguardrail-metrics
  • BehavioralMediumModel answer
    Pitching Your Quant Background for a Macro Fund Screening Call

    Prepare a tight, story-driven set of answers covering your background, internships, motivation for the buy side, a specific fund, and personal character in a short recruiter screen.

    Behavioralbehavioralself-introductionmotivationSTAR
  • Data Structure DesignMediumAuto-graded
    Nearest Working Charger: Command Simulator with Great-Circle Math

    Process a batch of commands on a charging-station registry, with status updates, spherical distance and nearest-online lookups that break ties deterministically.

    Data Structure Designdesignsimulationhaversinesorting
  • Trees & GraphsMediumModel answer
    Collect Every Reachable Page on a Single Host

    Write a function that explores a website from one starting URL, following only links on the same hostname, and returns each distinct page once while coping with link cycles.

    Trees & Graphsgraph-traversalbfsurl-normalizationdeduplication
  • Arrays & HashingMediumAuto-graded
    Runner-Up Label by Frequency Tier in a Flat Record List

    Count labels in every third slot of a flat list, find the second-highest distinct count, and break ties by earliest appearance.

    Arrays & Hashinghash-mapcountingfrequencytie-breaking
  • Machine LearningHardModel answer
    Forecasting Next-Day Energy Use Across Commercial Buildings

    Design a full forecasting pipeline for next-day electricity use across many commercial buildings, from features and validation through deployment, monitoring, privacy and an ablation study.

    Machine Learningtime-seriesregressionfeature-engineeringmlops
  • Machine LearningHardModel answer
    Defend a Tabular ML Project: Validation, Tuning, PCA, SHAP

    Walk through one supervised ML project end to end, covering leakage, time-aware validation, feature choices and tuning, then derive PCA and explain SHAP and its pitfalls.

    Machine Learningpcashapleakagetime-series-validation
  • BehavioralMediumModel answer
    Talking About Your AI Tool Habits and a Time They Paid Off

    Answer two behavioral questions about how you use AI tools in engineering work and about one concrete case where they made you or your team faster, including verification and data limits.

    Behavioralbehavioralai-toolsproductivitystar-method
  • System DesignHardModel answer
    Shared Storage Allowance Service Across Many Products

    Design a globally consistent service that tracks one storage allowance per user across several products, guaranteeing usage never exceeds the limit while staying fast and available.

    System Designsystem-designdistributed-systemsconsistencyidempotency
  • Machine LearningMediumModel answer
    Designing LLM-Generated Daily Briefs for Perishable Goods Logistics

    Design a pipeline that adds LLM-written narrative insights to existing supply-chain reports while keeping numbers exact, data secure, and outputs verified before delivery.

    Machine Learningllmraggroundingevaluation
  • Data Structure DesignMediumModel answer
    Strong vs Weak Counts in shared_ptr and How weak_ptr Breaks Cycles

    Describe the two reference counts in a shared_ptr control block, how weak_ptr uses them, why lock() is needed, and how a weak back-edge fixes a leaking ownership cycle.

    Data Structure Designcppsmart-pointersshared_ptrweak_ptr
  • Arrays & HashingEasyAuto-graded
    Locate Two Entries Adding Up to a Goal Value

    Find two different positions in an integer list whose values sum to a goal, using a deterministic tie-break rule, which tests complement lookup with a hash map.

    Arrays & Hashinghash-maparraycomplement-lookuptwo-sum
  • Data Structure DesignMediumAuto-graded
    Recency-Evicting Store Simulation Plus Graph Group Tally

    Simulate a fixed-size recency-evicting key-value store from a command log, and separately count connected groups in an undirected graph, returning both results together.

    Data Structure Designlru-cachehash-mapordered-dictunion-find
  • System DesignMediumModel answer
    Architect a Scalable Storage Cluster for Huge Files Across Many Machines

    Design a cluster-based file storage system from a vague prompt, defining workload, guarantees and scale first, then covering metadata, data placement, I/O paths and failure handling.

    System Designdistributed-systemsstoragereplicationmetadata
  • Math & Bit ManipulationMediumAuto-graded
    Four Weighted Dice: Lowest Three Add Up to Three

    Compute the exact reduced probability that the three smallest of four independent weighted dice sum to 3, which reduces to counting weighted outcomes with at least three ones.

    Math & Bit Manipulationprobabilitycombinatoricsfractionscounting
  • Math & Bit ManipulationMediumAuto-graded
    Project a Vertex and Its Normal Through a Render Pipeline

    Apply model, view and projection matrices to a point, do the perspective divide and viewport mapping, and transform a normal with the inverse-transpose of the model's 3x3 block.

    Math & Bit Manipulationlinear-algebramatriceshomogeneous-coordinatessimulation
  • Machine LearningMediumModel answer
    Self-Attention Deep Dive: Q, K, V Roles and Transformer Design Trade-offs

    Explain how self-attention builds queries, keys and values, what the value vectors do, and why Transformers handle long-range context better than recurrent models.

    Machine Learningtransformersself-attentionqkvmulti-head-attention
  • System DesignMediumModel answer
    Build a Real-Time Ad Decision Service with Spend Controls

    Design a backend that picks one ad per page slot within a strict latency limit, logs views and clicks for billing, and keeps campaign spend within budget and spread across the day.

    System Designsystem-designad-servinglow-latencybudget-pacing