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

SDE - 1

Swiggy
upvote
share-icon
3 rounds | 4 Coding problems

Interview preparation journey

expand-icon
Preparation
Duration: 3 months.
Topics: Data Structures, Algorithms , System Design , OOPs concept, DBMS, Operating System , LLD, Dynamic Programming.
Tip
Tip

Tip 1 : For Data Structure, either start with competitive coding like codechef or topic wise data structure question from Leetcode or GeeksforGeeks.(Advice to do 300 + coding question)
Tip 2 : Participate in different coding contest and hackathon 
Tip 3 : Try to solve the problem once, before viewing the solution, It is recommended to see all the optimise solution even after solving the question . 
Tip 4 : Can refer youtube channels for Low level design.
Tip 5 : Do at least do project , which will be reflected in your resume,

Application process
Where: Campus
Eligibility: No criteria as such.
Resume Tip
Resume tip

Tip 1: Always be ready be everything , which is mentioned in resume. 
Tip 2: Put at least 2 relevant Project in the resume .
Tip 3: Can put your competitive coding profiles in the resume (CodeChef profile)

Interview rounds

01
Round
Easy
Online Coding Interview
Duration90 minutres
Interview date19 Nov 2021
Coding problem1

A Hackerrank coding link was received on the email, which have a expiration of 7 days. You can attempt the test at any time before it get expired.

1. Minimum Knight Moves

Hard
0/120
Asked in companies
SwiggyAmazonMathworks

You are given an infinite chessboard (ie: the x-coordinates and y-coordinates can be anything between -infinity to +infinity).

You have a knight placed at coordinates ‘(0, 0)’. Find the minimum number of steps needed to move the knight to ‘(X, Y)’.

The knight has 8 possible moves, each move is two units in a cardinal direction, then one unit in an orthogonal direction.

For example :

As depicted in the photo below, the knight currently at (0, 0) can move to any of the 8 positions: (1, 2), (2, 1), (2, -1), (1, -2), (-1, -2), (-2, -1), (-2, 1), (-1, 2).

Example :
If X = 1 and Y = -1, then we need to find out the minimum number of steps to move the knight from (0, 0) to (1, -1).

We need at least 2 steps to move the knight to the desired position.

First move: (0, 0) -> (2, 1) 

Second move: (2,1) -> (1, -1)

Here we can see that there are many ways, but we need at least 2 steps. Therefore we will return the value 2.
Problem approach

If a+b is odd/even x+y also needs to be odd/even else return -1;
if a==x && b==y return 0;
if a+b==c+d || a-b==c-d return 1;
else return 2;

This was the normal math logic.

Try solving now
02
Round
Medium
Video Call
Duration60 minutes
Interview date23 Dec 2021
Coding problem2

It was around at 4 pm timing. . The round was 1:1 . It mostly focussed on problem solving. The interviewr was very helpful.

1. Minimum steps to reach target by a Knight

Moderate
25m average time
60% success
0/80
Asked in companies
MicrosoftIntuitSwiggy

You have been given a square chessboard of size ‘N x N’. The position coordinates of the Knight and the position coordinates of the target are also given.

Your task is to find out the minimum steps a Knight will take to reach the target position.

alt text

Example:
knightPosition: {3,4}
targetPosition: {2,1}

alt text

The knight can move from position (3,4) to positions (1,3), (2,2) and (4,2). Position (4,2) is selected and the ‘stepCount’ becomes 1. From position (4,2), the knight can directly jump to the position (2,1) which is the target point and ‘stepCount’ becomes 2 which is the final answer. 

Note:

1. The coordinates are 1 indexed. So, the bottom left square is (1,1) and the top right square is (N, N).

2. The knight can make 8 possible moves as given in figure 1.

3. A Knight moves 2 squares in one direction and 1 square in the perpendicular direction (or vice-versa).
Problem approach

One can apply Breadth first search approach. It will be easily solvable. Just a simple version of BFS.

Try solving now

2. Min Jumps

Easy
15m average time
85% success
0/40
Asked in companies
American ExpressSamsung R&D InstituteIntuit

You live in a Ninja town which is in the form of a N * M grid. In this town, people travel from one place to another by jumping over the buildings which are present in each cell of the grid. It is Christmas eve, and Santa wants to give gifts and chocolates to the kids who live in the building which is present at the cell (N - 1, M - 1). Initially, Santa is present on cell (0, 0). Since Santa is in a hurry, help him find a path from starting point to the endpoint with the least amount of time.

The Santa may go only from one building to any of its adjacent buildings which is present either to the right or to the bottom or bottom right cell i.e. if the current position is (x, y), he may go to (x + 1, y + 1) or (x + 1, y) or (x, y + 1) given that the new coordinates are in the grid. The time taken to reach from one building to another is equal to the absolute difference between the heights of buildings.

Note:

1. The heights of the buildings are positive.
2. Santa starts from the cell (0, 0) and he has to reach the building (N - 1, M - 1).
3. Santa cannot leave the grid at any point of time.
Problem approach

The main idea is based on greedy. Let's say the range of the current jump is [curBegin, curEnd], curFarthest is the farthest point that all points in [curBegin, curEnd] can reach. Once the current point reaches curEnd, then trigger another jump, and set the new curEnd with curFarthest, then keep the above steps, as the following:

Try solving now
03
Round
Easy
Video Call
Duration120 mins
Interview date26 Nov 2021
Coding problem1

Design the Splitwise system ,

1. Design question

How to design Splitwise

Problem approach

Tip 1: Collect more and more information from interviewer. 
Tip 2: Try to start build with basic functionality and at the same time start writing the entity. Always think loud, so that interviewer can also know what you are thinking, and even can help you . 
Tip 3: Firstly try to wrap the basic functionality, rather than deep dive in complex features.

Here's your problem of the day

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

Skill covered: Programming

To make an AI less repetitive in a long paragraph, you should increase:

Choose another skill to practice
Similar interview experiences
company logo
SDE - 1
4 rounds | 9 problems
Interviewed by Swiggy
2419 views
0 comments
0 upvotes
company logo
SDE - 1
4 rounds | 7 problems
Interviewed by Swiggy
1992 views
1 comments
0 upvotes
company logo
SDE - 1
3 rounds | 10 problems
Interviewed by Swiggy
1516 views
0 comments
0 upvotes
company logo
SDE - 1
3 rounds | 4 problems
Interviewed by Swiggy
1931 views
0 comments
0 upvotes
Companies with similar interview experiences
company logo
SDE - 1
5 rounds | 12 problems
Interviewed by Amazon
114453 views
24 comments
0 upvotes
company logo
SDE - 1
4 rounds | 5 problems
Interviewed by Microsoft
57719 views
5 comments
0 upvotes
company logo
SDE - 1
3 rounds | 7 problems
Interviewed by Amazon
34914 views
7 comments
0 upvotes