KatInterview

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

Interview Practice Problems

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

6128
Problems
2272
Auto-graded
15
Topics
275
Added today

Showing 2761–2790 of 6128 results

  • Data Structure DesignMediumModel answer
    Build a Run-Once Typewriter Component for a Hidden Token

    Build a React and TypeScript component that finds a hidden token in the DOM or over HTTP, types it out every 50ms, never replays the animation, cleans up after itself, and has Mocha tests.

    Data Structure Designreacttypescripthooksasync
  • BehavioralMediumModel answer
    Five Collaboration Stories: Conflict, Advocacy and Listening

    Prepare structured, evidence-backed stories on a hard project, advocating for others, learning from peers, disagreeing constructively, and listening, with follow-ups.

    Behavioralbehavioralteamworkconflict-resolutionSTAR
  • Trees & GraphsMediumAuto-graded
    Longest Dependency Chain in a Task DAG

    Find the longest total-duration chain in a task dependency DAG and return its length and task names, using topological-order DP with predecessor tracking.

    Trees & Graphsgraphdagtopological-sortdynamic-programming
  • Statistics & ExperimentsMediumModel answer
    Measuring a Voluntary App Redesign Rollout Without an A/B Test

    Estimate the causal effect of an opt-in app redesign when users self-select into upgrading, covering cohort design, confounders, estimation methods, and validation checks.

    Statistics & Experimentscausal-inferencepropensity-scoredifference-in-differencesobservational-study
  • Trees & GraphsMediumAuto-graded
    Acyclic Invitation Graph with Depth Queries and Expected Payout

    Simulate a stream of operations on a DAG: reject cycle-forming or duplicate edges, count nodes within a hop limit, and sum expected decayed payouts using BFS shortest distances.

    Trees & Graphsgraphbfsdagcycle-detection
  • BehavioralMediumModel answer
    Protecting a Committed Delivery Date When Risk Emerges

    Explain how you plan, monitor and defend delivery commitments as an engineering manager, then describe a real project whose committed date came under threat and how you handled it.

    Behavioralengineering-managerplanningrisk-managementstakeholder-communication
  • StringsMediumAuto-graded
    Decode a Hex String into a Dotted-Quad Network Address

    Validate a strict 8-digit hex string with an optional 0x prefix and convert it into dotted-decimal IPv4 form, treating the leftmost byte as the first octet.

    Stringsstringsparsingvalidationhexadecimal
  • Heaps, Sorting & SearchMediumAuto-graded
    Running Median Over a Command Log of Inserts and Queries

    Process a log of insert and query commands on a growing multiset of integers, reporting the median at each query using two heaps for efficient updates.

    Heaps, Sorting & Searchheaptwo-heapsstreamingmedian
  • Machine LearningHardModel answer
    Building a Recommender: From Neighbors to Latent Factors

    Compare neighborhood and matrix factorization recommenders, and explain loss, regularization, cold start, popularity bias, evaluation and large-catalog scaling.

    Machine Learningrecommender-systemscollaborative-filteringmatrix-factorizationimplicit-feedback
  • System DesignHardModel answer
    Parallelizing a Sliding Dot-Product Filter Across CPU Cores

    Design a multithreaded CPU routine for valid 1D correlation that adapts to tiny, huge, and thread-capped cases, covering partitioning, false sharing, SIMD, and merging.

    System Designmultithreadingparallel-reductionfalse-sharingsimd
  • BehavioralMediumModel answer
    Principled Pushback: Disagreeing With Leaders Under Pressure

    Describe how you handle situations where your technical judgment or values clash with leadership, covering unpopular-but-correct calls, value conflicts, and declining a manager's directive.

    Behavioralbehavioralleadershipethicsconflict-resolution
  • System DesignMediumModel answer
    Thread-Safe Maps, Cache Sharding and Batch Processing Models

    Explain how Java's concurrent hash map stays safe under contention, how to shard a session cache without mass reshuffling, and when batch map-reduce beats SQL joins.

    System Designconcurrencyconsistent-hashingjavadistributed-systems
  • Stacks & QueuesMediumAuto-graded
    Self-Time Accounting for Nested Call Traces

    Use a stack to turn start/end trace records of nested calls on one CPU into each function's self-time, with inclusive end timestamps.

    Stacks & Queuesstackparsingsimulationstrings
  • Machine LearningMediumModel answer
    Predicting Itemizers vs Standard Filers for a Tax App

    Design an interpretable, recall-oriented classifier that predicts whether a tax-software user should itemize deductions, covering preprocessing, features, imbalance-aware metrics and time-aware validation.

    Machine Learningclassificationimbalanced-datafeature-engineeringtime-based-validation
  • BehavioralMediumModel answer
    Credit Disputes and Competing Priorities: Behavioral Answers

    A two-part behavioral prompt: resolve a situation where a colleague claims your work as theirs, and explain how you rank, schedule and communicate when many tasks compete for attention.

    Behavioralbehavioralconflict-resolutionprioritizationcommunication
  • Arrays & HashingMediumModel answer
    Cart Pricing Engine: Offers, Cheapest Deal, Aisle Sort

    Parse cart records, total units and price in integer cents, apply the best percent-off or buy-N-get-M-free deal per product, then sort items by aisle with frozen goods at the end.

    Arrays & Hashingparsingmoney-arithmeticextensible-designsorting
  • Data Structure DesignMediumAuto-graded
    Replay Operations on a Skip-Ahead Iterator

    Simulate a forward-only iterator that yields every k-th element, with an idempotent has-next check, and return the results of a scripted sequence of operations.

    Data Structure Designiteratorsimulationstate-managementdesign
  • System DesignMediumModel answer
    Building a Fan-Out Service That Indexes a Huge Directory Tree

    Design an asynchronous service where workers recursively split a directory scan into child tasks, with safe retries, deduplication, progress reporting and scaling to billions of files.

    System Designsystem-designdistributed-systemsmessage-queueidempotency
  • System DesignMediumModel answer
    Storage Backend for a Large-Scale Time-Series Metrics Platform

    Design the storage layer for a metrics platform that ingests 100k points per second, serves tag-filtered time-range queries, downsamples older data and enforces tiered retention.

    System Designtime-seriesstoragepartitioningdownsampling
  • Machine LearningMediumModel answer
    Padded-Token Smoothed Softmax Loss with Gradients in NumPy

    Write a stable NumPy loss for sequence models that skips padded positions, smooths the target distribution, rescales logits by temperature, and returns the exact gradient with respect to the logits.

    Machine Learningcross-entropylabel-smoothingnumpysoftmax
  • BehavioralHardModel answer
    Customer-Facing Data Science Screen: Motivation, Stories, and a Pitch

    Answer a multi-part screening round for a customer-facing technical data science role, covering motivation, past stories, a sales scenario for a large retailer, and career goals.

    Behavioralbehavioralcustomer-facingstakeholder-managementconsultative-selling
  • Heaps, Sorting & SearchEasyAuto-graded
    Rank Advertisers by Reports, Then Report Rate

    Aggregate per-ad records by advertiser, then rank with a multi-key sort (total reports, report rate, id) and return the top k.

    Heaps, Sorting & Searchhashingsortingaggregationcustom-sort-key
  • Dynamic ProgrammingMediumAuto-graded
    Maximum Ore Haul on a Climb-and-Step Grid Route

    Grid dynamic programming: find the route with the largest sum from the bottom-left to the top-right cell when only moving up or right.

    Dynamic Programmingdynamic-programminggridmatrixpath-sum
  • Greedy & IntervalsMediumAuto-graded
    Fewest Vehicles to Cover Back-to-Back Bookings

    Find the peak number of simultaneously active half-open intervals using a sweep line or heap, with correct handling of ties where one booking ends as another begins.

    Greedy & Intervalsintervalssweep-linesortingheap
  • Data Structure DesignMediumAuto-graded
    Parcel Runner Payout Ledger with Peak Overlap Queries

    Simulate a stateful ledger driven by operation lists: track per-runner payout sums and compute maximum simultaneous half-open intervals clipped to a query window.

    Data Structure Designsweep-linehash-mapintervalssimulation
  • Data Structure DesignMediumAuto-graded
    Batch Runner for a Slash-Separated Key Store

    Simulate a hierarchical key store from a batch of create/get commands, where a key can only be created once its parent key already exists.

    Data Structure Designdesignhash-maptriesimulation
  • Machine LearningMediumModel answer
    Choosing and Validating a Loan Default Model Under Regulation

    Compare logistic regression, random forests and boosted trees for predicting loan default, and explain how to validate them, treat rare defaults, and keep decisions explainable.

    Machine Learningcredit-riskgradient-boostingclass-imbalancemodel-interpretability
  • Machine LearningMediumModel answer
    Splitting a Large Transformer: Intra-Layer vs Inter-Layer Sharding

    Contrast sharding weights within each transformer layer against assigning consecutive layers to different devices, covering communication, bubbles, memory, and inference latency.

    Machine Learningdistributed-trainingtensor-parallelismpipeline-parallelismtransformers
  • Statistics & ExperimentsMediumModel answer
    Investigating Swings in a Loan Approval Rate Over Two Years

    Explain how you would diagnose a dip, a bump and a sustained rise in a monthly approval rate by splitting numerator, denominator and mix, validating data, and separating seasonality from causal effects.

    Statistics & Experimentsroot-cause-analysisratio-metricstime-seriessegmentation
  • Trees & GraphsEasyModel answer
    Lone-Parity Filter and Leftmost Node Per Tree Depth

    Write one function that returns the elements whose even/odd class appears exactly once in an array, plus the first node's value at every depth of a binary tree.

    Trees & Graphsbfsbinary-treelevel-ordercounting