InterviewLegend

Linked Lists and Stacks

Alex Chen45 min readUpdated 116 real interview reports

Linked lists and stacks turn up all over Mastercard's live rounds. They've opened an SDE-II first round, landed in a Bar Raiser and come up in a Java backend hire's first technical round. Each problem is short. Sometimes it's a warm-up before the talk moves to Java, so a clean first version matters more than a clever second one.

Two of the six problems are classes you write yourself. Use your own node type. Java's built-in LinkedList is doubly linked, and leaning on it skips the part you were asked to write. Expect a question about the class behind your stack too, and know why you'd pick ArrayDeque over the old Stack class. Every problem has runnable tests in six languages. Try each list problem on an empty list and on a list of one, and for the stacks, push the same value twice. A count with two digits catches one of them out too.

MastercardPremium lesson · Coding round

The 6 Mastercard problems are below.

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

+ 3 more in this lesson

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

Get the Mastercard questions

$49 a year · all 100 companies · cancel anytime

From 116 Mastercard reports, forum threads behind logins and write-ups in Chinese.

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

Know what Mastercard asks before you walk in.

31 coding · 2 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.