Mphasis pvt limited interview experience Real time questions & tips from candidates to crack your interview

SDE - 1

Mphasis pvt limited
upvote
share-icon
3 rounds | 6 Coding problems

Interview preparation journey

expand-icon
Preparation
Duration: 6 months
Topics: Data Structures, Pointers, OOPS, System Design, Algorithms, Dynamic Programming
Tip
Tip

PREPARATION TIP:
Tip1- Don’t create panic in any case in the interview , as even if you are not selected you will learn a lot from your interview experience and perform well in the future. 
Tip2- Also I would recommend you Coding Ninjas as according to me it is a good platform to learn basic coding concepts and to practice coding.
Tip3- Do atleast 2 projects

Application process
Where: Campus
Eligibility: No criteria
Resume Tip
Resume tip

Tip 1 : Have projects related to the skills mentioned in the job description.
Tip 2 : Be perfect with the things that you put on resume. If you feel not confident enough remove them from resume.

Interview rounds

01
Round
Easy
Face to Face
Duration1 hour
Interview date16 Nov 2022
Coding problem2

- Morning time
- Environment was good.
- No
- Interviewer was good

1. Maximum Subarray Sum

Moderate
35m average time
81% success
0/80
Asked in companies
NoBrokerInformaticaGoldman Sachs

You are given an array 'arr' of length 'n', consisting of integers.


A subarray is a contiguous segment of an array. In other words, a subarray can be formed by removing 0 or more integers from the beginning and 0 or more integers from the end of an array.


Find the sum of the subarray (including empty subarray) having maximum sum among all subarrays.


The sum of an empty subarray is 0.


Example :
Input: 'arr' = [1, 2, 7, -4, 3, 2, -10, 9, 1]

Output: 11

Explanation: The subarray yielding the maximum sum is [1, 2, 7, -4, 3, 2].
Problem approach

My Approach
s1- Given an array and an integer K, find the maximum for each and every contiguous subarray of size k.
s2- Examples :

Input: arr[] = {1, 2, 3, 1, 4, 5, 2, 3, 6}, K = 3 
Output: 3 3 4 5 5 5 6

s3- Explanation: 
Maximum of 1, 2, 3 is 3
Maximum of 2, 3, 1 is 3
Maximum of 3, 1, 4 is 4
Maximum of 1, 4, 5 is 5
Maximum of 4, 5, 2 is 5 
Maximum of 5, 2, 3 is 5
Maximum of 2, 3, 6 is 6

Try solving now

2. Convert Min-Heap to Max-Heap

Moderate
26m average time
0/80
Asked in company
Amazon

You are given an array/list (arr) representing a min-heap. Your task is to write a function that converts the min-heap to a max-heap.

 Note :
Change in the input array/list itself. You don't need to return or print the elements.
Problem approach

s1- Converting a min heap to a max heap. There can be multiple max heaps possible. Any max heap will be good.

Try solving now
02
Round
Medium
Face to Face
Duration60 min
Interview date6 Dec 2022
Coding problem2

- Morning time
- Environment was good.
- No
- Interviewer was good

1. Longest Substring Without Repeating Characters

Moderate
30m average time
65% success
0/80
Asked in companies
AdobeInformaticaMicrosoft

Given a string input of length n, find the length of the longest substring without repeating characters i.e return a substring that does not have any repeating characters.

Substring is the continuous sub-part of the string formed by removing zero or more characters from both ends.

Problem approach

s1- Create a set to check if the character has occurred before or not 
s2- I solved it using the sliding window concept 
s3- Iterate through the string and find the ans through ans=max(ans,j-i+1)

Try solving now

2. Diameter Of Binary Tree

Easy
10m average time
90% success
0/40
Asked in companies
AdobePhonePeAmazon

You are given a Binary Tree.


Return the length of the diameter of the tree.


Note :
The diameter of a binary tree is the length of the longest path between any two end nodes in a tree.

The number of edges between two nodes represents the length of the path between them.
Example :
Input: Consider the given binary tree:

Example

Output: 6

Explanation:
Nodes in the diameter are highlighted. The length of the diameter, i.e., the path length, is 6.


Problem approach

s1- Find left and right height of the tree at each node
s2- Diameter will be the maximum of left height+ right height

Try solving now
03
Round
Easy
Video Call
Duration90 minutes
Interview date9 Nov 2022
Coding problem2

- Morning time
- Environment was good.
- No
- Interviewer was good

1. Balanced parentheses

Moderate
10m average time
90% success
0/80
Asked in companies
IntuitPayPalInfo Edge India (Naukri.com)

Given an integer ‘N’ representing the number of pairs of parentheses, Find all the possible combinations of balanced parentheses with the given number of pairs of parentheses.

Note :

Conditions for valid parentheses:
1. All open brackets must be closed by the closing brackets.

2. Open brackets must be closed in the correct order.

For Example :

()()()() is a valid parentheses.
)()()( is not a valid parentheses.
Problem approach

s1- Using stack push/pop operations this problem can ve solved

Try solving now

2. Sort 0 1

Moderate
0/80
Asked in companies
Goldman SachsHCL TechnologiesMorgan Stanley

You have been given an integer array/list(ARR) of size N that contains only integers, 0 and 1. Write a function to sort this array/list. Think of a solution which scans the array/list only once and don't require use of an extra array/list.

Note:
You need to change in the given array/list itself. Hence, no need to return or print anything. 
Problem approach

s1- Sort by using Insertion sort
s2-print the sorted array/list elements in a row separated by a single space.

Try solving now

Here's your problem of the day

Solving this problem will increase your chance to get selected in this company

Skill covered: Programming

What is the purpose of the return keyword?

Choose another skill to practice
Similar interview experiences
SDE - 1
3 rounds | 5 problems
Interviewed by Mphasis pvt limited
1475 views
0 comments
0 upvotes
SDE - 1
3 rounds | 5 problems
Interviewed by Mphasis pvt limited
1852 views
0 comments
0 upvotes
SDE - 1
4 rounds | 5 problems
Interviewed by Mphasis pvt limited
1227 views
0 comments
0 upvotes
SDE - 1
3 rounds | 5 problems
Interviewed by Mphasis pvt limited
899 views
0 comments
0 upvotes
Companies with similar interview experiences
company logo
SDE - 1
5 rounds | 12 problems
Interviewed by Amazon
114869 views
24 comments
0 upvotes
company logo
SDE - 1
4 rounds | 5 problems
Interviewed by Microsoft
58031 views
5 comments
0 upvotes
company logo
SDE - 1
3 rounds | 7 problems
Interviewed by Amazon
35057 views
7 comments
0 upvotes