InterviewLegend

Arrays and Number Basics

Alex Chen40 min readUpdated 116 real interview reports

Some Mastercard screens spend most of the call on Spring and Angular and leave a few minutes for one small coding task. The five problems here fit that slot. They cover number basics and simple array scans. Each has an obvious first version and a faster one the interviewer may ask for next, so get the simple version working before you optimize.

One of the five is longer than the rest and turns on a formatting rule, so confirm the exact format with the interviewer before you write anything.

One problem has come up as a class with fields rather than a single function. Ask how the result should come back before you pick a return type. For every problem, test a zero, a negative number where the input allows one, and equal neighbors. You can run each one in Python, JavaScript, C++, Java, Go or Ruby.

MastercardPremium lesson · Coding round

The 5 Mastercard problems are below.

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

+ 2 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.