Design a Doubly Linked List
"Implement a doubly linked list, with insert, delete, and search." That's the whole prompt, and candidates report it more than any other from-scratch data-structure ask here. It looks trivial for about a minute. Then the interviewer starts deleting the node at the tail, then the node at the head, then the only node in a one-element list. They're watching whether your pointers stay consistent or leave a dangling reference behind. Keeping pointer invariants true through every operation and every boundary is the whole skill. On a vehicle, that same list might be a real-time buffer.
A doubly linked list is a good probe because it has almost no algorithmic content and almost all invariant content. There's no clever trick to find. Every method is four or five pointer assignments. The score is whether they hold the structure together on an empty list, a one-node list, or an operation that lands on the first or last element. Get the order of the assignments wrong and you splice a node out of the forward chain but leave it hanging in the backward one. Skip a boundary and a delete on the head walks into a null pointer. The interviewer wants to see you handle those cases on purpose, before they ask.
- 1 problem, worked step by step
- 1 diagram
- about 22 min
Premium lessonAnduril interview guide
These took digging.
What candidates walked out with, from 20,000+ reports, forum threads behind logins and write-ups in Chinese. Then solved step by step.
100 companies. Checked every month.
Unlock all 100 companies$49 a year · less than $1 a week · 30-day money-back guarantee
Anduril interview guideKnow what Anduril asks before you walk in.
9 coding · 2 system design · 14 behavioral questions
Get their questions first.
InterviewLegend is independent and not affiliated with or endorsed by any company it covers.