Linked Lists and Stacks
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.
- A Premium questionCoding · Medium · Frequently asked
- A Premium questionCoding · Medium
- 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.
Mastercard interview guideKnow what Mastercard asks before you walk in.
31 coding · 2 system design · 15 behavioral questions
Get their questions first.
InterviewLegend is independent and not affiliated with or endorsed by any company it covers.