Mphasis Coding Interview Questions: AMCAT OA, Technical & HR Interview

Mphasis is a Bangalore headquartered IT services and consulting company, hiring freshers mainly as Associate Software Engineer (ASE) or Trainee Software Engineer through campus placement drives and off campus AMCAT based drives. Compared to product companies, the process weighs core CS fundamentals, C/C++/Java basics, OOP, DBMS, and simple coding problems, over competitive programming style DSA.

This guide compiles real questions reported by candidates across the AMCAT online assessment, the technical interview, and the HR round, based on interview experiences shared on GeeksforGeeks and other placement prep resources. Every coding problem includes a worked example, the right approach, and time or space complexity.

Mphasis Hiring Process for Fresher Roles

1. Application and Eligibility

  • B.E./B.Tech (all branches, sometimes with a minimum aggregate cutoff), hired mainly through campus drives, plus an off campus AMCAT based pipeline for open roles.
  • Results are typically declared within 1 to 2 weeks, with the full process taking 10 to 15 days end to end.

2. AMCAT Online Assessment around 120 minutes

  • 80 to 100 MCQs across 4 sections, Quantitative Aptitude, Logical Reasoning, Verbal/English Ability, and Computer Programming, DBMS, and Cloud basics.
  • An additional 45 minute coding round with 2 programming questions, written in C or C++, is used as an elimination round at many campuses. The first question is commonly based on arrays, the second on sorting.

3. Versant/SVAR Spoken English Assessment

  • A voice call based test: reading sentences aloud from provided material, hear-and-repeat exercises, a listening comprehension passage with a follow-up question, plus a vocabulary and a grammar MCQ.

4. Technical Interview 20 to 45 minutes

  • Resume and project deep dive, followed by rapid fire fundamentals across OOP, C/C++/Java, DBMS/SQL, data structures, and OS/networks, often with 1 to 2 quick coding questions asked directly, sometimes on paper.

5. Managerial Round (at some campuses, for certain roles)

  • Discussion of past work or internship experience, teamwork, and how you have handled challenges or ambiguity.

6. HR Interview 15 to 20 minutes

  • Culture fit, relocation willingness, and discussion of the mandatory training bond.

A Note on the Training Bond

  • Mphasis freshers typically sign a 24 month training agreement, with a reported penalty around ₹1,00,000 for leaving early. Confirm the exact current terms in your offer letter, since bond terms can change between drives.
  • Reported CTC for ASE/Trainee Software Engineer roles is in the ₹3.5 to ₹4.5 LPA range.

Preparation Resources

Part 1 Mphasis Coding Round Questions

These are the actual coding problems reported by candidates across the AMCAT coding round and the technical interview. Most are asked in C or C++, and several are simple enough to be asked verbally or on paper rather than on a compiler.

1. Sort an Array of 0s, 1s, and 2s Easy

OA Arrays · Two Pointers

Given an array containing only 0s, 1s, and 2s, sort it in a single pass without using a built-in sorting algorithm.

Input: arr = [2, 0, 2, 1, 1, 0]
Output: [0, 0, 1, 1, 2, 2]

Approach: Use the Dutch National Flag algorithm with three pointers, low, mid, and high. Walk mid through the array. If arr[mid] is 0, swap it with arr[low] and advance both low and mid. If it is 1, just advance mid. If it is 2, swap it with arr[high] and decrement high without advancing mid, since the swapped-in value still needs to be checked.

Complexity: Time O(n) · Space O(1)

Follow-up: How would you generalize this to sort an array containing K distinct small integer values instead of just three?

2. Reverse a Linked List Easy

Technical Interview Linked List

Given the head of a singly linked list, reverse it in place and return the new head.

Input: 1 -> 2 -> 3 -> 4 -> NULL
Output: 4 -> 3 -> 2 -> 1 -> NULL

Approach: Keep three pointers, previous, current, and next. Walk current through the list, at each node save the next node, point current's next pointer back to previous, then advance previous and current forward by one. Return previous once current becomes null, since that is the new head.

Complexity: Time O(n) · Space O(1)

Follow-up: How would you reverse only a sublist between two given positions, without reversing the entire list?

3. Detect and Remove a Cycle in a Linked List Medium

OA Linked List · Two Pointers

Given a singly linked list that may contain a cycle, detect whether a cycle exists, and if it does, remove it so the list becomes a proper null-terminated list.

Input: 1 -> 2 -> 3 -> 4 -> 2 (cycle back to node with value 2)
Output: cycle detected and removed, list becomes 1 -> 2 -> 3 -> 4 -> NULL

Approach: Use Floyd's slow and fast pointer technique to detect the cycle, moving slow one step and fast two steps until they meet, which proves a cycle exists. To remove it, reset one pointer to the head, then move both pointers one step at a time, since they meet again at the start of the cycle. Walk from there to find the node just before the cycle start and set its next pointer to null.

Complexity: Time O(n) · Space O(1)

Follow-up: How would you also determine the exact length of the cycle once one is detected?

4. Level Order Traversal of a Binary Tree Easy

OA Trees · BFS

Given the root of a binary tree, print its values level by level, from top to bottom, left to right within each level.

Input:      1
           / \
          2   3
         / \
        4   5
Output: [[1], [2, 3], [4, 5]]

Approach: Use a queue based breadth first traversal. Push the root, then repeatedly process the queue level by level, recording the current queue size as the number of nodes in that level, popping exactly that many nodes, collecting their values, and pushing their children before moving to the next level.

Complexity: Time O(n) · Space O(n)

Follow-up: How would you print the tree level by level in a zigzag order, alternating left-to-right and right-to-left on successive levels?

5. Dijkstra's Shortest Path Algorithm Hard

Technical Interview Graphs · Greedy

Given a weighted graph with non negative edge weights and a source node, find the shortest distance from the source to every other node.

Input: graph with edges (0-1, w=4), (0-2, w=1), (2-1, w=2), (1-3, w=1), (2-3, w=5), source = 0
Output: distances = [0, 3, 1, 4]
Why: 0 -> 2 -> 1 costs 1 + 2 = 3, which beats the direct 0 -> 1 edge of weight 4

Approach: Maintain a distance array initialized to infinity except the source, which is 0, and use a min heap keyed on current distance. Repeatedly pop the node with the smallest tentative distance, and for each of its neighbours, relax the edge, meaning update the neighbour's distance if going through the current node gives a shorter path, pushing the neighbour back onto the heap when relaxed.

Complexity: Time O((V + E) log V) with a binary heap · Space O(V + E)

Follow-up: How would Dijkstra's algorithm break if some edge weights were negative, and what algorithm would you use instead?

6. Solve the N-Queens Problem Hard

Technical Interview Backtracking

Given an integer N, place N queens on an N x N chessboard so that no two queens attack each other, meaning no two share a row, column, or diagonal. Return one valid arrangement, or all of them.

Input: n = 4
Output: one valid arrangement places queens at columns [1, 3, 0, 2] for rows 0, 1, 2, 3

Approach: Place queens row by row using backtracking. For each row, try every column, checking against the columns and diagonals already used by queens placed in earlier rows. If a column is safe, place the queen and recurse to the next row. If the recursive call fails to complete the board, undo the placement and try the next column.

Complexity: Time O(N!) in the worst case · Space O(N) for tracking used columns and diagonals

Follow-up: How would you optimize the safety check using bitmasks instead of separate arrays for columns and diagonals?

7. Check if a Number is an Armstrong Number Easy

OA Math

Given a number, determine whether it is an Armstrong number, meaning the sum of each digit raised to the power of the total digit count equals the number itself.

Input: n = 153
Output: true
Why: 1^3 + 5^3 + 3^3 = 1 + 125 + 27 = 153

Approach: Count the number of digits in the number, then extract digits one at a time using modulo and integer division, raising each to the digit count power and accumulating the sum. Compare the final sum against the original number.

Complexity: Time O(d) where d is the number of digits · Space O(1)

Follow-up: How would you find all Armstrong numbers within a given range efficiently?

8. Print All Prime Numbers From 1 to 100 Easy

Technical Interview Math

Print every prime number between 1 and 100.

Output: 2, 3, 5, 7, 11, 13, ..., 97

Approach: Use the Sieve of Eratosthenes. Create a boolean array marked true for every number up to 100, then starting from 2, mark every multiple of each unmarked number as not prime. The numbers still marked true at the end are the primes.

Complexity: Time O(n log log n) · Space O(n)

Follow-up: Why is the sieve significantly faster than checking each number individually for primality by trial division up to its square root?

9. Print 1 to 10 and Then 10 to 1 Using a Single For Loop Medium

Technical Interview Logic · Loops

Print the sequence 1 to 10 followed immediately by 10 down to 1, using only a single for loop that is written once, not two separate loops or a loop called twice.

Output: 1 2 3 4 5 6 7 8 9 10 10 9 8 7 6 5 4 3 2 1

Approach: Run the loop variable i from 1 to 10 as usual, and on each iteration print i before the midpoint. A clean way to satisfy "single loop, called once" literally is to loop i from 1 to 20, printing i when i <= 10, and printing 21 - i when i > 10, so the same loop body produces both the ascending and descending halves.

Complexity: Time O(n) · Space O(1)

Follow-up: How would you adapt the same single-loop trick to print 1 to N and back down to 1 for an arbitrary N?

10. Reverse a String Easy

Technical Interview Strings · Two Pointers

Given a string, reverse it in place without using a built-in reverse function.

Input: s = "mphasis"
Output: "sisahpm"

Approach: Convert the string to a mutable character array if needed, then use two pointers, one at the start and one at the end, swapping the characters they point to and moving both pointers inward until they cross.

Complexity: Time O(n) · Space O(1) excluding the output

Follow-up: How would you reverse only the words in a sentence while keeping the words themselves in their original order?

11. Find the Second Highest Salary With SQL Medium

Technical Interview SQL

Given an Employees table with a salary column, write a SQL query to find the second highest distinct salary.

Input: salary column = [90000, 120000, 120000, 75000]
Output: 90000
Why: the highest distinct salary is 120000, so the second highest distinct value is 90000

Approach: Select the maximum salary from the subquery that excludes the overall maximum salary, which naturally handles duplicate top salaries correctly since it operates on distinct values.

SELECT MAX(salary) AS second_highest
FROM Employees
WHERE salary < (SELECT MAX(salary) FROM Employees);

Complexity: Time O(n) for the two scans over the salary column, or O(log n) with an index · Space O(1)

Follow-up: How would you generalize this query to find the Nth highest salary for an arbitrary N, for example using DENSE_RANK?

12. Find the Maximum Subarray Sum Medium

Technical Interview Arrays · DP

Given an array of integers that may include negative numbers, find the maximum possible sum of a contiguous subarray.

Input: nums = [-2, 1, -3, 4, -1, 2, 1, -5, 4]
Output: 6
Why: the subarray [4, -1, 2, 1] has the largest sum

Approach: Use Kadane's algorithm. Walk through the array keeping a running sum that resets to the current element whenever including the previous running sum would make it smaller than starting fresh, and track the best running sum seen at every step as the answer.

Complexity: Time O(n) · Space O(1)

Follow-up: How would you also return the actual start and end indices of the maximum subarray, not just its sum?

13. Check if a String is a Palindrome Easy

Technical Interview Strings · Two Pointers

Given a string, determine whether it reads the same forwards and backwards.

Input: s = "madam"
Output: true
Input: s = "hello"
Output: false

Approach: Use two pointers, one starting at the beginning and one at the end of the string, comparing the characters they point to and moving both pointers inward. If every pair matches until the pointers meet or cross, the string is a palindrome.

Complexity: Time O(n) · Space O(1)

Follow-up: How would you check for a palindrome while ignoring spaces, punctuation, and letter casing, for example "A man, a plan, a canal: Panama"?

14. Solve the Coin Change Problem Medium

Technical Interview Dynamic Programming

Given a set of coin denominations and a target amount, find the minimum number of coins needed to make that amount, or determine it is impossible.

Input: coins = [1, 2, 5], amount = 11
Output: 3
Why: 11 = 5 + 5 + 1

Approach: Build a DP array where `dp[i]` holds the minimum coins needed for amount `i`, initialized to infinity except `dp[0] = 0`. For each amount from 1 up to the target, try every coin denomination that is less than or equal to the current amount, and take the minimum of `dp[i]` and `dp[i - coin] + 1`.

Complexity: Time O(amount * coins) · Space O(amount)

Follow-up: How would you also return one valid combination of coins that achieves the minimum, not just the count?

15. Search in a Nearly Sorted Array Medium

Technical Interview Binary Search

Given an array that is sorted except that each element may be swapped with its immediate neighbour, find the index of a target element.

Input: arr = [10, 3, 40, 20, 50, 80, 70], target = 40
Output: 2

Approach: Run a modified binary search. At each step, compute mid as usual. If `arr[mid]` equals the target, return it. Otherwise also check `arr[mid - 1]` and `arr[mid + 1]`, since the target could have been swapped one position away from where standard binary search would land, then narrow the search range based on which side is still guaranteed sorted.

Complexity: Time O(log n) · Space O(1)

Follow-up: How would this approach need to change if elements could be swapped with a neighbour up to K positions away instead of just 1?

16. Check if One String is a Subset of Another Easy

OA Strings · Hashing

Given two strings, determine whether every character in the first string, counted with multiplicity, also appears in the second string.

Input: a = "aabc", b = "aabbcc"
Output: true
Input: a = "aabbb", b = "aabbc"
Output: false (b has only two 'b' characters)

Approach: Build a character frequency count of the second string, then walk through the first string decrementing the count for each character. If any character's count would go below zero, the first string is not a subset. Otherwise it is.

Complexity: Time O(m + n) · Space O(1) for a fixed alphabet size

Follow-up: How would you adapt this if the check needed to run repeatedly against the same fixed string b, for many different candidate strings a?

17. Find the Sum of Digits of a Number Easy

OA Math

Given an integer, find the sum of its digits.

Input: n = 12345
Output: 15
Why: 1 + 2 + 3 + 4 + 5 = 15

Approach: Repeatedly extract the last digit using modulo 10, add it to a running total, then remove that digit using integer division by 10, continuing until the number becomes 0.

Complexity: Time O(d) where d is the number of digits · Space O(1)

Follow-up: How would you reduce a number to a single digit by repeatedly summing its digits, and can you compute that final digit without looping, using modulo 9?

Part 2 Mphasis Technical Interview Fundamentals

Beyond the coding problems above, the Mphasis technical interview leans heavily on rapid fire fundamentals questions across OOP, language basics, DBMS, data structures, and OS/networks. These are real questions reported by candidates.

Object-Oriented Programming

  • What are the four pillars of OOP? Explain each with an example.
  • What is the difference between abstraction and encapsulation?
  • What is inheritance? Explain the different types.
  • What is polymorphism? Explain compile-time versus runtime polymorphism.
  • What is method overloading? How does it differ from overriding?
  • What is an abstract class? How does it differ from an interface?
  • What are access modifiers in Java/C++?
  • What is a constructor? Explain default versus parameterized constructors.
  • What is the difference between a class and an object?
  • What is the use of the this keyword?

Programming Language Fundamentals

  • What are the different data types in C/Java/Python?
  • What is the difference between a compiler and an interpreter?
  • What are pointers in C/C++? Explain with an example.
  • What is call by value versus call by reference?
  • What is the extern keyword in C? When is it used?
  • What is the difference between malloc() and calloc()?
  • What is exception handling? Explain try-catch-finally.
  • What is a string? Is it mutable or immutable in your language of choice?
  • What is the difference between == and .equals() in Java?
  • What is the scope of a variable? Explain local versus global scope.
  • Explain structures versus unions in C/C++.
  • Explain function overloading and overriding for code reusability.

DBMS and SQL

  • What is a database? What is a DBMS?
  • What is the difference between DBMS and RDBMS?
  • What are the different types of SQL commands, DDL, DML, DCL, TCL?
  • What is normalization? Explain 1NF, 2NF, and 3NF.
  • What is a primary key? What is a foreign key?
  • What are SQL joins? Explain INNER, LEFT, and RIGHT JOIN.
  • What is the difference between DELETE, TRUNCATE, and DROP?
  • What are ACID properties, and why do they matter?
  • What is an index, and why is it used?

Data Structures

  • What is an array? What are its types?
  • What is a linked list? Explain singly, doubly, and circular variants.
  • What is the difference between an array and a linked list?
  • What is a stack? Explain push, pop, and peek operations.
  • What is a queue? What is the difference between a stack and a queue?
  • Explain DFS and BFS.
  • What is a binary tree? What is a binary search tree?
  • What is the time complexity of searching, insertion, and deletion in common data structures?

Operating Systems and Networks

  • What is an operating system? What are its core functions?
  • What is the difference between a process and a thread?
  • What is a deadlock? What are the four necessary conditions for one?
  • What is virtual memory?
  • What is the OSI model? Name its layers.
  • What is the difference between TCP and UDP?
  • What is a VPN? What are its types and advantages?
  • What is DNS, and how does it work?

Complete Interview Questions

For Experienced / Lateral Software Engineer Roles

Some candidates, especially for experienced Software Engineer hires rather than fresher ASE/Trainee roles, report a heavier process: two back-to-back DSA rounds followed by a dedicated system design round before HR. If you are interviewing for a lateral or experienced SDE role at Mphasis rather than a campus fresher role, expect real reported questions like these in addition to everything above:

  • Given a nearly sorted array, find a given element (see question 15 above).
  • Design a URL shortening service similar to bit.ly.
  • Describe the architecture of a messaging system similar to WhatsApp.
  • How would you design a distributed file storage system similar to Dropbox?
  • How would you approach scalability and high performance for a web application under heavy load?

System Design Roadmap

Part 3 Mphasis HR Interview Questions

The HR round is 15 to 20 minutes and checks culture fit, communication, and whether you are comfortable with the training bond. Real questions reported by candidates include:

  • Tell me about yourself.
  • Why do you want to join Mphasis? What do you know about Mphasis?
  • What are your strengths and weaknesses?
  • Where do you see yourself in five years?
  • How do you handle stress and pressure at work?
  • Describe a time when you worked in a team to accomplish a goal.
  • Are you willing to relocate to any Mphasis location?
  • Are you comfortable with the 24 month training bond?
  • Tell me about your family background.
  • What would you do if you were assigned a technology you have no experience with?
  • Do you have any questions for us?

Complete HR Interview Questions

Preparation Tips

  • Do not over-invest in competitive programming. Mphasis's coding round and technical interview lean on classic, well-known problems, Armstrong numbers, prime sieves, linked list reversal, rather than hard algorithmic puzzles, so time is better spent making sure you can write these cleanly under pressure, including on paper.
  • Revise core OOP and language fundamentals hard. Questions on the four pillars of OOP, overloading versus overriding, and pointers versus references come up in nearly every reported interview.
  • Know your SQL basics cold. Joins, normalization, ACID properties, and writing a second/Nth highest salary query are asked frequently enough that they are worth memorizing rather than deriving on the spot.
  • Read the bond terms in your offer letter carefully. The reported 24 month training bond and penalty amount are worth clarifying with the recruiter before you accept, since terms can vary by drive and location.

Join our Telegram group to discuss more Mphasis interview questions and prep strategies!

Useful Resources for Your Placement Prep