题库chevron_right分类chevron_right设计
architecture

设计

94 道题目
简单: 10中等: 60困难: 24

设计 是技术面试里最常出现的能力维度之一。建议先掌握基础题型的边界处理,再逐步过渡到模式识别和复杂度 trade-off。

面试场景

高频考察问题建模、边界条件与口头表达的清晰度。

常见误区

只背模板不解释为什么,容易在追问里失分。

练习策略

每轮练 3-5 题,固定复盘复杂度和可替代解法。

推荐练习顺序

题库

设计 题库

先展示一段最适合快速浏览的题目列表,继续滚动时再慢慢续载,避免专题页被长列表一下子拉穿。

慢加载专题题库

适合这类题很多的专题,先扫结构,再逐步深入。

hourglass_bottom滚动续载
search
tune难度

当前展示 24 / 94 道题目

每次续载 24 题
#题目难度
146

LRU 缓存

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

中等
155

最小栈

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

中等
173

二叉搜索树迭代器

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

中等
208

实现 Trie (前缀树)

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

中等
211

添加与搜索单词 - 数据结构设计

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

中等
225

用队列实现栈

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

简单
232

用栈实现队列

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

简单
284

窥视迭代器

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

中等
295

数据流的中位数

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

困难
297

二叉树的序列化与反序列化

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

困难
303

区域和检索 - 数组不可变

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

简单
304

二维区域和检索 - 矩阵不可变

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

中等
307

区域和检索 - 数组可修改

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

中等
341

扁平化嵌套列表迭代器

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

中等
352

将数据流变为多个不相交区间

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

困难
355

设计推特

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

中等
380

O(1) 时间插入、删除和获取随机元素

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

中等
381

O(1) 时间插入、删除和获取随机元素 - 允许重复

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

困难
384

打乱数组

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

中等
432

全 O(1) 的数据结构

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

困难
449

序列化和反序列化二叉搜索树

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

中等
460

LFU 缓存

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

困难
535

TinyURL 的加密与解密

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

中等
622

设计循环队列

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

中等

swap_vert在题库框内继续向下滚动,也会自动续载

关联高频模式

LeetCode 设计题型题解:94题训练路线