LearnThatStack Ace your next interview
Computer Science Fundamentals

Linked Lists, Stacks & Queues.

Start free Change topic Change

Practise Linked Lists, Stacks & Queues one question at a time. Answer out loud or in writing, get graded, and see exactly what you missed.

Try one question

What is a linked list, and how does it differ from an array?

The answer

A linked list chains elements together through nodes. Each node holds a value and a pointer to the next node. The list only knows where its first node lives, so you reach any element by following pointers one hop at a time.

An array stores elements side by side in one contiguous block. That layout lets you jump straight to index 5 by arithmetic. A linked list cannot, so reaching position 5 costs O(n) hops. Arrays give O(1) random access, and linked lists give O(n).

The tradeoff flips for growth. An array has a fixed block, so growing may mean copying everything. A linked list just allocates a node and rewires a pointer. Choose based on whether you index often or reshape often.

Example · what grading looks like
What is a stack, and what does LIFO actually mean?

“A stack is a collection where you can only add or remove items at the top: you push to put something on and pop to take the top item off. LIFO means last in, first out, so the item I added most recently is the first one I get back, like taking the top plate off a pile.”

Knew it

They have push/pop at the top and LIFO nailed with a clean example. Missing the real-world tie-in, like undo history or function calls, that shows why the ordering matters.

Missed: Doesn't mention why this ordering matters in practice, like reversing or backtracking.

Missed: No mention of real applications like browser back buttons, undo, or function calls.


Get your own answers graded

Sign up free. Your account comes with 50 credits for grading, and it remembers what you missed.

What it covers

All 78 questions

Each on its own page

Linked list basics

What a node, head and tail are, singly, doubly and circular lists and what the back pointer costs, and how access, search and insertion compare with arrays.

12 questions

  1. What is a linked list, and how does it differ from an array?
  2. What is the difference between a singly and a doubly linked list?
  3. What do insertion and deletion cost in a linked list versus an array?
  4. When should you use a linked list instead of an array?
  5. How do you find the Nth element of a linked list, and what does it cost? Pro
  6. What is a node, and what does each node store in a linked list? Pro
  7. Why does a linked list keep a head pointer, and when do you add a tail? Pro
  8. What is a circular linked list, and where is it used? Pro
  9. Why is random access slow in a linked list compared to an array? Pro
  10. What does a doubly linked list's extra pointer buy you, and what does it cost? Pro
  11. How does insertion into a sorted linked list compare to a sorted array? Pro
  12. Why can't you binary search a linked list efficiently? Pro

Stack and queue basics

LIFO and FIFO, the core operations and their costs, deques and priority queues, and the everyday problems each structure fits.

10 questions

  1. What is a stack, and what does LIFO actually mean?
  2. What is a queue, and what does FIFO actually mean?
  3. What are the core operations of a stack, and what do they cost?
  4. What are the core operations of a queue, and what do they cost?
  5. What is a deque, and what can it do that a stack or queue cannot?
  6. What everyday problems do stacks naturally solve? Pro
  7. What everyday problems do queues naturally solve? Pro
  8. Why are stacks and queues defined by their operations rather than their storage? Pro
  9. What is the difference between a stack and a queue? Pro
  10. How does a priority queue differ from a plain FIFO queue? Pro

Building stacks, queues and deques

Backing stacks, queues and deques with arrays, linked lists or ring buffers, amortized growth, and building one structure from another.

11 questions

  1. How do you implement a stack, and what data structure backs it?
  2. How do you implement a queue, and what data structure backs it?
  3. When would you back a stack with an array versus a linked list? Pro
  4. When would you back a queue with an array versus a linked list? Pro
  5. Why does a naive array-backed queue waste space, and how do you fix it? Pro
  6. What is a ring buffer, and how do its head and tail wrap around? Pro
  7. How do you implement a deque so both ends stay O(1)? Pro
  8. How do you build a queue from two stacks, and what does it cost? Pro
  9. Why is push on a dynamic-array stack O(1) amortized but not worst case? Pro
  10. How do you implement a stack using queues, and what does it cost? Pro
  11. How do you implement a stack that returns its minimum in O(1)? Pro

Linked list pointer techniques

Reversal, fast and slow pointers, sentinels, splicing, deleting from a bare pointer, and the edge cases and repairs of doubly linked lists.

8 questions

  1. How does a sentinel node remove edge cases from list insertion and deletion? Pro
  2. How do you detect a cycle in a linked list, and what does the idea cost? Pro
  3. What is the idea behind reversing a linked list in place, and its cost? Pro
  4. Why is deleting a node hard when you only have a pointer to it? Pro
  5. What makes splicing or splitting linked lists cheap? Pro
  6. How do you find the middle of a linked list in one pass? Pro
  7. What edge cases must a robust doubly linked list implementation handle? Pro
  8. How do you detect and repair a corrupted or self-looping doubly linked list? Pro

Stack and queue problem patterns

Monotonic stacks and queues, sliding-window maximum, queues as the BFS frontier, and two-stack undo and redo.

5 questions

  1. What problem shape does a monotonic stack solve at the concept level? Pro
  2. What problem shape does a monotonic queue solve at the concept level? Pro
  3. Why is a queue, not a stack, the right structure for a BFS frontier? Pro
  4. How would you design an undo and redo feature, and why two stacks? Pro
  5. How do you get the maximum over a sliding window using a deque? Pro

Call stack and recursion depth

What lives in a stack frame, why stack overflows happen, and how to replace recursion with an explicit stack for deep structures.

5 questions

  1. Where does the call stack fit, and what lives in a stack frame? Pro
  2. What causes a stack overflow, and how deep can recursion go? Pro
  3. When should you replace recursion with an explicit stack? Pro
  4. How do you process a structure whose depth exceeds the stack limit? Pro
  5. How do you free a very long linked list without overflowing the call stack? Pro

Linked lists in real systems

Where linked lists earn their place: LRU caches, skip lists, intrusive lists, allocator free lists, and large-scale uses.

6 questions

  1. How do skip lists use linked lists to get faster search? Pro
  2. Why is a doubly linked list the backbone of an LRU cache? Pro
  3. How do you build a fixed-capacity LRU cache from a map and a list? Pro
  4. How do intrusive linked lists reduce allocation overhead in systems code? Pro
  5. How do memory allocators use free lists built on linked lists? Pro
  6. When is a linked list still the right choice at large scale? Pro

Memory and cache performance

Cache locality, per-node memory overhead, cache misses and fragmentation in huge lists, and layouts like unrolled and XOR-linked lists.

7 questions

  1. How does cache locality make arrays faster than linked lists in practice? Pro
  2. What is the real memory overhead of a linked list per element? Pro
  3. What cache-miss costs appear when a linked list grows to millions of nodes? Pro
  4. How does an unrolled linked list trade node count for cache performance? Pro
  5. What causes memory fragmentation in a long-lived linked list? Pro
  6. How does XOR linking halve pointer memory, and why is it rarely worth it? Pro
  7. How do you maintain a linked list of a billion nodes, and what breaks first? Pro

Concurrent stacks, queues and lists

Thread-safe and lock-free queues and stacks, blocking queues, work-stealing deques, and safe iteration of shared linked lists.

7 questions

  1. How does a work-stealing deque speed up parallel schedulers? Pro
  2. How do you make a queue thread-safe for many producers and consumers? Pro
  3. How would you design a bounded blocking queue? Pro
  4. How does a lock-free queue work, and what makes it so hard? Pro
  5. How do you make a stack thread-safe without serializing every operation? Pro
  6. How do you safely iterate a linked list while other threads mutate it? Pro
  7. What concurrency hazards come with a shared linked list, and how do you mitigate them? Pro

Queues at system scale

Backpressure and full buffers, multilevel scheduling, durable, sharded and delayed queues, and what breaks at very high throughput.

7 questions

  1. How do schedulers use multiple queues to balance fairness and priority? Pro
  2. What happens to a ring buffer when producers outrun consumers? Pro
  3. How does backpressure work when a queue fills faster than it drains? Pro
  4. How would you make a queue durable across process restarts? Pro
  5. How do you shard a queue to scale past one machine's throughput? Pro
  6. How would you design a delayed or scheduled-delivery queue? Pro
  7. What breaks first when one queue must handle a million messages a second? Pro
Practice · Questions

All questions

Showing of 78
Beginner 19
01

What is a linked list, and how does it differ from an array?

Visual

Beginner ·

Answer it yourself first - out loud, or typed below.

How should your speech become text?

Listening… your words appear above as you speak - tap Stop when you're done.

Recording · cr - tap Stop & transcribe when you're done.

Transcribing with AI…

Voice:

Keep going - a few more words and AI can grade it.

Last attempt -

Your answer

Re-explain
Visual

A linked list chains elements together through nodes. Each node holds a value and a pointer to the next node. The list only knows where its first node lives, so you reach any element by following pointers one hop at a time.

An array stores elements side by side in one contiguous block. That layout lets you jump straight to index 5 by arithmetic. A linked list cannot, so reaching position 5 costs O(n) hops. Arrays give O(1) random access, and linked lists give O(n).

The tradeoff flips for growth. An array has a fixed block, so growing may mean copying everything. A linked list just allocates a node and rewires a pointer. Choose based on whether you index often or reshape often.

Rewriting in plainer words…

This answer doesn't lend itself to a diagram - it reads best . No credits were charged.

Why there's no diagram: “”

The interactive diagram is below the answer - jump to diagram ↓ · Below it, the related concept . Jump to it ↓

Related concept

Tailored explanation · switch back to · ·
What should the new diagram focus on?
How well did you know this?
AI:

02

What is the difference between a singly and a doubly linked list?

Visual

Beginner ·

Answer it yourself first - out loud, or typed below.

How should your speech become text?

Listening… your words appear above as you speak - tap Stop when you're done.

Recording · cr - tap Stop & transcribe when you're done.

Transcribing with AI…

Voice:

Keep going - a few more words and AI can grade it.

Last attempt -

Your answer

Re-explain
Visual

A singly linked list gives each node one pointer, aimed at the next node. You can only walk forward, from the head toward the tail. To reach the previous node, you must restart from the head.

A doubly linked list adds a second pointer, aimed at the previous node. Now you can walk in both directions. Deleting a node you already hold becomes easy, since you reach its neighbor on each side directly.

That second pointer costs memory and upkeep. A million nodes carry a million more references, and each insert updates two links instead of one. Pick doubly when you delete or scan backward often, and singly when forward-only is enough.

Rewriting in plainer words…

This answer doesn't lend itself to a diagram - it reads best . No credits were charged.

Why there's no diagram: “”

The interactive diagram is below the answer - jump to diagram ↓ · Below it, the related concept . Jump to it ↓

Related concept

Tailored explanation · switch back to · ·
What should the new diagram focus on?
How well did you know this?
AI:

03

What is a stack, and what does LIFO actually mean?

Beginner ·

Answer it yourself first - out loud, or typed below.

How should your speech become text?

Listening… your words appear above as you speak - tap Stop when you're done.

Recording · cr - tap Stop & transcribe when you're done.

Transcribing with AI…

Voice:

Keep going - a few more words and AI can grade it.

Last attempt -

Your answer

Re-explain

A stack is a pile where you only touch the top. You add items on top with push and take them off the top with pop. The bottom stays untouched until everything above it leaves.

LIFO means last in, first out. The most recently added item is the first one you get back. Think of a stack of plates. You wash the last plate you set down, not the first.

This ordering matters when you must reverse or backtrack. Browser back buttons, undo history, and function calls all rely on it. The newest work gets resolved first, while older work waits underneath.

Rewriting in plainer words…

This answer doesn't lend itself to a diagram - it reads best . No credits were charged.

Why there's no diagram: “”

The interactive diagram is below the answer - jump to diagram ↓ · Below it, the related concept . Jump to it ↓

Related concept

Tailored explanation · switch back to · ·
What should the new diagram focus on?
How well did you know this?
AI:

04

What is a queue, and what does FIFO actually mean?

Beginner ·

Answer it yourself first - out loud, or typed below.

How should your speech become text?

Listening… your words appear above as you speak - tap Stop when you're done.

Recording · cr - tap Stop & transcribe when you're done.

Transcribing with AI…

Voice:

Keep going - a few more words and AI can grade it.

Last attempt -

Your answer

Re-explain

A queue is a waiting line. You add items at the back and remove them from the front. Nobody jumps ahead, so the order you arrive is the order you leave.

FIFO means first in, first out. The item that waited longest gets served next. A ticket counter works this way. The person at the front, who came earliest, is called first.

This fairness makes queues natural for scheduling and buffering. Print jobs, task runners, and message pipelines process work in arrival order. When order and fairness matter more than recency, a queue fits. It keeps the oldest waiting item from starving behind newer arrivals.

Rewriting in plainer words…

This answer doesn't lend itself to a diagram - it reads best . No credits were charged.

Why there's no diagram: “”

The interactive diagram is below the answer - jump to diagram ↓ · Below it, the related concept . Jump to it ↓

Related concept

Tailored explanation · switch back to · ·
What should the new diagram focus on?
How well did you know this?
AI:

05

What are the core operations of a stack, and what do they cost?

Beginner ·

Answer it yourself first - out loud, or typed below.

How should your speech become text?

Listening… your words appear above as you speak - tap Stop when you're done.

Recording · cr - tap Stop & transcribe when you're done.

Transcribing with AI…

Voice:

Keep going - a few more words and AI can grade it.

Last attempt -

Your answer

Re-explain

A stack offers four operations.

  • push adds an item to the top.
  • pop removes and returns the top item.
  • peek reads the top without removing it.
  • isEmpty reports whether anything is left.

Each of these costs O(1). You only ever touch one end, so nothing shifts or searches. push and pop just adjust the top position and one value. peek reads a single slot. Calling pop or peek on an empty stack is an underflow, so check isEmpty first.

That constant cost is the whole appeal. No matter how many items sit below, the top operations stay instant. This is why stacks handle deep call chains and long undo histories without slowing down.

Rewriting in plainer words…

This answer doesn't lend itself to a diagram - it reads best . No credits were charged.

Why there's no diagram: “”

The interactive diagram is below the answer - jump to diagram ↓ · Below it, the related concept . Jump to it ↓

Related concept

Tailored explanation · switch back to · ·
What should the new diagram focus on?
How well did you know this?
AI:

06

What are the core operations of a queue, and what do they cost?

Beginner ·

Answer it yourself first - out loud, or typed below.

How should your speech become text?

Listening… your words appear above as you speak - tap Stop when you're done.

Recording · cr - tap Stop & transcribe when you're done.

Transcribing with AI…

Voice:

Keep going - a few more words and AI can grade it.

Last attempt -

Your answer

Re-explain

A queue offers four operations, and every one costs O(1) when the queue is built well.

  • enqueue adds an item at the back.
  • dequeue removes and returns the item at the front.
  • front reads that front item without removing it.
  • isEmpty checks whether any items remain.

You touch only the two ends, never the middle. A good design keeps a pointer to both ends, so neither operation walks the line.

How well it is built depends on the storage. A careless array-backed queue can drift or need shifting. Keeping both ends O(1) takes a ring buffer or a linked list.

Rewriting in plainer words…

This answer doesn't lend itself to a diagram - it reads best . No credits were charged.

Why there's no diagram: “”

The interactive diagram is below the answer - jump to diagram ↓ · Below it, the related concept . Jump to it ↓

Related concept

Tailored explanation · switch back to · ·
What should the new diagram focus on?
How well did you know this?
AI:

07

What do insertion and deletion cost in a linked list versus an array?

Visual

Beginner ·

Answer it yourself first - out loud, or typed below.

How should your speech become text?

Listening… your words appear above as you speak - tap Stop when you're done.

Recording · cr - tap Stop & transcribe when you're done.

Transcribing with AI…

Voice:

Keep going - a few more words and AI can grade it.

Last attempt -

Your answer

Re-explain
Visual

Inserting or deleting in a linked list costs O(1) once you hold the right node. You rewire a pointer or two and you are done. Nothing else moves, and the rest of the list stays where it sat.

An array behaves differently. To insert or delete in the middle, you must shift every later element over one slot. That shift costs O(n). Only changes at the very end avoid it.

The catch is reaching the node. The linked list is O(1) only after you get there, and finding it first still costs O(n) hops. Arrays trade cheap access for expensive reshaping, and linked lists do the reverse.

Rewriting in plainer words…

This answer doesn't lend itself to a diagram - it reads best . No credits were charged.

Why there's no diagram: “”

The interactive diagram is below the answer - jump to diagram ↓ · Below it, the related concept . Jump to it ↓

Related concept

Tailored explanation · switch back to · ·
What should the new diagram focus on?
How well did you know this?
AI:

08

When should you use a linked list instead of an array?

Beginner ·

Answer it yourself first - out loud, or typed below.

How should your speech become text?

Listening… your words appear above as you speak - tap Stop when you're done.

Recording · cr - tap Stop & transcribe when you're done.

Transcribing with AI…

Voice:

Keep going - a few more words and AI can grade it.

Last attempt -

Your answer

Re-explain

Reach for a linked list when you reshape more than you index. If you constantly insert and remove at points you already hold, its O(1) splicing wins. Queues, playlists, and edit histories fit this shape.

It also helps when size is unpredictable. A linked list grows one node at a time, with no big block to reserve or copy. You never pay a resize that duplicates the whole collection.

Skip it when you need fast access by position. Arrays give O(1) indexing and pack tightly in memory, so the processor's cache serves them quickly. If you mostly read by index, an array almost always wins.

Rewriting in plainer words…

This answer doesn't lend itself to a diagram - it reads best . No credits were charged.

Why there's no diagram: “”

The interactive diagram is below the answer - jump to diagram ↓ · Below it, the related concept . Jump to it ↓

Related concept

Tailored explanation · switch back to · ·
What should the new diagram focus on?
How well did you know this?
AI:

09

What is a deque, and what can it do that a stack or queue cannot?

Beginner ·

Answer it yourself first - out loud, or typed below.

How should your speech become text?

Listening… your words appear above as you speak - tap Stop when you're done.

Recording · cr - tap Stop & transcribe when you're done.

Transcribing with AI…

Voice:

Keep going - a few more words and AI can grade it.

Last attempt -

Your answer

Re-explain

A deque, short for double-ended queue, lets you add and remove at both ends. Push and pop work on the front and on the back. It is a queue and a stack fused into one structure.

That is exactly what a plain stack or queue cannot do. A stack only touches one end. A queue adds at one end and removes at the other. Neither gives you free access to both ends at once.

This both-end access shows up in real work. Sliding-window scans, work-stealing schedulers, and browser history all rely on it. When a single end is not enough, a deque is the natural next step.

Rewriting in plainer words…

This answer doesn't lend itself to a diagram - it reads best . No credits were charged.

Why there's no diagram: “”

The interactive diagram is below the answer - jump to diagram ↓ · Below it, the related concept . Jump to it ↓

Related concept

Tailored explanation · switch back to · ·
What should the new diagram focus on?
How well did you know this?
AI:

10

How do you implement a stack, and what data structure backs it?

Beginner ·

Answer it yourself first - out loud, or typed below.

How should your speech become text?

Listening… your words appear above as you speak - tap Stop when you're done.

Recording · cr - tap Stop & transcribe when you're done.

Transcribing with AI…

Voice:

Keep going - a few more words and AI can grade it.

Last attempt -

Your answer

Re-explain

You can build a stack on an array or on a linked list. Both keep push and pop at O(1). The choice mostly changes memory behavior, not the contract callers see.

With an array, you track the top index. push writes at that index and bumps it. pop reads and steps back. The array grows when full, occasionally copying everything to a bigger block.

With a linked list, the head node is the top. push adds a new head, and pop unlinks it. No copying ever happens, but each node costs an extra pointer.

stack.push(4); // top is now 4
stack.pop();   // returns 4, top restored

Most languages hand you a ready stack through their dynamic array type. Reach for that first.

Rewriting in plainer words…

This answer doesn't lend itself to a diagram - it reads best . No credits were charged.

Why there's no diagram: “”

The interactive diagram is below the answer - jump to diagram ↓ · Below it, the related concept . Jump to it ↓

Related concept

Tailored explanation · switch back to · ·
What should the new diagram focus on?
How well did you know this?
AI:

11

How do you implement a queue, and what data structure backs it?

Beginner ·

Answer it yourself first - out loud, or typed below.

How should your speech become text?

Listening… your words appear above as you speak - tap Stop when you're done.

Recording · cr - tap Stop & transcribe when you're done.

Transcribing with AI…

Voice:

Keep going - a few more words and AI can grade it.

Last attempt -

Your answer

Re-explain

A queue needs two access points, one end to add and another to remove. You back it with either a linked list holding head and tail pointers, or a ring buffer over a fixed array.

With a linked list, you enqueue at the tail and dequeue at the head, both O(1). The tail pointer is what keeps enqueue cheap. Without it, you would walk the whole list.

A ring buffer uses two indices that chase each other and wrap around the array. That gives O(1) operations with far better cache behavior and no per-node allocation. The catch is fixed capacity, so you either grow the array or reject when full.

Pick the ring buffer when throughput matters, like network packet handling, and the linked list when the queue must grow without bound.

Rewriting in plainer words…

This answer doesn't lend itself to a diagram - it reads best . No credits were charged.

Why there's no diagram: “”

The interactive diagram is below the answer - jump to diagram ↓ · Below it, the related concept . Jump to it ↓

Related concept

Tailored explanation · switch back to · ·
What should the new diagram focus on?
How well did you know this?
AI:

12

How do you find the Nth element of a linked list, and what does it cost?

Part of Pro
13

What is a node, and what does each node store in a linked list?

Part of Pro
14

Why does a linked list keep a head pointer, and when do you add a tail?

Part of Pro Visual
15

What is a circular linked list, and where is it used?

Part of Pro
16

What everyday problems do stacks naturally solve?

Part of Pro
17

What everyday problems do queues naturally solve?

Part of Pro
18

Why are stacks and queues defined by their operations rather than their storage?

Part of Pro
19

What is the difference between a stack and a queue?

Part of Pro
Intermediate 32
20

Why is random access slow in a linked list compared to an array?

Part of Pro
21

How does cache locality make arrays faster than linked lists in practice?

Part of Pro Visual
22

What does a doubly linked list's extra pointer buy you, and what does it cost?

Part of Pro
23

How does a sentinel node remove edge cases from list insertion and deletion?

Part of Pro Visual
24

How do you detect a cycle in a linked list, and what does the idea cost?

Part of Pro Visual
25

What is the idea behind reversing a linked list in place, and its cost?

Part of Pro Visual
26

Why is deleting a node hard when you only have a pointer to it?

Part of Pro Visual
27

What is the real memory overhead of a linked list per element?

Part of Pro
28

When would you back a stack with an array versus a linked list?

Part of Pro
29

When would you back a queue with an array versus a linked list?

Part of Pro
30

Why does a naive array-backed queue waste space, and how do you fix it?

Part of Pro Visual
31

What is a ring buffer, and how do its head and tail wrap around?

Part of Pro Visual
32

How do you implement a deque so both ends stay O(1)?

Part of Pro
33

How do you build a queue from two stacks, and what does it cost?

Part of Pro Visual
34

Why is push on a dynamic-array stack O(1) amortized but not worst case?

Part of Pro Visual
35

What problem shape does a monotonic stack solve at the concept level?

Part of Pro Visual
36

What problem shape does a monotonic queue solve at the concept level?

Part of Pro
37

Where does the call stack fit, and what lives in a stack frame?

Part of Pro Visual
38

What causes a stack overflow, and how deep can recursion go?

Part of Pro
39

When should you replace recursion with an explicit stack?

Part of Pro
40

Why is a queue, not a stack, the right structure for a BFS frontier?

Part of Pro Visual
41

How does a priority queue differ from a plain FIFO queue?

Part of Pro
42

How do skip lists use linked lists to get faster search?

Part of Pro Visual
43

Why is a doubly linked list the backbone of an LRU cache?

Part of Pro Visual
44

How does insertion into a sorted linked list compare to a sorted array?

Part of Pro
45

What makes splicing or splitting linked lists cheap?

Part of Pro
46

Why can't you binary search a linked list efficiently?

Part of Pro
47

How do you implement a stack using queues, and what does it cost?

Part of Pro
48

How do you find the middle of a linked list in one pass?

Part of Pro Visual
49

How do you implement a stack that returns its minimum in O(1)?

Part of Pro Visual
50

How do you build a fixed-capacity LRU cache from a map and a list?

Part of Pro Visual
51

How do you process a structure whose depth exceeds the stack limit?

Part of Pro
Expert 27
52

How would you design an undo and redo feature, and why two stacks?

Part of Pro Visual
53

How do you get the maximum over a sliding window using a deque?

Part of Pro Visual
54

How do schedulers use multiple queues to balance fairness and priority?

Part of Pro
55

How does a work-stealing deque speed up parallel schedulers?

Part of Pro Visual
56

How do you make a queue thread-safe for many producers and consumers?

Part of Pro Visual
57

How would you design a bounded blocking queue?

Part of Pro Visual
58

How does a lock-free queue work, and what makes it so hard?

Part of Pro Visual
59

How do you make a stack thread-safe without serializing every operation?

Part of Pro Visual
60

What happens to a ring buffer when producers outrun consumers?

Part of Pro
61

How does backpressure work when a queue fills faster than it drains?

Part of Pro
62

How would you make a queue durable across process restarts?

Part of Pro Visual
63

How do you shard a queue to scale past one machine's throughput?

Part of Pro Visual
64

How would you design a delayed or scheduled-delivery queue?

Part of Pro
65

What breaks first when one queue must handle a million messages a second?

Part of Pro
66

How do you free a very long linked list without overflowing the call stack?

Part of Pro
67

What edge cases must a robust doubly linked list implementation handle?

Part of Pro
68

How do you detect and repair a corrupted or self-looping doubly linked list?

Part of Pro Visual
69

How do you safely iterate a linked list while other threads mutate it?

Part of Pro Visual
70

What concurrency hazards come with a shared linked list, and how do you mitigate them?

Part of Pro Visual
71

What cache-miss costs appear when a linked list grows to millions of nodes?

Part of Pro
72

How does an unrolled linked list trade node count for cache performance?

Part of Pro Visual
73

How do intrusive linked lists reduce allocation overhead in systems code?

Part of Pro Visual
74

How do memory allocators use free lists built on linked lists?

Part of Pro Visual
75

What causes memory fragmentation in a long-lived linked list?

Part of Pro Visual
76

How does XOR linking halve pointer memory, and why is it rarely worth it?

Part of Pro
77

When is a linked list still the right choice at large scale?

Part of Pro
78

How do you maintain a linked list of a billion nodes, and what breaks first?

Part of Pro

No matches

Try a different filter or search term.

Know someone prepping for Linked Lists, Stacks & Queues? Send them this set.
Quick recap

Linked Lists, Stacks & Queues in pictures.

A quick recap of Linked Lists, Stacks & Queues in 35 short animated pictures, one idea at a time. About 9 min to get the whole topic back in your head before you walk in. Pause any picture, slow it down, or step through it.

Pro The first chapter is free to play. The other 31 pictures come with Pro.

Get Pro · $10/mo
Pro · $10/mo

67 of 78 Linked Lists, Stacks & Queues answers are in Pro.

Full answers, code samples, and AI explanations that go simpler or deeper. Cancel anytime.

  • Full answers + code
  • AI explanations, simpler or deeper
  • 1,000 AI credits / month
  • Cancel anytime

Change topic

Pick a different technology or stack. Your current topic stays put until you choose a new one.

Technologies
No technologies match “”.
Cross-cutting topics
No topics match “”.
By role
Stacks & frameworks

MEAN

MongoDB, Express, Angular, Node.js

MERN

MongoDB, Express, React, Node.js

LAMP

Linux, Apache, MySQL, PHP

Django

Python Full-Stack Development

Ruby on Rails

Convention over Configuration

Serverless on AWS

Serverless Architecture on AWS

Flutter Mobile

Flutter Cross-Platform Mobile Development

Spring Boot

Enterprise Java Development

.NET

Microsoft Ecosystem

Vue

Vue.js, Vite, TypeScript, Tailwind, Node.js

Go Backend

Golang, gRPC, PostgreSQL, Redis, RabbitMQ

FastAPI

Python, FastAPI, SQLAlchemy, PostgreSQL

React Native

React, TypeScript, Redux, Firebase

iOS Native

Swift, SwiftUI, UIKit, Firebase

Android Native

Java, Jetpack Compose, Firebase

DevOps / Platform

Docker, Kubernetes, Terraform, CI/CD

AI Engineer

LLMs, RAG, Agents, Evals

AI-Powered Developer

Claude Code, Copilot, Agentic Workflows

Core SWE Interview Prep

Data structures, algorithms, OS, concurrency, networking, git