KatInterview

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

Interview Practice Problems

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

5986
Problems
2219
Auto-graded
15
Topics
271
Added today

Showing 5641–5670 of 5986 results

  • Trees & GraphsHardModel answer
    Navigate Between Nodes in a Recursively Defined Binary Tree

    Determine the path between two nodes in a Fibonacci-style binary tree using only their preorder indices, without building the tree in memory.

    Trees & Graphsbinary-treesrecursionfibonaccitree-traversal
  • Trees & GraphsMediumAuto-graded
    Identify Connected Power Grid Regions

    Tests union-find (disjoint set union) to group transmission lines into connected components and answer queries about grid connectivity.

    Trees & Graphsunion-findgraphsconnected-components
  • Trees & GraphsMediumAuto-graded
    Greenhouse Disease Spread Timer

    Tests multi-source BFS to find the time until a grid-based propagation process completes or determine impossibility.

    Trees & Graphsbreadth-first-searchgridmulti-source-bfs
  • Data Structure DesignMediumModel answer
    Building Robust Autocomplete Query Management

    Design and implement the query-handling layer for an autocomplete component with debouncing, retry logic, response ordering, and result caching.

    Data Structure Designasynccachingstate-management
  • Statistics & ExperimentsMediumModel answer
    Maximum Likelihood Estimation and Conditional Gaussian Distributions

    Derive maximum likelihood estimators for Gaussian parameters under various constraints, compute conditional distributions in bivariate Gaussians, and analyze estimator bias.

    Statistics & Experimentsmaximum-likelihoodgaussian-distributionconditional-probabilityestimator-bias
  • System DesignMediumModel answer
    Building a Fault-Tolerant Payment System with Zero Duplicates

    Design a payment platform that prevents duplicate charges through idempotency, handles gateway timeouts safely, and maintains financial correctness.

    System Designdistributed-systemspaymentsidempotencyconcurrency
  • Data Structure DesignMediumModel answer
    Concurrent In-Memory Cache with Sharded Locking

    Build a thread-safe in-memory cache supporting concurrent reads and writes, choosing data structures and synchronization primitives to minimize contention.

    Data Structure Designconcurrencythreadinglockingdata-structures
  • System DesignHardModel answer
    E-commerce Catalog Update System with Asynchronous Image Processing

    Design a scalable system for merchants to update product catalogs individually or in bulk, with image validation and CDN delivery.

    System Designdistributed-systemsasync-processingconcurrencyscalability
  • Data Structure DesignMediumModel answer
    C++ Implementation Details: Containers and Polymorphism

    Explain the internal mechanics of std::vector growth, std::unordered_map collision handling, and virtual function dispatch in C++.

    Data Structure Designc++data-structuresperformancememory
  • SQL & DataMediumAuto-graded
    Day-7 User Activity Counter

    Identify users who recorded at least one activity exactly seven calendar days after joining.

    SQL & Datadata-analysisdate-manipulationset-operations
  • Statistics & ExperimentsMediumModel answer
    Why L1 Loss Produces the Median and L2 Loss Produces the Mean

    Explain why minimizing absolute deviations yields the median while minimizing squared deviations yields the mean, and how these principles extend to higher dimensions.

    Statistics & Experimentsloss-functionscentral-tendencyoptimizationoutliers
  • System DesignMediumModel answer
    High-Throughput Counter System for Social Engagement

    Design a counting service that supports millions of concurrent engagement actions with eventual consistency and sub-50ms read latency.

    System Designdistributed-systemseventual-consistencyhigh-throughputcaching
  • Arrays & HashingEasyAuto-graded
    Combine Two Ordered Sequences

    Tests your ability to merge two pre-sorted arrays into a single sorted result using the classic two-pointer technique.

    Arrays & Hashingtwo-pointerssortingmerge
  • System DesignMediumModel answer
    Background Job API for Hierarchical Data Replication

    Design an endpoint that replicates a multi-level data hierarchy with automatic identifier reassignment, progress tracking, and fault tolerance.

    System Designbackground-jobsdatabasesapi-design
  • System DesignHardModel answer
    Building a High-Performance In-Memory Cache

    Design a fast, thread-safe in-memory cache with automatic expiration and crash recovery capabilities.

    System Designcachingconcurrencydistributed-systems
  • Arrays & HashingEasyAuto-graded
    Track Target Occurrence Patterns Across Array Regions

    Identifies whether a target value occurs at even/odd indices and in the first/second half of an even-length array in one pass.

    Arrays & Hashingarray-traversalboolean-flagsearly-termination
  • Data Structure DesignMediumModel answer
    Banking API with Thread-Safe Account Operations

    Build a thread-safe banking system supporting account creation, deposits, and transfers with atomic balance updates.

    Data Structure Designconcurrencythreadinglocksdata-structures
  • Machine LearningMediumModel answer
    Designing a Time-Aware Model for User Conversion Prediction

    Design an ML system to forecast user purchase likelihood while handling temporal constraints, severe class imbalance, and business-driven precision requirements.

    Machine Learningtime-seriesimbalanced-datafeature-engineeringmodel-evaluation
  • System DesignMediumModel answer
    Design an Idempotent Payment Processing Service

    Design a payment service that safely retries failed transactions without double-charging customers, handling scale of ~10,000 transactions per second.

    System Designsystem designpaymentsidempotencydistributed systems
  • Math & Bit ManipulationMediumAuto-graded
    Calculate Ride Service Economics and Peak Pricing

    Tests unit economics, capacity planning, and dynamic pricing calculations for a transportation service with fixed driver costs and variable demand.

    Math & Bit Manipulationunit-economicscapacity-planningprofit-calculation
  • Trees & GraphsMediumAuto-graded
    Find All Downstream Dependents in a Dependency Graph

    Tests graph traversal with edge reversal to find all nodes reachable through reversed dependency edges, handling cycles correctly.

    Trees & Graphsgraph-traversalbfsdirected-graphcycle-detection
  • System DesignHardModel answer
    Building a Staleness Detection System for Job Postings

    Design a system to identify and handle outdated job listings through signal aggregation, graduated enforcement, and employer dispute resolution.

    System Designdistributed-systemsevent-processingstate-machinesreal-time-systems
  • BehavioralMediumModel answer
    Diagnosing Memory Issues in an iOS Video Application

    Investigate and resolve memory-related crashes in an iOS video feed app by distinguishing between kernel terminations, retain cycles, and access violations.

    Behavioraliosmemory-managementdebuggingmobile
  • Heaps, Sorting & SearchMediumAuto-graded
    Count Valid Number Triplets Within Range

    Find how many ways to pick three numbers from an array where the maximum minus the minimum stays within a given threshold.

    Heaps, Sorting & Searchsortingtwo-pointerscombinatorics
  • Arrays & HashingEasyAuto-graded
    Apply Range Paint Operations and Count Final Colors

    Tests ability to use difference arrays to efficiently apply multiple range-update operations and decode the final state.

    Arrays & Hashingarraysdifference arrayprefix sumshashing
  • Data Structure DesignMediumModel answer
    Build Iterator Abstractions and Composed Traversals

    Design an iterator protocol from scratch, implement concrete iterators with different traversal logic, and extend them with features like peeking, filtering, and flattening.

    Data Structure Designiteratorsinterface-designlazy-evaluation
  • Statistics & ExperimentsMediumModel answer
    Diagnosing a Drop in Mobile Wallet Activity

    Systematically investigate a decline in wallet engagement by forming testable hypotheses and identifying data signals that confirm or rule out each explanation.

    Statistics & Experimentsmetricsroot-cause-analysisexperimentationdata-quality
  • System DesignMediumModel answer
    Design a High-Concurrency Concert Seat Reservation Platform

    Design a ticket booking system that handles millions of simultaneous users competing for limited inventory while preventing double-bookings and race conditions.

    System Designhigh-concurrencyinventory-managementdistributed-systemscaching
  • Data Structure DesignMediumModel answer
    Fix a Ride Dispatch Selection Bug

    Reproduce and fix a bug causing incorrect driver-to-order matching in a delivery assignment service.

    Data Structure Designdebuggingtestingconcurrencydistributed-systems
  • Machine LearningHardModel answer
    Model Selection and Threshold Tuning in Classification Tasks

    Analyze cost-sensitive threshold selection, compare ensemble methods for production systems, and explain how regularization penalties shape model weights.

    Machine Learningmodel-evaluationensemble-methodsregularizationcost-sensitive-learning