37 questions · from 6 interviews
Mastercard interview questions
Every question candidates reported from their Mastercard interviews, most frequently asked first. Each links to the write-up it came from, so you can see the round and how it went.
Mastercard coding and DSA questions
- 01
Virus Containment Grid
Given a 2D grid representing infected regions (1) and uninfected areas (0), infected cells spread to adjacent cells each turn. You may build quarantine walls to isolate one infected region per turn. Determine the minimum number of wall segments required to…
Hard · From Mastercard | Online Assessment | Software Engineer
- 02
Minimum Trie Nodes with String Permutations
You are given an array of $N$ strings words. You may independently permute the characters of each string before inserting them into a Trie. Determine the minimum total number of nodes (including the root) required to store all strings in the Trie after…
Hard · From Mastercard | Online Assessment | Software Engineer
- 03
Print Prime Numbers in a Range
Write a program or algorithm to print all prime numbers that fall within a specified numerical range.
Easy · From Mastercard SDE-1 JAVA OOPS Interview Experience
- 04
Valid Parenthesis
Implement a function to determine if an input string containing '(', ')', '{', '}', '[', and ']' is valid. The function must correctly handle various edge cases, ensuring that open brackets are closed by the same type of brackets in the correct order.
Easy · From Mastercard SDE-1 JAVA OOPS Interview Experience
- 05
Implement a Basic LinkedList
Implement the fundamental structure and basic operations of a singly linked list data structure.
Medium · From Mastercard SDE-1 JAVA OOPS Interview Experience
- 06
Decode String
Given an encoded string, return its decoded string. The encoding rule is: k[encodedstring], where the encodedstring inside the square brackets is being repeated exactly k times. k is guaranteed to be a positive integer. (This is a well-known LeetCode problem).
Medium · From Mastercard SDE-1 JAVA OOPS Interview Experience
- 07
Easier Version of Longest Increasing Subsequence
Solve a variation of the Longest Increasing Subsequence (LIS) problem, explicitly stated as an 'easier version'. The task involves finding the longest subsequence of a given sequence such that all elements of the subsequence are sorted in ascending order.
Medium · From Mastercard SDE-1 JAVA OOPS Interview Experience
- 08
Reverse String
How to reverse a string in Java.
Easy · From Mastercard Pune | Sr SDET interview Experience
- 09
Fizz Buzz Problem
The classic Fizz Buzz problem.
Easy · From Mastercard Pune | Sr SDET interview Experience
- 10
Merge Two Arrays with Single Loop
Suppose there are 2 arrays having integers. Create array number 3 which has all elements from array 1 and array 2. There is 1 condition that you can use for loop only once while solving the problem. Input : arr1 : {1,2,3,4, 5} & arr2 : {6,7,8,9,10} Output :…
Medium · From Mastercard Pune | Sr SDET interview Experience
- 11
Swap Immediate Elements in Array
Swap immediate elements in array. Input : array : {18,45, 7,10,5} Output : array :{45,18,10,7,5}
Medium · From Mastercard Pune | Sr SDET interview Experience
- 12
Check if Two Strings are Anagram
Check if two given strings are anagrams of each other.
From Mastercard | Software Engineer | Pune | Sept 2024 [Offer]
- 13
Get Middle Element of Linked List
Given a singly linked list, find and return its middle element.
Easy · From Mastercard SDE-II
- 14
Convert Number to Words (Indian Numeral System)
Write a function to convert a numerical value into its word representation according to the Indian numeral system. For example, 1,23,45 should be converted to 'one lakh twenty three hundret fourty five'.
Medium · From Mastercard SDE-II
Mastercard system design questions
- 01
Design a Car System
Design a car system, including its various models and engine components, by applying appropriate design principles and patterns.
- 02
Design a Lift System (Simplified)
Design how a lift (elevator) system works. The question was later simplified to consider only one user using the lift.
From Mastercard | Software Engineer | Pune | Sept 2024 [Offer]
- 03
Monolithic vs. Microservices Discussion
Discuss the circumstances and trade-offs that lead to choosing between a monolithic architecture and a microservices architecture.
From Mastercard SDE-II
- 04
Sharding Concepts
Explain the concept of sharding in distributed systems, including its purpose, different strategies, and potential challenges.
From Mastercard SDE-II
- 05
Consistent Hashing
Describe consistent hashing, its benefits, and how it is applied in distributed systems for load balancing and fault tolerance.
From Mastercard SDE-II
Mastercard behavioural and HR questions
- 01
Describe your biggest technical challenge and how you solved it
What was your biggest technical challenge and how did you solve it?
From [UPDATE 1] First interview at Mastercard L7 (Senior Java Backend Engineer)
- 02
Disagreement on a technical decision
Tell me about one time you disagreed on a technical decision and what you did.
From [UPDATE 1] First interview at Mastercard L7 (Senior Java Backend Engineer)
- 03
Experience mentoring junior engineers
Have you ever had experience mentoring interns, junior, or mid‑level engineers?
From [UPDATE 1] First interview at Mastercard L7 (Senior Java Backend Engineer)
- 04
Code Review Process
How do you approach and conduct code reviews effectively? Describe your typical process and what you look for.
From Mastercard SDE-II
Mastercard other questions
- 01
Explain OOPs to a 5-year-old
I was asked to explain the core concepts of Object-Oriented Programming (OOPs) in a simplified manner suitable for a 5-year-old.
- 02
4 Pillars of OOPs
I had to explain the four fundamental pillars of Object-Oriented Programming (OOPs) and provide concrete examples for each.
- 03
Debug Java Code (File Handling & Singleton)
Identify and fix bugs in two provided Java code snippets. One snippet dealt with file handling, and the other involved the Singleton design pattern.
- 04
- 05
Java Object Creation Methods
What are different ways to create an object in Java?
Medium · From Mastercard Pune | Sr SDET interview Experience
- 06
Abstract Class and Constructors
1. Can we create an object of an abstract class? 2. Does an abstract class have a default constructor? 3. If an object cannot be created from an abstract class then why do we have a constructor in an abstract class?
Medium · From Mastercard Pune | Sr SDET interview Experience
- 07
Final and Static Constructors in Java
1. Can we have a final constructor in Java? 2. Can we have a static constructor in Java?
Medium · From Mastercard Pune | Sr SDET interview Experience
- 08
String Concatenation Output 1
What will be the output of the below code: String s= 21+"abc"+ 49 +14; System.out.println(s);
Easy · From Mastercard Pune | Sr SDET interview Experience
- 09
String Concatenation Output 2
What will be the output of the below code: String s= 21+ 49+"abc"+ 14; System.out.println(s);
Easy · From Mastercard Pune | Sr SDET interview Experience
- 10
Explain Polymorphism with Example
Explain the concept of polymorphism in Object-Oriented Programming (OOPS) with a suitable example.
From Mastercard | Software Engineer | Pune | Sept 2024 [Offer]
- 11
Explain ACID Properties
Explain the ACID properties (Atomicity, Consistency, Isolation, Durability) in the context of Database Management Systems (DBMS).
From Mastercard | Software Engineer | Pune | Sept 2024 [Offer]
- 12
Two Bulbs Two Switches Puzzle
There are two bulbs inside a room and two switches outside the room. You can enter the room only once. You need to identify which switch belongs to which bulb. The interviewer also modified this question with multiple variations like 3 bulbs 1 switch, 3 bulbs…
From Mastercard | Software Engineer | Pune | Sept 2024 [Offer]
- 13
Interface Segregation Principle Example
Provide a practical example demonstrating the Interface Segregation Principle (ISP) from the SOLID principles.
From Mastercard SDE-II
- 14
Template Method Design Pattern
Explain the Template Method design pattern, its structure, and when it is appropriate to use it.
From Mastercard SDE-II
Mastercard interview questions FAQ
What questions are asked in Mastercard interviews?
Candidates reported 37 distinct questions across 6 Mastercard interviews. 14 coding and DSA questions, 5 system design questions, 4 behavioural and HR questions, 14 other questions.
How difficult are Mastercard interview questions?
Of the questions candidates rated, 39% were easy, 50% medium and 11% hard.