KatInterview

Topic

Data Structure Design interview problems

Caches, iterators, rate limiters and custom containers. 737 original problems, each with hidden test cases you can run in the browser.

Problems737

53 easy587 medium97 hard

Showing 661–690 of 737 results

  • Create a left-to-right function compositor and a mixin class that serializes object attributes to JSON with configurable privacy filtering.

    Model answerpythonclosuresmetaprogrammingserialization
  • Implement a service that models recipes with nested dependencies, validates acyclic graphs, and atomically decrements raw inventory when orders succeed.

    Model answerobject-oriented-designgraph-validationatomicityconcurrency
  • Evaluates ability to implement a complete binary min-heap using array indexing, bubble-up, and bubble-down operations without library support.

    Auto-gradedheaps-sortingarraysdata-structures
  • Implement an in-memory system that handles user registration, friendship management, and peer-to-peer money transfers with proper validation.

    Model answerobject-oriented-designhash-tablesstate-management
  • Design and implement a class that tracks board state, validates moves, detects winners, and enforces turn-based gameplay for a 3×3 grid game.

    Model answerstate-machinegame-logicobject-oriented-design
  • Tests stateful simulation with resource tracking, discount accumulation, and transactional updates.

    Auto-gradedsimulationstate-managementhash-map
  • Design an in-memory playlist that always serves the highest-scored unseen item per round, supports live score changes, and is safe for concurrent callers.

    Model answerheaptreemapconcurrencydata-structure-design
  • Design a structure that efficiently identifies the first integer appearing exactly once in a dynamic sequence of integers.

    Auto-gradedqueuehash-tabledata-structure-design
  • Tests array merging from the back, queue-based task scheduling with time slices, and price-level order matching in a simulated trading book.

    Auto-gradedarraysqueuessimulation
  • Tests in-memory data modeling, time-based state management, priority queuing, and handling overlapping task assignments with TTL semantics.

    Auto-gradedobject-oriented-designtime-based-logicdata-structures
  • Tests whether a candidate can implement a fixed-memory sliding-window counter using a circular array of timestamped buckets with O(1) writes and O(W) reads.

    Auto-gradedsliding-windowring-bufferdata-structure-design
  • Tests ability to design an in-memory key-value store with flexible schemas, column-based retrieval, and multi-field filtering logic.

    Auto-gradedhash-tablesindexingdata-structures
  • Design data structures and algorithms to query restaurants by price and distance, then compute order statistics and rankings over time windows.

    Model answerdata-structuresalgorithmstime-seriesheap
  • Create a service that stores meal records with auto-incrementing IDs, normalized fields, atomic modifications, and filtered search with multiple sort orders.

    Model answerdata-structuresstate-managementindexingnormalization
  • Build a credit tracking system where allocations expire, spending prioritizes earliest expiration, and operations arrive out of chronological order.

    Model answerheaptime-orderingdata-structure-design
  • Build malloc and free over a fixed byte array, comparing allocation strategies and analyzing fragmentation trade-offs.

    Model answermemory-managementdata-structurescomplexity-analysis
  • Design an immutable, thread-safe game engine with pluggable validation rules for a turn-based strategy game.

    Model answerobject-oriented-designimmutabilitystrategy-patternconcurrency
  • Tests understanding of tries and the insight that suffix matching becomes prefix matching when strings are reversed.

    Auto-gradedtriestring-matchingdata-structures
  • Tests your ability to implement layered state management with nested scopes, tombstone deletion tracking, and atomic commit/rollback semantics.

    Auto-gradedhash-tablestackstate-management
  • Tests efficient implementation of a mutable text buffer with insertion, deletion, and bidirectional cursor movement using dual-stack architecture.

    Auto-gradedstacksstring-manipulationsimulation
  • Build a binary encoder and decoder for string dictionaries with strict validation of format integrity, size bounds, and key ordering.

    Model answerserializationbinary-protocolsvalidationdata-structures
  • Implement directory creation and listing for an in-memory hierarchical structure with automatic parent creation and path normalization.

    Model answertreetriepath-parsingstring-manipulation
  • Design and implement a tree-based in-memory filesystem supporting directory creation, file I/O, listing, and deletion via absolute paths.

    Auto-gradedtreeshash-tablesdata-structure-designpath-traversal
  • Tests precise deque-plus-set simulation of a growing worm on a grid, including the exact ordering of tail removal and collision detection.

    Auto-gradedsimulationdequehash-set
  • Build an ad matcher with inverted indexes and a delivery router using shortest-path precomputation plus TSP heuristics.

    Model answerindexinggraphsoptimizationtrade-offs
  • Design and implement a concurrent key-value store that supports optional per-entry expiration, lazy eviction, and background memory reclamation.

    Model answerconcurrencyttlheapeviction
  • Build a Python query builder that chains table, select, where, alias, and join methods, rendering to SQL strings that match an exact expected format.

    Model answerapi-designfluent-interfacesql-generation
  • Build a request throttler that drains at a fixed rate, accepting requests only when space exists, first single-threaded then thread-safe.

    Model answerrate-limitingconcurrencytime-based-statetesting
  • Build an efficient query system over sorted violation records supporting policy lookups, post lookups, and time-based aggregations using indexing and binary search.

    Auto-gradedhash-mapbinary-searchindexing
  • Build a memory-efficient representation for sparse matrices and implement addition, multiplication, and display operations.

    Model answersparse-matrixdictionarymatrix-operations

More topics