KatInterview

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

Interview Practice Problems

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

6013
Problems
2228
Auto-graded
15
Topics
276
Added today

Showing 721–750 of 2228 results

  • Arrays & HashingEasyAuto-graded
    Order Each Neighboring Couple in a List, Skipping a Lone Tail

    Reorder the two values inside every consecutive couple of a list so the smaller comes first, keeping couples in place and leaving an unpaired final value alone.

    Arrays & Hashingarraystwo-pointerssimulationindex-handling
  • Arrays & HashingMediumAuto-graded
    2D Matrix Cross-Correlation Filter

    Compute the 2D cross-correlation between a grid matrix and a filter kernel using valid padding and stride 1.

    Arrays & Hashingarraysmatrix
  • Arrays & HashingEasyAuto-graded
    Binomial Process Modeling and Moment Computation

    Return theoretical properties and compute the expected value and variance for a Binomial random variable given sample size n and success probability p.

    Arrays & Hashingbinomialprobabilitystatisticsmath
  • Data Structure DesignMediumAuto-graded
    Design an In-Memory Database Engine

    Simulate an in-memory single-table key-value store supporting lookup, update, and sorted conditional selection queries.

    Data Structure Designhash-mapdesignsortingstrings
  • Trees & GraphsMediumAuto-graded
    Assemble a Reply Thread Forest from Flat Records

    Convert an unordered flat list of records with parent links into a nested forest, preserving input order and rejecting duplicate ids, missing parents and cycles.

    Trees & Graphstree-constructionhash-mapcycle-detectionforest
  • Trees & GraphsEasyAuto-graded
    Label Each Node as Root, Inner, or Leaf from Parent Links

    Classify every node of a rooted tree given as [id, parent_id] pairs into Root, Inner, or Leaf, using a set of parent ids, and return the labels sorted by id.

    Trees & Graphstreehash-setclassificationsorting
  • Math & Bit ManipulationMediumAuto-graded
    Calculate Minimal Clock Hand Separation Angle

    Parse 24-hour timestamp strings (including optional seconds and milliseconds) and calculate the minor angle between analog clock hands.

    Math & Bit Manipulationmathstringsgeometry
  • StringsEasyAuto-graded
    Minimum Replacements to Eliminate Consecutive Equal Triples

    Find the total minimum number of character modifications required to prevent any character from repeating 3 or more times consecutively across a collection of strings.

    Stringsstringsgreedy
  • Arrays & HashingMediumAuto-graded
    Most Common Values with First-Seen Tie-Breaking

    Return the k most frequent values in an integer list, ordered by count and then by first appearance, using hash counting and frequency buckets for linear time.

    Arrays & Hashinghash-mapbucket-sortfrequency-counttop-k
  • Trees & GraphsMediumAuto-graded
    Reveal Cells on a Mine Grid After a Tap

    Simulate one tap on a minesweeper grid, using a flood fill from zero-count cells to reveal connected safe regions and their numbered borders.

    Trees & Graphsbfsflood-fillgridsimulation
  • Greedy & IntervalsMediumAuto-graded
    Fewest Conference Rooms for a Day of Bookings

    Find the fewest rooms that can host every booking in an unordered list of half-open time ranges, where back-to-back bookings may share a room.

    Greedy & Intervalsintervalssweep-linesortinggreedy
  • Data Structure DesignMediumAuto-graded
    Fuse Two Sensor Pipelines Into One Object History Log

    Simulate a tracker that links IDs across two systems, stores observations, and returns time-ordered merged histories, testing union-find style grouping and operation replay.

    Data Structure Designunion-finddesignhash-mapsorting
  • Data Structure DesignMediumAuto-graded
    Alias Method Categorical Sampler

    Generate discrete random samples according to custom category weights in constant time per sample using Vose's alias algorithm.

    Data Structure Designarraysdesign-dsmath-bits
  • Arrays & HashingEasyAuto-graded
    Square Windows Containing Each Marked Cell

    Map each marked grid cell to the sorted top-left corners of all in-bounds 2x2 windows that contain it, testing coordinate arithmetic and bounds handling.

    Arrays & Hashinggridhash-mapcoordinatesenumeration
  • StringsEasyAuto-graded
    Filter Valid Credit Card Numbers

    Validate a list of card number strings against length, prefix, digit-only, and Luhn checksum requirements.

    Stringsstringsarrays
  • Linked ListsMediumAuto-graded
    Clone a Linked List with Arbitrary Jump Links

    Build an independent duplicate of a linked list whose nodes carry both a next link and an arbitrary jump link, using a serialized list-of-records format.

    Linked Listslinked-listhash-mapdeep-copypointers
  • Data Structure DesignHardAuto-graded
    State-Tracked Recipe Basket with Bulk Pricing

    Simulate a versioned basket engine that aggregates multi-recipe component quantities for bulk discount calculations, supporting mutations and rollback operations.

    Data Structure Designdesign-dsarrayshashing
  • Math & Bit ManipulationMediumAuto-graded
    Maximum Area of a Rotated Rectangle

    Find the largest surface area of any rectangle formed by four vertices chosen from a given set of 2D points.

    Math & Bit Manipulationmathgeometryhashingarrays
  • SQL & DataMediumAuto-graded
    Flag Account Takeovers: New Login Followed by a Large Transfer

    Join logins, users and transfers to flag logins from a new device or IP that are followed within two hours by a large transfer to a first-time recipient.

    SQL & Datadata-manipulationtime-windowsjoinsfraud-detection
  • Greedy & IntervalsMediumAuto-graded
    Count Total Pipeline Output Within Time Constraint

    Compute the maximum number of items processed by a sequential single-threaded worker within a total allowed time limit.

    Greedy & Intervalsgreedyarraysmath
  • Data Structure DesignMediumAuto-graded
    Sharded Order Book Simulator with Cancel and Open Lookup

    Simulate a sharded order book that routes users with FNV-1a, enforces a one-way status lifecycle, and answers per-user open-order queries in placement order.

    Data Structure Designhash-mapsimulationstate-machinehashing
  • Heaps, Sorting & SearchHardAuto-graded
    Ranked Element Selection and Common Entry Count in Sorted Arrays

    Find the k-th smallest element across two sorted arrays and count their unique shared elements efficiently.

    Heaps, Sorting & Searchheaps-sortingarraysbinary-search
  • Data Structure DesignMediumAuto-graded
    Rolling Read/Write Rate Tracker for an In-Memory Dictionary Store

    Simulate a key-value store that logs reads and writes with timestamps and answers per-second average rate queries over trailing windows, using compact time buckets.

    Data Structure Designdesignsliding-windowdequehash-map
  • Data Structure DesignMediumAuto-graded
    Multi-Channel Message Router with Pluggable Responders

    Simulate a command-driven chat engine that dispatches messages to registered responders, keeps per-channel logs and per-responder state, and returns the resulting logs.

    Data Structure Designdesignsimulationoophash-map
  • Data Structure DesignMediumAuto-graded
    Risk-Ranked Alert Queue Simulator

    Simulate a priority queue of alerts that serves the highest risk first and the oldest first on ties, driven by a list of Put and GetNext commands.

    Data Structure Designpriority-queueheapdesignsimulation
  • Arrays & HashingEasyAuto-graded
    Screening a Vendor Identity-Check Response

    Validate a nested vendor response with strict type checks, then apply ordered business rules to return the first failing reason code.

    Arrays & Hashingvalidationhash-maptype-checkingsimulation
  • Math & Bit ManipulationEasyAuto-graded
    Min Comparisons to Determine Top Two Elements

    Calculate the theoretical minimum number of comparisons needed in the worst case to locate both the largest and second-largest elements among N items.

    Math & Bit Manipulationmathsortingalgorithms
  • Arrays & HashingMediumAuto-graded
    Next Lexicographic Ordering Plus Left-to-Right Calculator

    Rearrange an array in place into its next lexicographic ordering, and evaluate a parenthesis-free arithmetic string with truncating division, both in linear time.

    Arrays & Hashingnext-permutationtwo-pointersexpression-parsingin-place
  • StringsEasyAuto-graded
    Parse Hex Color Code to ARGB Integer

    Parse a hex color string (6 or 8 characters) into a 32-bit ARGB packed integer, returning a fallback on invalid input.

    Stringsstringsparsingmath-bits
  • Data Structure DesignHardAuto-graded
    Simulate a Time-Aware Financial Ledger

    Process sequential financial operations with scheduled transfers, account merging, historical snapshot queries, and activity rankings using heaps and binary search.

    Data Structure Designdesign-dsheaps-sortingarrays