InterviewLegend

Java Coding Tasks

Alex Chen35 min readUpdated 116 real interview reports

Experienced hires at Mastercard spend a lot of their loop on Java itself, and some rounds skip the puzzle and hand you a small job instead. You might group records with Streams, call an endpoint and print a report from what comes back, or model something small as a class. The three tasks below are code you run. The spoken Java and Spring questions have their own lesson.

Before you type, ask what done looks like. The prompts tend to be loose while the interviewer has a specific output in mind, like which end of a range is inclusive. Check the empty input too. An empty group may still belong in the output, and a failed call should print an error line with no rows. Two of the three have no C++ tab, because they lean on JSON and Streams, where C++ has no natural fit. Every language a task ships in runs the same checks.

MastercardPremium lesson · Coding round

The 3 Mastercard problems are below.

  1. A Premium questionCoding · Medium · Signature problem
  2. A Premium questionCoding · Medium
  3. A Premium questionCoding · Medium

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.