热门面试题与答案和在线测试
面向面试准备、在线测试、教程与实战练习的学习平台

通过聚焦学习路径、模拟测试和面试实战内容持续提升技能。

WithoutBook 将分主题面试题、在线练习测试、教程和对比指南整合到一个响应式学习空间中。

面试准备

模拟考试

设为首页

收藏此页面

订阅邮箱地址
首页 / 面试主题 / Linked List
WithoutBook LIVE 模拟面试 Linked List 相关面试主题: 74

面试题与答案

了解热门 Linked List 面试题与答案,帮助应届生和有经验的候选人为求职面试做好准备。

共 15 道题 面试题与答案

面试前建议观看的最佳 LIVE 模拟面试

了解热门 Linked List 面试题与答案,帮助应届生和有经验的候选人为求职面试做好准备。

面试题与答案

搜索问题以查看答案。

应届生 / 初级级别面试题与答案

问题 1

Find the kth to last element of a singly linked list.

Use two pointers; one moves k nodes into the list, and then both iterate until the second one reaches the end.

Example:

Input: 1 -> 2 -> 3 -> 4 -> 5, k = 2
Output: 4
保存以便复习

保存以便复习

收藏此条目、标记为困难题,或将其加入复习集合。

打开我的学习资料库
这有帮助吗?
添加评论 查看评论
问题 2

Remove duplicates from an unsorted linked list.

Use a hash set to keep track of unique elements while traversing the list.

Example:

Input: 1 -> 2 -> 2 -> 3 -> 4 -> 4 -> 5
Output: 1 -> 2 -> 3 -> 4 -> 5
保存以便复习

保存以便复习

收藏此条目、标记为困难题,或将其加入复习集合。

打开我的学习资料库
这有帮助吗?
添加评论 查看评论
问题 3

Write a function to find the middle element of a linked list.

Use two pointers; one moves one step at a time, and the other moves two steps at a time.

Example:

Input: 1 -> 2 -> 3 -> 4 -> 5
Output: 3
保存以便复习

保存以便复习

收藏此条目、标记为困难题,或将其加入复习集合。

打开我的学习资料库
这有帮助吗?
添加评论 查看评论

中级 / 1 到 5 年经验级别面试题与答案

问题 4

Implement a function to reverse a singly linked list.

To reverse a linked list, you can iterate through the list and reverse the direction of pointers.

Example:

Input: 1 -> 2 -> 3 -> 4 -> 5
Output: 5 -> 4 -> 3 -> 2 -> 1
保存以便复习

保存以便复习

收藏此条目、标记为困难题,或将其加入复习集合。

打开我的学习资料库
这有帮助吗?
添加评论 查看评论
问题 5

Detect a cycle in a linked list.

You can use Floyd's cycle-finding algorithm, also known as the 'tortoise and hare' algorithm.

Example:

Input: 1 -> 2 -> 3 -> 4 -> 5 -> 2 (cycle)
Output: True
保存以便复习

保存以便复习

收藏此条目、标记为困难题,或将其加入复习集合。

打开我的学习资料库
这有帮助吗?
添加评论 查看评论
问题 6

Merge two sorted linked lists into a single sorted list.

Traverse both lists simultaneously, compare elements, and merge them into a new sorted list.

Example:

Input: List1: 1 -> 3 -> 5, List2: 2 -> 4 -> 6
Output: 1 -> 2 -> 3 -> 4 -> 5 -> 6
保存以便复习

保存以便复习

收藏此条目、标记为困难题,或将其加入复习集合。

打开我的学习资料库
这有帮助吗?
添加评论 查看评论
问题 7

Check if a linked list is a palindrome.

Reverse the second half of the list and compare it with the first half.

Example:

Input: 1 -> 2 -> 3 -> 2 -> 1
Output: True
保存以便复习

保存以便复习

收藏此条目、标记为困难题,或将其加入复习集合。

打开我的学习资料库
这有帮助吗?
添加评论 查看评论
问题 8

Swap nodes in pairs in a linked list.

Iterate through the list and swap each pair of adjacent nodes.

Example:

Input: 1 -> 2 -> 3 -> 4
Output: 2 -> 1 -> 4 -> 3
保存以便复习

保存以便复习

收藏此条目、标记为困难题,或将其加入复习集合。

打开我的学习资料库
这有帮助吗?
添加评论 查看评论
问题 9

Rotate a linked list by k places.

Find the length of the list, then move (length - k % length) steps to the right.

Example:

Input: 1 -> 2 -> 3 -> 4 -> 5, k = 2
Output: 4 -> 5 -> 1 -> 2 -> 3
保存以便复习

保存以便复习

收藏此条目、标记为困难题,或将其加入复习集合。

打开我的学习资料库
这有帮助吗?
添加评论 查看评论
问题 10

Detect the intersection point of two linked lists.

Find the lengths of both lists, move the longer list's pointer ahead, and then iterate to find the intersection.

Example:

Input: List1: 1 -> 2 -> 3, List2: 6 -> 5 -> 2 -> 3
Output: Node with value 2
保存以便复习

保存以便复习

收藏此条目、标记为困难题,或将其加入复习集合。

打开我的学习资料库
这有帮助吗?
添加评论 查看评论

资深 / 专家级别面试题与答案

问题 11

Implement a function to add two numbers represented by linked lists.

Traverse both lists simultaneously, perform addition, and handle carry.

Example:

Input: (7 -> 2 -> 4) + (5 -> 6 -> 4)
Output: 2 -> 9 -> 8
保存以便复习

保存以便复习

收藏此条目、标记为困难题,或将其加入复习集合。

打开我的学习资料库
这有帮助吗?
添加评论 查看评论
问题 12

Clone a linked list with next and random pointers.

Create a copy of each node and link the copies, then separate the original and cloned lists.

Example:

Input: 1 -> 2 -> 3 -> 4
Output: 1' -> 2' -> 3' -> 4'
保存以便复习

保存以便复习

收藏此条目、标记为困难题,或将其加入复习集合。

打开我的学习资料库
这有帮助吗?
添加评论 查看评论
问题 13

Flatten a multilevel doubly linked list.

Use recursion to flatten each level and connect the flattened levels.

Example:

Input: 1 <-> 2 <-> 3 <-> 7 <-> 8 <-> 11 <-> 4 <-> 9 <-> 12
Output: 1 <-> 2 <-> 3 <-> 4 <-> 7 <-> 8 <-> 9 <-> 11 <-> 12
保存以便复习

保存以便复习

收藏此条目、标记为困难题,或将其加入复习集合。

打开我的学习资料库
这有帮助吗?
添加评论 查看评论
问题 14

Implement LRU (Least Recently Used) Cache using a linked list.

Maintain a doubly linked list to represent usage order and a hash map for quick access.

Example:

Cache capacity = 3
Operations: Get(2), Put(2, 6), Get(1), Put(1, 5), Put(1, 2)
Output: 6, 5, 2
保存以便复习

保存以便复习

收藏此条目、标记为困难题,或将其加入复习集合。

打开我的学习资料库
这有帮助吗?
添加评论 查看评论
问题 15

Reverse nodes in k-group in a linked list.

Reverse k nodes at a time, and connect the reversed groups.

Example:

Input: 1 -> 2 -> 3 -> 4 -> 5, k = 2
Output: 2 -> 1 -> 4 -> 3 -> 5
保存以便复习

保存以便复习

收藏此条目、标记为困难题,或将其加入复习集合。

打开我的学习资料库
这有帮助吗?
添加评论 查看评论

用户评价最有帮助的内容:

版权所有 © 2026,WithoutBook。