InterviewLegend

Linked Lists and Stacks

Alex Chen35 min readUpdated

Linked lists come up at Chewy as Java questions. The node class is tiny, and the interviewer cares how you treat its fields, including the ones you aren't allowed to change. Onsites, junior online assessments and co-op rounds have all used them, and a stack problem closes out the set.

Both list problems come down to which nodes you're allowed to change. In one you rewire every node in place. In the other you can rewire none of them, so you share what you can with the old list, which other code may still be reading.

For the last problem here, a single counter is enough. Hashing, Strings & Graphs has Valid Parentheses, which needs a real stack.

ChewyPremium lesson · Coding round

The 3 Chewy problems are below.

  1. A Premium questionCoding · Medium
  2. A Premium questionCoding · Easy
  3. A Premium questionCoding · Medium

Each with hints, the follow-up and a tested solution.

Get the Chewy questions

$49 a year · all 100 companies · cancel anytime

From 20,000+ candidate reports, forum threads behind logins and write-ups in Chinese.

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

Know what Chewy asks before you walk in.

30 coding · 1 system design · 28 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.