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

SDE - 1

MerchantRMS
upvote
share-icon
3 rounds | 6 Coding problems

Interview preparation journey

expand-icon
Journey
I kept practicing DSA and CS fundamentals from the 3rd year of Engineering. Along with it, I was also learning web development and I made some good projects. Amazon was the first company that visited our campus. I left no stone unturned, went through the previous interview experiences, polished my skills and eventually cracked the very first interview that I sat down for in my life.
Application story
This company visited our campus for hiring . I applied for the same, it had many round starting with online assessment at the starting.
Why selected/rejected for the role?
I was rejected because I was not able to give a concise and good solution to the questions being asked to me .
Preparation
Duration: 3 months
Topics: Data Structures, Pointers, OOPS, System Design, Algorithms, Dynamic Programming
Tip
Tip

Tip 1 : Mention some good projects on resume
Tip 2 : Be confident
Tip 3 : Good with computer science basics and ds and algo

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

Tip 1 : Good Projects
Tip 2 : Having some achievements is plus point

Interview rounds

01
Round
Easy
Video Call
Duration60 mins
Interview date10 Feb 2023
Coding problem2

1. Largest Distance Between Two Nodes In A Tree

Moderate
15m average time
85% success
0/80
Asked in companies
SamsungInnovaccerMicrosoft

You are given an arbitrary unweighted rooted tree which consists of N nodes, 0 to N - 1. Your task is to find the largest distance between two nodes in the tree.

The distance between two nodes is the number of edges in a path between the nodes (there will always be a unique path between any pair of nodes since it is a tree).

Note :
Use zero-based indexing for the nodes.

The tree is always rooted at 0.
Problem approach

Simple BFS worked

Try solving now

2. Middle Of Linked List

Easy
20m average time
80% success
0/40
Asked in companies
NoBrokerIBMHCL Technologies

Given a singly linked list of 'N' nodes. The objective is to determine the middle node of a singly linked list. However, if the list has an even number of nodes, we return the second middle node.

Note:
1. If the list is empty, the function immediately returns None because there is no middle node to find.
2. If the list has only one node, then the only node in the list is trivially the middle node, and the function returns that node.
Problem approach

Given the head node of the singly linked list, return a pointer pointing to the middle of the linked list.

Try solving now
02
Round
Easy
Video Call
Duration60 mins
Interview date10 Feb 2023
Coding problem2

1. Rat In A Maze

Easy
15m average time
85% success
0/40
Asked in companies
OlaIBMGoldman Sachs

You are given a starting position for a rat which is stuck in a maze at an initial point (0, 0) (the maze can be thought of as a 2-dimensional plane). The maze would be given in the form of a square matrix of order 'N' * 'N' where the cells with value 0 represent the maze’s blocked locations while value 1 is the open/available path that the rat can take to reach its destination. The rat's destination is at ('N' - 1, 'N' - 1). Your task is to find all the possible paths that the rat can take to reach from source to destination in the maze. The possible directions that it can take to move in the maze are 'U'(up) i.e. (x, y - 1) , 'D'(down) i.e. (x, y + 1) , 'L' (left) i.e. (x - 1, y), 'R' (right) i.e. (x + 1, y).

Note:
Here, sorted paths mean that the expected output should be in alphabetical order.
For Example:
Given a square matrix of size 4*4 (i.e. here 'N' = 4):
1 0 0 0
1 1 0 0
1 1 0 0
0 1 1 1 
Expected Output:
DDRDRR DRDDRR 
i.e. Path-1: DDRDRR and Path-2: DRDDRR

The rat can reach the destination at (3, 3) from (0, 0) by two paths, i.e. DRDDRR and DDRDRR when printed in sorted order, we get DDRDRR DRDDRR.
Problem approach

You are given a starting position for a rat which is stuck in a maze at an initial point (0, 0) (the maze can be thought of as a 2-dimensional plane). The maze would be given in the form of a square matrix of order 'N' * 'N' where the cells with value 0 represent the maze’s blocked locations while value 1 is the open/available path that the rat can take to reach its destination.

Try solving now

2. Square Root of a number

Easy
15m average time
80% success
0/40
Asked in companies
SamsungAmazonMicrosoft

You are given a positive integer ‘n’.


Your task is to find and return its square root. If ‘n’ is not a perfect square, then return the floor value of sqrt(n).


Example:
Input: ‘n’ = 7

Output: 2

Explanation:
The square root of the number 7 lies between 2 and 3, so the floor value is 2.


Problem approach

So he asked me to explain all approaches from brute force to the optimal solution, which he was expecting me to do in O(logn), and use different methods for each implementations(different methods in same code).

Try solving now
03
Round
Easy
Video Call
Duration60 mins
Interview date10 Feb 2023
Coding problem2

1. N Queens

Hard
55m average time
35% success
0/120
Asked in companies
Thought WorksTwitterAdobe

You are given an integer 'N'. For a given 'N' x 'N' chessboard, find a way to place 'N' queens such that no queen can attack any other queen on the chessboard.

A queen can be killed when it lies in the same row, or same column, or the same diagonal of any of the other queens. You have to print all such configurations.

Problem approach

I solved it using backtracking

Try solving now

2. Maximum Subarray Sum

Moderate
35m average time
81% success
0/80
Asked in companies
HCL TechnologiesInformaticaSamsung

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

I used Kadane algorithm here to find subarray with maximum sum. It is a standard question for interview.

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
company logo
SDE - 1
3 rounds | 7 problems
Interviewed by OYO
4657 views
0 comments
0 upvotes
company logo
SDE - Intern
2 rounds | 3 problems
Interviewed by Amazon
960 views
0 comments
0 upvotes
company logo
SDE - 1
2 rounds | 5 problems
Interviewed by Meesho
6450 views
0 comments
0 upvotes
company logo
SDE - 1
3 rounds | 9 problems
Interviewed by Salesforce
3451 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