Mercer Mettl interview experience Real time questions & tips from candidates to crack your interview

SDE - 1

Mercer Mettl
upvote
share-icon
2 rounds | 4 Coding problems

Interview preparation journey

expand-icon
Journey
My life has had many ups and downs, but I somewhat managed to get admission to the college where I took computer science as a subject. Then my coding journey started from here.
Application story
I applied through a friend who works at this company.
Why selected/rejected for the role?
I was rejected because I was not able to answer all the questions correctly and precisely.
Preparation
Duration: 4 months
Topics: Data Structures, Pointers, OOPS, System Design, Algorithms, Dynamic Programming
Tip
Tip

Tip 1: Practice more problem-solving questions. 

Tip 2: Understand the concepts in depth. 

Tip 3: Try working on one or two hands-on projects to gain more experience in that stack.

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

Tip 1: Include some projects on your resume. 

Tip 2: Avoid putting false information on your resume.

Interview rounds

01
Round
Easy
Video Call
Duration45 minutes
Interview date23 Feb 2023
Coding problem2

1. Trapping Rain Water

Moderate
15m average time
80% success
0/80
Asked in companies
RazorpayMorgan StanleyUber

You have been given a long type array/list 'arr’ of size 'n’.


It represents an elevation map wherein 'arr[i]’ denotes the elevation of the 'ith' bar.



Note :
The width of each bar is the same and is equal to 1.
Example:
Input: ‘n’ = 6, ‘arr’ = [3, 0, 0, 2, 0, 4].

Output: 10

Explanation: Refer to the image for better comprehension:

Alt Text

Note :
You don't need to print anything. It has already been taken care of. Just implement the given function.
Problem approach

1. I used every possible combination, O(N^2).
2. I then optimised it using 2 pointers, O(N).

Try solving now

2. Strongly Connected Components (Tarjan’s Algorithm)

Hard
15m average time
85% success
0/120
Asked in companies
AppleMicrosoftAmazon

You are given an unweighted directed graph of 'V' vertices and 'E' edges. Your task is to print all the strongly connected components (SCCs) present in the graph.

Problem approach

I applied Depth's first search to explore all the components. The interviewer was happy with that approach.

Try solving now
02
Round
Easy
Video Call
Duration45 minutes
Interview date23 Feb 2023
Coding problem2

1. Best Time to Buy and Sell

Moderate
20m average time
80% success
0/80
Asked in companies
Natwest GroupMakeMyTripGartner

You are given an array(PRICES) of stock prices for N consecutive days. Your task is to find the maximum profit that you can make by completing as many transactions as you like, where a transaction denotes buying one and selling one share of the stock.

Note:

You must sell the stock before you buy it again.
Try solving now

2. Permutation in String

Hard
20m average time
80% success
0/120
Asked in companies
IBMMicrosoftAmazon

You have been given two strings ‘str1’ and ‘str2’ of length N and M respectively. Your task is to check whether string ‘str2’ contains one of the permutations of string ‘str1’ as its substring.

In other words, find whether there exists any permutation of string ‘str1’ that is a substring of ‘str2’.

A string ‘x’ is a permutation of another string ‘y’ only if sorted(x) = sorted(y). For example, LISTEN is a permutation of SILENT.

Note: ‘str1’ and ‘str2’ contains only lowercase English Alphabet letters.

For Example :

Input: str1 = “ab” , str2 = “aoba”
Output: Yes

Explanation: Permutations of first-string str1 i.e. “ab” are [“ab”, “ba”].
The substrings of str2, i.e. “aoba” are [“a”, “o”, “b”, “a”, “ao”, “ob”, “ba”, “aob”, “oba”, “aoba”].
The string “ba” is present in the list of substrings of string str2.
Problem approach
  • Firstly, I applied the brute force approach where I checked each character of string 1 against string 2 one by one.
  • I then optimized it using an unordered map to store the frequency of each character.
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 recursion?

Choose another skill to practice
Similar interview experiences
SDE - 1
3 rounds | 6 problems
Interviewed by Mercer Mettl
851 views
0 comments
0 upvotes
SDE - 1
2 rounds | 4 problems
Interviewed by Mercer Mettl
1199 views
0 comments
0 upvotes
SDE - 1
2 rounds | 4 problems
Interviewed by Mercer Mettl
971 views
0 comments
0 upvotes
SDE - 1
3 rounds | 5 problems
Interviewed by Mercer Mettl
1164 views
0 comments
0 upvotes
Companies with similar interview experiences
company logo
SDE - 1
5 rounds | 12 problems
Interviewed by Amazon
114579 views
24 comments
0 upvotes
company logo
SDE - 1
4 rounds | 5 problems
Interviewed by Microsoft
57825 views
5 comments
0 upvotes
company logo
SDE - 1
3 rounds | 7 problems
Interviewed by Amazon
34961 views
7 comments
0 upvotes