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

SDE - 1

Grab
upvote
share-icon
2 rounds | 4 Coding problems

Interview preparation journey

expand-icon
Journey
My journey started when I was in 12th grade, and my teacher guided me to take part in the coding competitions hosted by coding platforms. After that, I began participating in them and developed a habit of solving coding questions.
Application story
I applied to this company through the on-campus opportunity, as my college is a tier 1 college. This company always visits my college to hire.
Why selected/rejected for the role?
I was rejected because I was not able to explain all the concepts with the correct accuracy.
Preparation
Duration: 3 months
Topics: Data Structures, Pointers, OOPS, System Design, Algorithms, Dynamic Programming
Tip
Tip

Tip 1: Regarding DSA preparation, I have a theory. Twenty percent of the questions will be asked in 80 percent of the interviews, and 80 percent will be asked in 20 percent. In short, some questions have a very high chance of coming up during the interviews, and some have a meager chance. We should focus more on the questions that have more chance of coming up in the interview. You can find these questions on online coding platforms.

Application process
Where: Campus
Eligibility: Above 7 CGPA
Resume Tip
Resume tip

Tip 1: Make sure that your resume is simple and try to fit all the information on only one page.
Tip 2: Have at least two projects with the latest technologies; the GitHub link for the projects should be provided.

Interview rounds

01
Round
Easy
Face to Face
Duration60 minutes
Interview date11 Feb 2023
Coding problem2

1. Reverse List In K Groups

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

You are given a linked list of 'n' nodes and an integer 'k', where 'k' is less than or equal to 'n'.


Your task is to reverse the order of each group of 'k' consecutive nodes, if 'n' is not divisible by 'k', then the last group of nodes should remain unchanged.


For example, if the linked list is 1->2->3->4->5, and 'k' is 3, we have to reverse the first three elements, and leave the last two elements unchanged. Thus, the final linked list being 3->2->1->4->5.


Implement a function that performs this reversal, and returns the head of the modified linked list.


Example:
Input: 'list' = [1, 2, 3, 4], 'k' = 2

Output: 2 1 4 3

Explanation:
We have to reverse the given list 'k' at a time, which is 2 in this case. So we reverse the first 2 elements then the next 2 elements, giving us 2->1->4->3.


Note:
All the node values will be distinct.


Problem approach

Your task is to reverse the order of each group of 'k' consecutive nodes. If 'n' is not divisible by 'k', then the last group of nodes should remain unchanged.

Try solving now

2. Wildcard Pattern matching

Hard
50m average time
30% success
0/120
Asked in companies
FreshworksWalmartSamsung R&D Institute

Given a text and a wildcard pattern of size N and M respectively, implement a wildcard pattern matching algorithm that finds if the wildcard pattern is matched with the text. The matching should cover the entire text not partial text.

The wildcard pattern can include the characters ‘?’ and ‘*’

 ‘?’ – matches any single character 
 ‘*’ – Matches any sequence of characters(sequence can be of length 0 or more)
Problem approach

Given a text and a wildcard pattern of sizes N and M, respectively, implement a wildcard pattern matching algorithm that determines if the wildcard pattern matches the text. The matching should cover the entire text, not just a partial text.

Try solving now
02
Round
Easy
Face to Face
Duration60 minutes
Interview date11 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

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 'i-th' bar. Print the total amount of rainwater that can be trapped in these elevations.

Try solving now

2. 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. 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).

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
2 rounds | 4 problems
Interviewed by Grab
852 views
0 comments
0 upvotes
company logo
SDE - 1
3 rounds | 5 problems
Interviewed by Grab
1057 views
0 comments
0 upvotes
company logo
SDE - 1
3 rounds | 5 problems
Interviewed by Grab
604 views
0 comments
0 upvotes
company logo
SDE - 1
2 rounds | 4 problems
Interviewed by Grab
568 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