LeetCodechevron_rightCategorieschevron_rightdesign
architecture

design

94 problems
Easy: 10Medium: 60Hard: 24

design is one of the most repeated interview dimensions. Start with edge-safe fundamentals, then move into pattern-level trade-offs.

Interview Signal

Frequently tests problem modeling, edge handling, and verbal clarity.

Common Pitfall

Template-only answers break under follow-up questioning.

Practice Strategy

Practice in 3-5 problem rounds and always review complexity alternatives.

Recommended Progression

#TitleDifficulty
146

LRU Cache

Implement an efficient LRU Cache using hash table and doubly-linked list to achieve O(1) operations for get and put.

Medium
155

Min Stack

Design a stack with O(1) operations to push, pop, retrieve the top element, and get the minimum element in constant time…

Medium
173

Binary Search Tree Iterator

Implement an iterator for in-order traversal of a binary search tree (BST), maintaining traversal state with stack-based…

Medium
208

Implement Trie (Prefix Tree)

This problem requires designing a Trie (Prefix Tree) to efficiently store and query strings using hash table concepts fo…

Medium
211

Design Add and Search Words Data Structure

Build a WordDictionary supporting dynamic word addition and search with wildcard matching efficiently using Trie and DFS…

Medium
225

Implement Stack using Queues

This problem tests your ability to simulate a LIFO stack using two queues while preserving all standard stack operations…

Easy
232

Implement Queue using Stacks

Implement a queue using two stacks, focusing on stack-based state management to achieve FIFO behavior in a queue.

Easy
284

Peeking Iterator

Design an iterator with peek functionality, adding to the standard next and hasNext operations for efficient element acc…

Medium
295

Find Median from Data Stream

Implement a MedianFinder class that supports adding numbers and finding the median from a data stream.

Hard
297

Serialize and Deserialize Binary Tree

This problem asks to serialize and deserialize a binary tree, requiring an efficient approach to handle traversal and st…

Hard
303

Range Sum Query - Immutable

The Range Sum Query - Immutable problem involves implementing a data structure to handle range sum queries efficiently.

Easy
304

Range Sum Query 2D - Immutable

Design a 2D matrix class that efficiently handles sum queries with O(1) time complexity using a prefix sum approach.

Medium
307

Range Sum Query - Mutable

Implement a mutable range sum query using efficient design patterns to handle multiple updates and range sum queries.

Medium
341

Flatten Nested List Iterator

Implement an iterator to flatten a nested list of integers, accounting for potential nesting levels.

Medium
352

Data Stream as Disjoint Intervals

The problem involves designing a class to summarize a data stream of non-negative integers as disjoint intervals using b…

Hard
355

Design Twitter

Design Twitter requires implementing post, follow, unfollow, and news feed retrieval using linked-list pointer manipulat…

Medium
380

Insert Delete GetRandom O(1)

Implement a data structure supporting insert, delete, and getRandom in average O(1) using array plus hash mapping.

Medium
381

Insert Delete GetRandom O(1) - Duplicates allowed

This problem challenges you to design a data structure that supports insertion, removal, and random access with O(1) tim…

Hard
384

Shuffle an Array

Shuffle an Array requires designing a class to randomly permute an integer array while ensuring all permutations are equ…

Medium
432

All O`one Data Structure

Implement a data structure that tracks string counts and retrieves max or min keys efficiently in constant time.

Hard
449

Serialize and Deserialize BST

Design an algorithm to serialize and deserialize a binary search tree with efficient traversal and state tracking.

Medium
460

LFU Cache

Implement an LFU Cache using linked-list pointer manipulation with constant-time get and put operations for interview sc…

Hard
535

Encode and Decode TinyURL

Design a class that encodes and decodes URLs using a URL shortening approach based on hash tables and strings.

Medium
622

Design Circular Queue

Design a circular queue that allows efficient FIFO operations using linked-list pointer manipulation to optimize space u…

Medium
641

Design Circular Deque

Design and implement a circular deque using linked-list pointer manipulation, ensuring efficient insertion and deletion …

Medium
676

Implement Magic Dictionary

Design a Magic Dictionary to allow searching with one-character modifications, using Hash Table and String techniques.

Medium
677

Map Sum Pairs

Design and implement a data structure that supports efficient insertion and sum queries based on string prefixes.

Medium
703

Kth Largest Element in a Stream

Find the kth largest element in a dynamic stream using binary-tree traversal and efficient state tracking with a min-hea…

Easy
705

Design HashSet

Implement a custom HashSet without built-in libraries using array scanning and hash lookup for efficient membership chec…

Easy
706

Design HashMap

Implement a custom HashMap from scratch using array scanning and hash lookup without built-in libraries for efficient ke…

Easy
707

Design Linked List

Implement a custom linked list supporting head, tail, index insertions, retrieval, and deletions efficiently with pointe…

Medium
715

Range Module

Design a RangeModule to track and query half-open intervals using segment trees or ordered sets.

Hard
729

My Calendar I

Implement a calendar supporting non-overlapping event bookings using binary search for efficient insertion and conflict …

Medium
731

My Calendar II

Implement a calendar that allows double bookings but prevents triple bookings, managing overlapping intervals efficientl…

Medium
732

My Calendar III

Implement My Calendar III to track maximum overlapping events efficiently using binary search and segment tree technique…

Hard
745

Prefix and Suffix Search

Design a dictionary to search words by both prefix and suffix using a Trie structure and hash lookups.

Hard
855

Exam Room

Simulate an exam room where each student chooses a seat maximizing distance to others, using design plus heap structures…

Medium
895

Maximum Frequency Stack

Design a stack-like data structure to manage elements and handle frequent stack operations, including popping the most f…

Hard
900

RLE Iterator

Design an efficient iterator for a run-length encoded array, handling large counts and sequential access correctly every…

Medium
901

Online Stock Span

Design an efficient algorithm using stacks to calculate the stock span for daily price quotes.

Medium
911

Online Election

Solve the Online Election problem by implementing a class that tracks votes and queries the leading candidate at any giv…

Medium
919

Complete Binary Tree Inserter

Implement a data structure to insert nodes into a complete binary tree while preserving its completeness efficiently.

Medium
933

Number of Recent Calls

The "Number of Recent Calls" problem involves designing a class to efficiently track recent requests within a time windo…

Easy
981

Time Based Key-Value Store

Implement a time-based key-value store that retrieves the latest value at a given timestamp using efficient binary searc…

Medium
1032

Stream of Characters

Implement a StreamChecker that detects if any suffix of a character stream matches a given list of words using efficient…

Hard
1146

Snapshot Array

Implement a SnapshotArray that efficiently tracks element changes and retrieves past states using array scanning and has…

Medium
1157

Online Majority Element In Subarray

Efficiently find the majority element in any subarray using a data structure optimized for multiple range queries.

Hard
1172

Dinner Plate Stacks

Design a system that manages dinner plate stacks using stack-based state management, handling dynamic plate placement an…

Hard
1206

Design Skiplist

Implement a Skiplist efficiently using linked-list pointer manipulation to support search, add, and erase operations in …

Hard
1261

Find Elements in a Contaminated Binary Tree

Recover values in a contaminated binary tree and efficiently check for existence using traversal and state tracking tech…

Medium
1286

Iterator for Combination

Implement an iterator that generates all combinations of a given length using efficient backtracking with pruning.

Medium
1348

Tweet Counts Per Frequency

Design an efficient solution to track and retrieve tweet counts over different frequencies using binary search and hash …

Medium
1352

Product of the Last K Numbers

Design a data structure to efficiently return the product of the last k numbers in a dynamic integer stream using prefix…

Medium
1357

Apply Discount Every n Orders

Compute customer bills with periodic discounts efficiently using array scanning and hash mapping for fast product price …

Medium
1381

Design a Stack With Increment Operation

Implement a stack that supports push, pop, and targeted increment operations efficiently using array-based state managem…

Medium
1396

Design Underground System

Design an underground system to calculate travel times between stations using hash tables for efficient lookups and aver…

Medium
1472

Design Browser History

Implement a browser history tracker with back, forward, and visit operations using linked-list pointer manipulation effi…

Medium
1476

Subrectangle Queries

Implement the SubrectangleQueries class to handle dynamic updates and value queries on a 2D rectangle.

Medium
1483

Kth Ancestor of a Tree Node

Find the kth ancestor of any node in a tree using efficient binary-tree traversal and dynamic state tracking methods.

Hard
1600

Throne Inheritance

Throne Inheritance requires modeling a dynamic family tree with births and deaths to determine the kingdom's inheritance…

Medium
1603

Design Parking System

Implement a class to manage a parking lot with fixed slots for big, medium, and small cars, tracking occupancy efficient…

Easy
1622

Fancy Sequence

Implement a Fancy sequence supporting append, addAll, and multAll operations efficiently using cumulative math design te…

Hard
1656

Design an Ordered Stream

Design an Ordered Stream that returns values in increasing order based on unique integer IDs with efficient insertion an…

Easy
1670

Design Front Middle Back Queue

Implement a queue that efficiently handles push and pop operations at the front, middle, and back using pointer manipula…

Medium
1797

Design Authentication Manager

Implement an AuthenticationManager using linked-list pointer manipulation and a hash map to track token expirations effi…

Medium
1825

Finding MK Average

Find the MKAverage of a stream of integers using a queue-driven approach with efficient state management.

Hard
1845

Seat Reservation Manager

Manage seat reservations efficiently using a design combining priority queue to always return the lowest available seat …

Medium
1865

Finding Pairs With a Certain Sum

Efficiently track and count pairs across two arrays using array scanning plus hash lookup to support dynamic updates.

Medium
1912

Design Movie Rental System

Implement a movie rental system with efficient search, rent, drop, and report operations using arrays and hash lookups.

Hard
1993

Operations on Tree

Design a tree data structure that allows locking, unlocking, and upgrading nodes with user-specific actions.

Medium
2013

Detect Squares

Detect Squares requires tracking points on a 2D plane to quickly count all possible axis-aligned squares using efficient…

Medium
2034

Stock Price Fluctuation

Design an efficient algorithm for managing stock price fluctuations with incorrect and unordered data in a data stream.

Medium
2043

Simple Bank System

Design a simple bank system that processes transactions like withdrawals, deposits, and transfers while managing account…

Medium
2069

Walking Robot Simulation II

The Walking Robot Simulation II problem challenges you to simulate robot movements and track its position and direction …

Medium
2080

Range Frequency Queries

Design a data structure to handle efficient frequency queries for subarrays, focusing on hash-based lookups and efficien…

Medium
2102

Sequentially Ordinal Rank Tracker

Track rankings of locations with names and scores, adding new locations and retrieving top-ranked ones efficiently.

Hard
2166

Design Bitset

Master the Design Bitset problem by efficiently managing bit flips, counts, and indexed updates with array and hash look…

Medium
2227

Encrypt and Decrypt Strings

The 'Encrypt and Decrypt Strings' problem involves creating a data structure that can encrypt and decrypt strings using …

Hard
2241

Design an ATM Machine

Design an ATM machine that stores and withdraws money with given denominations and prioritizes larger values during with…

Medium
2276

Count Integers in Intervals

Design and implement a data structure to efficiently add intervals and count the total number of integers covered by the…

Hard
2286

Booking Concert Tickets in Groups

Design a ticketing system to allocate concert seats in specific groupings while efficiently handling seat reservations.

Hard
2296

Design a Text Editor

Design a text editor that supports text manipulation and cursor navigation operations efficiently with linked-list-based…

Hard
2336

Smallest Number in Infinite Set

Design a data structure to handle the smallest missing element in an infinite set, with the ability to add and remove el…

Medium
2349

Design a Number Container System

Learn to implement a Number Container System using hash tables and design techniques to efficiently track numbers and in…

Medium
2353

Design a Food Rating System

Design a food rating system that tracks and updates ratings of foods, finding the highest rated items by cuisine.

Medium
2424

Longest Uploaded Prefix

Calculate the longest continuous uploaded prefix in a video stream efficiently using a mix of binary search and data str…

Medium
2502

Design Memory Allocator

Design a memory allocator that simulates allocation and deallocation of memory blocks.

Medium
2526

Find Consecutive Integers from a Data Stream

Design a data stream checker to identify consecutive integers from a stream, focusing on handling state transitions effi…

Medium
2642

Design Graph With Shortest Path Calculator

Implement a dynamic weighted directed graph with efficient shortest path queries and edge additions in real time.

Hard
2671

Frequency Tracker

Design a data structure to track values and answer frequency-related queries efficiently using hash tables.

Medium
3242

Design Neighbor Sum Service

Design a service that computes sums for adjacent and diagonal elements in a 2D grid.

Easy
3408

Design Task Manager

Design a Task Manager that can efficiently handle task management operations such as adding, editing, executing, and rem…

Medium
3484

Design Spreadsheet

Design a spreadsheet that supports setting, retrieving, and resetting values, with the ability to handle formulas refere…

Medium
3508

Implement Router

Efficiently design a Router class to manage network packets with memory limits using array scanning and hash lookups.

Medium

Related Patterns

Design LeetCode Problems: 94 Solutions