InterviewLegend

Linked Lists and Design

Alex Chen24 min readUpdated 27 real interview reports

Snap runs its coding rounds live, and the pointer problems are where a working answer separates from a sketch. Linked lists and a Premium question are the classic bank here: reverse a list, merge two sorted ones, a Premium question stored as digit lists, and build a cache that evicts the least-recently-used entry. None of it is dressed up as a Snapchat feature. It is the standard medium-tier set, and the Snap texture is the grading, not the prompt: code that compiles and runs, delivered fast, with the boundary cases handled on the first pass.

One habit carries the whole cluster. Every one of these problems is a small exercise in rewiring next pointers without losing the rest of the list. Save the next node before you overwrite the link. Lean on a sentinel node so the head and the empty case stop being special. Get the save-then-rewire reflex and the dummy-head trick automatic, and reversal, merge, and the cache all collapse into the same few lines of pointer bookkeeping.

The Snap angle
Snap's product is a stream of messages that arrive, get read, and expire. The data structures in this section sit behind that behavior, and framing them that way reads well in the room. A chat is an ordered list of messages you splice and reorder. A Premium question is exactly how a client keeps the most recent conversations warm and lets stale ones fall out of memory. You do not need to force the metaphor. Still, saying that a merge is how two ordered message streams fold into one timeline, or that eviction is how ephemeral state ages out, shows you see the structure under the product. On a loop graded for speed and clean execution, get a correct version running against the examples first, then narrate the pointer moves as you tighten it.
What's inside
  • 4 problems, worked step by step
  • about 24 min

Premium lessonSnap 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 · Cancel anytime

Had your Snap interview?Tell us what they asked. Reviewed before it goes in, never with your name.
Snap interview guide

Know what Snap asks before you walk in.

19 coding · 5 system design · 15 behavioral questions

Get Premium$49 a year · Cancel anytime
Or start freeNo card.

Get their questions first.

InterviewLegend is independent and not affiliated with or endorsed by any company it covers.