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
Journey
Started coding 2 years back when I was in 2nd year. I got to know that to get an job we have to do some coding type stuff. I started with basic coding and started with hackerank and gradually increases the difficulty of the problem. After that I moved to leetcode and firstly I solved problems on the basis of tags first easy then medium then hard. Do all the standard problem of each topic.
Application story
So basically, it was an on-campus opportunity. The company has visited our college to hire final-year students for the full-time role. There were three rounds of interviews and one online test round.
Why selected/rejected for the role?
Not able to give answers of all the theoretical questions and was not able to provide the solution in optimal way
Preparation
Duration: 5 months
Topics: DP, Graph, Greedy, Tree, Arrray, Hashmaps
Tip
Tip

Tip 1 : Be consistent in coding and contests
Tip 2 : Should have knowledge of system design not whole but basic
Tip 3 : Should have knowledge of design questionsTip 1 :Be consistent in coding and contests
Tip 2 : Should have knowledge of system design not whole but basic
Tip 3 : Should have knowledge of design questions

Application process
Where: Campus
Eligibility: 8 cgpa and above
Resume Tip
Resume tip

Tip 1: Have at least one project on your resume
Tip 2: resume should be one page only, strictly
Tip 3: Put some achievements, like you got a good rank in a coding contest, to help you stand out

Interview rounds

01
Round
Medium
Online Coding Interview
Duration90 mins
Interview date5 Aug 2022
Coding problem3

It was in the morning time at 9 am

1. Aggressive Cows

Moderate
30m average time
70% success
0/80
Asked in companies
AdobeGoldman SachsDunzo

You are given an array 'arr' consisting of 'n' integers which denote the position of a stall.


You are also given an integer 'k' which denotes the number of aggressive cows.


You are given the task of assigning stalls to 'k' cows such that the minimum distance between any two of them is the maximum possible.



Example:
Input: 'n' = 3, 'k' = 2 and 'arr' = {1, 2, 3}

Output: 2

Explanation: The maximum possible minimum distance will be 2 when 2 cows are placed at positions {1, 3}. Here distance between cows is 2.
Problem approach

Follow the steps to solve the problem:

Apply a binary search between 1 and the maximum element of the array.
Each time find the middle element of the search space.
If that middle element can be a possible minimum distance store it as a possibility until we find a better answer, then move in the right direction in the search space.
Else, we will move left in our search space.
When the binary search is complete, return the answer.

Try solving now

2. Ninja And Matrix

Easy
15m average time
85% success
0/40
Asked in companies
Phone PeVirsoftech Private Limited

Ninja loves patterns and visuals and recently he learned about 2-dimensional matrices now he wants to use his pattern skills on it. He has been provided with a 2-dimensional matrix with a size of ‘N’x’N’ and he wants to print the matrix in a snake pattern. Formally speaking he wants to print every odd indexed row in reverse order(0-indexed) and even indexed row as it is on a single line.

EXAMPLE:
Input: 'N' = 2, ‘MAT’ = [[1, 2], [5, 6]]

Output: 1 2 6 5

 So the first row will be printed as it is and the second row will be printed in reverse order.
Try solving now

3. Unlock Briefcase

Moderate
30m average time
70% success
0/80
Asked in companies
OlaPhone PePhone Pe

There is a briefcase protected by a lock with 4 circular wheels. The password is a sequence of 4 digits.

1. Each wheel has 10 slots: ‘0’, ‘1’, ‘2’, ‘3’, ‘4’, ‘5’, ‘6’, ‘7’, ‘8’, ’9’.

2. The wheels can rotate freely and wrap around, ‘9’ can be left rotated to ‘8’ and right rotated to ‘0’, similarly ‘0’ can be right rotated to ‘1’ and left rotated to ‘9’. Rotation of one wheel counts to one rotation.

3. Initially, the lock starts at “0000”, a string representing the state of four wheels. 

You are given a list of dead ends (codes of 4 digits), meaning if at any point the lock displays any of these codes, the wheels of the lock will stop turning, and you will be unable to open it.

Given a target representing the code that will unlock the briefcase, return the minimum total number of turns required to open the lock, or -1 if it is not possible.

Problem approach

For a single ring we can rotate it in any of two direction forward or backward as: 


0->1->2….->9->0
9->8->….0->9
But we are concerned with minimum number of rotation required so we should choose min (abs(a-b), 10-abs(a-b)) as a-b denotes the number of forward rotation and 10-abs(a-b) denotes the number of backward rotation for a ring to rotate from a to b. Further we have to find minimum number for each ring that is for each digit. So starting from right most digit we can easily the find minimum number of rotation required for each ring and end up at left most digit.

Try solving now
02
Round
Hard
Video Call
Duration60 mins
Interview date6 Aug 2022
Coding problem2

It was at the morning time at 9 am
The interviewer introduced himself and asked me the same.
He asked about my work experience of internship.
He asked me to explain the solutions of the online round questions.

1. OS Questions

What is kenral
What is mutex , thread , locks
Asked about sparse matrix and how to make it efficient

2. Dijkstra's shortest path

Moderate
25m average time
65% success
0/80
Asked in companies
Tata Consultancy Services (TCS)Deutsche BankPhone Pe

You have been given an undirected graph of ‘V’ vertices (labeled 0,1,..., V-1) and ‘E’ edges. Each edge connecting two nodes (‘X’,’Y’) will have a weight denoting the distance between node ‘X’ and node ‘Y’.

Your task is to find the shortest path distance from the source node, which is the node labeled as 0, to all vertices given in the graph.

Example:

Input:
4 5
0 1 5
0 2 8
1 2 9
1 3 2
2 3 6

alt text

In the given input, the number of vertices is 4, and the number of edges is 5.

In the input, following the number of vertices and edges, three numbers are given. The first number denotes node ‘X’, the second number denotes node ‘Y’ and the third number denotes the distance between node ‘X’ and ‘Y’.

As per the input, there is an edge between node 0 and node 1 and the distance between them is 5.

The vertices 0 and 2 have an edge between them and the distance between them is 8.
The vertices 1 and 2 have an edge between them and the distance between them is 9.
The vertices 1 and 3 have an edge between them and the distance between them is 2.
The vertices 2 and 3 have an edge between them and the distance between them is 6.

Note:

1. There are no self-loops(an edge connecting the vertex to itself) in the given graph.

2. There can be parallel edges i.e. two vertices can be directly connected by more than 1 edge.
Problem approach

Was not able to solve it inefficient time as I was doing it with the help of bfs

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
4 rounds | 7 problems
Interviewed by Phone Pe
1776 views
0 comments
0 upvotes
company logo
SDE - 1
2 rounds | 5 problems
Interviewed by Phone Pe
0 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
50696 views
5 comments
0 upvotes
company logo
SDE - 1
3 rounds | 7 problems
Interviewed by Amazon
31562 views
6 comments
0 upvotes