Linked Lists, Stacks and Queues Interview Questions for Data Structures and Algorithms
25 Linked Lists, Stacks and Queues questions with answers for data structures and algorithms roles — 8 easy, 11 medium, 6 hard.
About Linked Lists, Stacks and Queues
Understand singly, doubly and circular linked lists, pointer manipulation, dummy nodes and Floyd's cycle detection. Learn stacks, queues, deques and circular buffers, plus monotonic stacks and deques for next greater element and sliding window maximum, and apply them to undo features, schedulers and rate limiters.
Compare singly, doubly and circular linked lists.
Show answer
What is a stack and where is it used?
Show answer
What are a queue, a deque and a circular queue?
Show answer
How would you implement browser back and forward navigation?
Show answer
Users enter formulas with brackets in a spreadsheet tool. How do you validate that the brackets are balanced?
Show answer
Merge two sorted linked lists into one sorted list.
Show answer
Check whether a string of brackets is valid.
Show answer
How does Floyd's cycle detection algorithm work and why is it correct?
Show answer
What is a monotonic stack and which problems does it solve?
Show answer
How can you implement a queue using two stacks, and what is its complexity?
Show answer
What is a dummy or sentinel node and why is it useful in linked list problems?
Show answer
You are building undo and redo for a text editor. Which data structures would you use?
Show answer
Design a simple scheduler that gives each job a fixed time slice in turn.
Show answer
A trading application needs a stack that also returns the current minimum in O(1). How would you design it?
Show answer
Detect whether a linked list has a cycle and return the node where the cycle begins.
Show answer
Find the next greater element for every element of an array.
Show answer
Tell me about a time you explained a technical idea to a non-technical person.
Show answer
Describe a team project where one member was not contributing. What did you do?
Show answer
How does a monotonic deque find the maximum of every sliding window in O(n)?
Show answer
Why are linked lists often slower than arrays in practice, and what is a skip list?
Show answer
Two linked lists merge at some node and share the rest. How do you find the merge point efficiently?
Show answer
Design a rate limiter that allows at most 100 requests per user in any rolling 60-second window.
Show answer
Reverse a linked list in groups of k nodes.
Show answer
Tell me about a time you received critical feedback on your code.
Show answer
Frequently asked questions
How important is Linked Lists, Stacks and Queues in Data Structures and Algorithms interviews?
Understand singly, doubly and circular linked lists, pointer manipulation, dummy nodes and Floyd's cycle detection. Learn stacks, queues, deques and circular buffers, plus monotonic stacks and deques for next greater element and sliding window maximum, and apply them to undo features, schedulers and rate limiters.
How should I use the Linked Lists, Stacks and Queues sheet?
Go top to bottom — easy to hard. Answer before opening each answer, tick what you solved and save misses to Last-Minute Revision.