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

SDE - 1

Grab
upvote
share-icon
3 rounds | 6 Coding problems

Interview preparation journey

expand-icon
Journey
I started my coding journey from college, where I first learned the Data Structure and Algorithm. Then I started practicing coding problems.
Application story
This was an off-campus opportunity. I applied for this job on Unstop. Here there are 2 rounds with 1 HR round.
Why selected/rejected for the role?
I got rejected because I got stuck between the question's explanation multiple times, and my computer fundamentals basics were also unclear.
Preparation
Duration: 6 months
Topics: Data Structures, Pointers, OOPS, System Design, Algorithms, Dynamic Programming
Tip
Tip

Technical Skills:

Programming Languages: Focus on mastering the languages commonly used in the field, such as Python, Java, C++, and JavaScript.
Data Structures and Algorithms: Understand fundamental data structures (arrays, linked lists, trees, graphs) and algorithms (sorting, searching, dynamic programming) and their complexities.

Problem-Solving and Coding:

Practice Coding Challenges: Regularly solve coding problems on coding platforms to enhance your problem-solving skills.
Code Reviews: Participate in code reviews with peers to learn different approaches and coding best practices.
Projects: Work on personal or open-source projects to apply your skills to real-world scenarios and build a portfolio.
Complexity Analysis: Learn to analyze the time and space complexity of algorithms to optimize their efficiency.
Soft Skills:

Communication: Develop clear and concise communication skills, both written and verbal, to collaborate effectively with team members.
Teamwork: Understand how to work in a team, contribute constructively, and resolve conflicts professionally.
Adaptability: Embrace new technologies and methodologies as the tech industry is constantly evolving.
Problem Solving: Demonstrate your ability to approach challenges systematically and think critically to find solutions.
Attention to Detail: Write clean, maintainable code and pay attention to small details that can impact software quality.

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

Clear and organized format
Contact information (name, phone, email)
Professional summary/objective (tailored)
Key skills (relevant to the job)
Work experience (reverse chronological, achievements with quantifiable results)

Interview rounds

01
Round
Easy
Video Call
Duration60 minutes
Interview date28 Jan 2023
Coding problem2

2 Coding question were asked and interview was scheduled at 11 am.

1. Count Ways To Reach The N-th Stairs

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

You have been given a number of stairs. Initially, you are at the 0th stair, and you need to reach the Nth stair.


Each time, you can climb either one step or two steps.


You are supposed to return the number of distinct ways you can climb from the 0th step to the Nth step.

Note:

Note: Since the number of ways can be very large, return the answer modulo 1000000007.
Example :
N=3

Example

We can climb one step at a time i.e. {(0, 1) ,(1, 2),(2,3)} or we can climb the first two-step and then one step i.e. {(0,2),(1, 3)} or we can climb first one step and then two step i.e. {(0,1), (1,3)}.
Problem approach

Can be solve using recursion and DP.

Try solving now

2. Detect and Remove Loop

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

You have been given a Singly Linked List of integers, determine if it forms a cycle or not. If there is a cycle, remove the cycle and return the list.

A cycle occurs when a node's ‘next’ points back to a previous node in the list.

Problem approach

Given a singly linked list, you have to detect the loop and remove the loop from the linked list, if present. You have to make changes in the given linked list itself and return the updated linked list.

Try solving now
02
Round
Hard
Video Call
Duration60 minutes
Interview date28 Jan 2023
Coding problem2

1. MergeSort Linked List

Moderate
10m average time
90% success
0/80
Asked in companies
AdobeSamsung R&D InstituteHCL Technologies

You are given a Singly Linked List of integers. Sort the Linked List using merge sort.

Merge Sort is a Divide and Conquer algorithm. It divides the input into two halves, calls itself for the two halves, and then merges the two sorted halves. The merge() function is used for merging two halves. The merge(arr, L, M, R) is a key process that assumes that arr[L..M] and arr[M + 1...R] are sorted and merges the two sorted subarrays into one.

Problem approach

For a given Singly Linked List of integers, sort the list using the 'Merge Sort' algorithm.

Try solving now

2. Merge Two Binary Trees

Easy
15m average time
85% success
0/40
Asked in companies
Thought WorksAppleGrab

You are given roots of two binary trees, ‘ROOT1’ and ‘ROOT2’. You need to merge the two trees into a new binary tree. The merge rule is that if the two nodes overlap, then the sum of the two nodes values up as the new value of the merged node. Otherwise, the NOT null node will be used as the node of the new tree. Your task is to return the merged tree i.e. head of the new tree.

Note:

The merging process must start from the root nodes of both trees.

For example,

‘ROOT1’ = [1, 2, -1, -1, 3, -1, -1]  ‘ROOT2’ = [3, -1, -1].
The final tree would look like : [3, 2, -1, -1, 3, -1, -1], and the output will be printed in a pre-order way: 4 2 3.

Problem approach

You are given roots of two binary trees, ‘ROOT1’ and ‘ROOT2’. You need to merge the two trees into a new binary tree. The merge rule is that if the two nodes overlap, then the sum of the two nodes values up as the new value of the merged node. Otherwise, the NOT null node will be used as the node of the new tree. Your task is to return the merged tree i.e. head of the new tree.

Try solving now
03
Round
Medium
Video Call
Duration60 minutes
Interview date28 Jan 2023
Coding problem2

1. Cycle Detection in a Singly Linked List

Moderate
15m average time
80% success
0/80
Asked in companies
Morgan StanleyDunzoOYO

You are given a Singly Linked List of integers. Return true if it has a cycle, else return false.


A cycle occurs when a node's next points back to a previous node in the list.


Example:
In the given linked list, there is a cycle, hence we return true.

Sample Example 1

Problem approach

Detect a loop in a linked list using slow and fast pointers, or we can also use a hashmap.

Try solving now

2. Min binary partition

Easy
15m average time
85% success
0/40
Asked in companies
WalmartGrabGoogle inc

You are given a string ‘S’ of size ‘N’ where ’S’ contains only characters ‘0’ and ‘1’. Your task is to divide ‘S’ into ‘K’ contiguous substrings such that the following conditions hold true :

1. Let ‘X’ be a binary number formed by reading a substring of ‘S’ from left to right.
2. ‘X’ must not contain leading zeroes.
3. The decimal equivalent of ‘X’ must be a power of 5.
4. K must be the minimum possible.
Note :
If no such ‘K’ possible, then you need to return -1. 
Problem approach

You are given a string ‘S’ of size ‘N’ where ’S’ contains only characters ‘0’ and ‘1’. Your task is to divide ‘S’ into ‘K’ contiguous substrings such that the following conditions hold true :
1. Let ‘X’ be a binary number formed by reading a substring of ‘S’ from left to right.
2. ‘X’ must not contain leading zeroes.
3. The decimal equivalent of ‘X’ must be a power of 5.
4. K must be the minimum possible.

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

How do you remove whitespace from the start of a string?

Choose another skill to practice
Similar interview experiences
company logo
SDE - 1
2 rounds | 4 problems
Interviewed by Grab
873 views
0 comments
0 upvotes
company logo
SDE - 1
3 rounds | 5 problems
Interviewed by Grab
1090 views
0 comments
0 upvotes
company logo
SDE - 1
3 rounds | 5 problems
Interviewed by Grab
626 views
0 comments
0 upvotes
company logo
SDE - 1
2 rounds | 4 problems
Interviewed by Grab
592 views
0 comments
0 upvotes
Companies with similar interview experiences
company logo
SDE - 1
5 rounds | 12 problems
Interviewed by Amazon
115097 views
24 comments
0 upvotes
company logo
SDE - 1
4 rounds | 5 problems
Interviewed by Microsoft
58238 views
5 comments
0 upvotes
company logo
SDE - 1
3 rounds | 7 problems
Interviewed by Amazon
35147 views
7 comments
0 upvotes