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

SDE - 1

Phone Pe
upvote
share-icon
2 rounds | 5 Coding problems

Interview preparation journey

expand-icon
Preparation
Duration: 5 months
Topics: Docker, OOPs, Postgres, DBMS, Networking
Tip
Tip

Tip 1 : Practice questions on online platforms
Tip 2 : Understand the best solutions in depth and algorithm used
Tip 3 : Ask clarifying questions to the interviewer and break the problem to smaller sub parts

Application process
Where: Naukri
Eligibility:
Resume Tip
Resume tip

Tip 1 : Highlight your most impactful work on the resume
Tip 2 : Keep it easy to understand

Interview rounds

01
Round
Easy
Face to Face
Duration60 minutes
Interview date8 Apr 2022
Coding problem2

Given an array, check whether it is possible to get two numbers from the array with sum k.(the easy-this question is asked just for comforting purposes)
 

1. Number of Islands

Easy
0/40
Asked in companies
WalmartBNY MellonInfosys

You have been given a non-empty grid consisting of only 0s and 1s. You have to find the number of islands in the given grid.

An island is a group of 1s (representing land) connected horizontally, vertically or diagonally. You can assume that all four edges of the grid are surrounded by 0s (representing water).

Problem approach

Solved it using BFs

Try solving now

2. Reverse A LL

Moderate
30m average time
65% success
0/80
Asked in companies
AdobeHCL TechnologiesMicrosoft

Ninjas is practicing problems on the linked list. He came across a problem in which he has given a linked list of ‘N’ nodes and two integers, ‘LOW’ and ‘HIGH’. He has to return the linked list ‘HEAD’ after reversing the nodes between ‘LOW’ and ‘HIGH’, including the nodes at positions ‘LOW’ and ‘HIGH’.

Problem approach

Using two pointers and swaping nodes

Try solving now
02
Round
Easy
Face to Face
Duration60 minutes
Interview date11 Apr 2022
Coding problem3

This round is also based on DSA. 3 questions were asked.

1. Snake and Ladder

Moderate
30m average time
60% success
0/80
Asked in companies
CiscoCoinDCXPhone Pe

You have been given a Snake and Ladder Board with 'N' rows and 'N' columns with the numbers written from 1 to (N*N) starting from the bottom left of the board, and alternating direction each row.

For example

For a (6 x 6) board, the numbers are written as follows:

6*6 Board

You start from square 1 of the board (which is always in the last row and first column). On each square say 'X', you can throw a dice which can have six outcomes and you have total control over the outcome of dice throw and you want to find out the minimum number of throws required to reach the last cell.
Some of the squares contain Snakes and Ladders, and these are possibilities of a throw at square 'X':
You choose a destination square 'S' with number 'X+1', 'X+2', 'X+3', 'X+4', 'X+5', or 'X+6', provided this number is <= N*N.
If 'S' has a snake or ladder, you move to the destination of that snake or ladder.  Otherwise, you move to S.
A board square on row 'i' and column 'j' has a "Snake or Ladder" if board[i][j] != -1. The destination of that snake or ladder is board[i][j].
Note :
You can only take a snake or ladder at most once per move: if the destination to a snake or ladder is the start of another snake or ladder, you do not continue moving - you have to ignore the snake or ladder present on that square.

For example, if the board is:
-1 1 -1
-1 -1 9
-1 4 -1
Let's say on the first move your destination square is 2  [at row 2, column 1], then you finish your first move at 4 [at row 1, column 2] because you do not continue moving to 9 [at row 0, column 0] by taking the ladder from 4.

A square can also have a Snake or Ladder which will end at the same cell.
For example, if the board is:
-1 3 -1
-1 5 -1
-1 -1 9
Here we can see Snake/Ladder on square 5 [at row 1, column 1] will end on the same square 5.
Problem approach

I solved it using graphs

Try solving now

2. Minimum Number of Deletions and Insertions

Moderate
0/80
Asked in companies
MicrosoftPhone PeCoding Ninjas

You are given 2 non-empty strings 's1' and 's2' consisting of lowercase English alphabets only.


In one operation you can do either of the following on 's1':

(1) Remove a character from any position in 's1'.

(2) Add a character to any position in 's1'.


Find the minimum number of operations required to convert string 's1' into 's2'.


Example:
Input: 's1' = "abcd", 's2' = "anc"

Output: 3

Explanation:
Here, 's1' = "abcd", 's2' = "anc".
In one operation remove 's1[3]', after this operation 's1' becomes "abc".    
In the second operation remove 's1[1]', after this operation 's1' becomes "ac".
In the third operation add 'n' in 's1[1]', after this operation 's1' becomes "anc".

Hence, the minimum operations required will be 3. It can be shown that there's no way to convert s1 into s2 in less than 3 moves.


Problem approach

A simple approach is to consider all subsequences of str1 and for each subsequence calculate minimum deletions and insertions so as to transform it into str

Try solving now

3. Program to validate IP address

Easy
15m average time
85% success
0/40
Asked in companies
Phone PeOlaAmazon

You are given the text ‘IPAddress’. Your task is to check if the given text ‘IPAddress’ is a valid ‘IPv4’ or not.

Conditions for a valid ‘IPv4’ are:

1. Text form of ‘IPAddress’ must be ‘a.b.c.d’
2. The values of a,b,c and d can vary from ‘0’ to ‘255’ and both ‘0’ and ‘255’ are inclusive.
Problem approach

We will check all the cases where IP address may be invalid

1. First we will split the given input  using split() function then check if it has a length of 4  or not .If length  is not equal to 4 then we will directly return 0.

2. In second step we will check if any split element contains any leading zero or not .if it is then we will return zero.

3. If any of the split does not contain any number then it is not a valid IP address .so we will return 0

4. Then we will check if all the splits are in the range of  0-255 or not .If not we will return 0.

5. Finally if none of the above condition is true we can finally say that it is a valid IP address and we will return True.

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 create a function in JavaScript?

Choose another skill to practice
Start a Discussion
Similar interview experiences
company logo
SDE - 1
4 rounds | 6 problems
Interviewed by Phone Pe
2019 views
0 comments
0 upvotes
company logo
SDE - 1
5 rounds | 6 problems
Interviewed by Phone Pe
1791 views
0 comments
0 upvotes
company logo
SDE - 1
4 rounds | 7 problems
Interviewed by Phone Pe
1775 views
0 comments
0 upvotes
company logo
SDE - 1
4 rounds | 6 problems
Interviewed by Phone Pe
1305 views
0 comments
0 upvotes
Companies with similar interview experiences
company logo
SDE - 1
5 rounds | 12 problems
Interviewed by Amazon
106026 views
24 comments
0 upvotes
company logo
SDE - 1
4 rounds | 5 problems
Interviewed by Microsoft
50694 views
5 comments
0 upvotes
company logo
SDE - 1
3 rounds | 7 problems
Interviewed by Amazon
31561 views
6 comments
0 upvotes