Paytm (One97 Communications Limited) interview experience Real time questions & tips from candidates to crack your interview

SDE - 1

Paytm (One97 Communications Limited)
upvote
share-icon
4 rounds | 9 Coding problems

Interview preparation journey

expand-icon
Preparation
Duration: 4 months
Topics: Data Structures, OOPS, Dynamic Programming, Recursion, Advanced Data Structures, Operating System, Time complexity analysis and Sorting Algorithms
Tip
Tip

Tip 1 : Properly grasp Data Structures and Algorithms from basics.
Tip 2 : Learn about Time complexity 
Tip 3 : Be honest and walk through your thought process to the interviewer.
Tip 4 : Its always good to be presentable and have good communications skills

Application process
Where: Campus
Eligibility: above 7 CGPA, No active backlogs
Resume Tip
Resume tip

Tip 1 : Never Lie on your resume. Only write what you have done and what you know.
Tip 2 : It's good to have one or two projects on your resume. Mention the tech stack you used and a brief description of the project. It will be best if you host/upload your project on the cloud.
Tip 3 : Avoid unnecessary details like Hobbies, family details, declaration, date, signature, etc.
Tip 4 : You're more than a 1-page resume. But your resume should not be more than a page

Interview rounds

01
Round
Easy
Online Coding Interview
Duration70 minutes
Interview date17 Aug 2020
Coding problem3

The first round was the Online Coding Round of 70 minutes with 3 problems of 3 marks, 3 marks, and 4 marks respectively.
The first two questions were easy and the third one was a bit tricky. The round started at 6 PM. 
Anyone who is practicing continuously could have solved these questions easily within the time limit. The test cases were also not so hard and distinct. I coded in C++ language.
The questions asked were-
1. Minimum insertions required to make a string palindrome
2. To find the distance of the closest leaf from a node with given data.
3. Add two numbers represented by linked lists

22 students were selected for the next round.

1. Minimum insertions to make a string palindrome

Moderate
30m average time
70% success
0/80
Asked in companies
AdobeTata Consultancy Services (TCS)Facebook

A palindrome string is one that reads the same backward as well as forward.


You are given a string 'str'.


Find the minimum number of characters needed to insert in 'str' to make it a palindromic string.


Example :
Input: 'str' = "abca"

Output: 1

Explanation:
If we insert the character ‘b’ after ‘c’, we get the string "abcba", which is a palindromic string. Please note that there are also other ways possible.


Problem approach

I used a recursive approach to solve the problem.
Let's say we have a string S[L.......H].
Then our solution can be found as-
if(S[L]==S[H])
minInsertion(S[L+1....H-1]
else (minInsertion(S[L....H-1]), minInsertion(S[L+1....H])+1)

Try solving now

2. Closest Leaf To Given Node In Binary Tree

Moderate
15m average time
85% success
0/80
Asked in companies
Paytm (One97 Communications Limited)Paytm (One97 Communications Limited)GoDigitley

Ninja is stuck in a maze which is in a form of a binary tree. He needs your help in order to get out.

Ninja is presently at the node ‘X’. The only exit points of the maze are the leaf nodes of the tree. You need to tell him the distance to the nearest exit point from his current location. This will help him decide which path he should take in order to escape from the maze.

Example:

sample tree 1

Suppose, Ninja is stuck at node 62. The possible exit points in the maze are: 40, 10, and 20. From all the possible exit points the closest ones are 10 and 20 which are at a distance of 1 unit.
Problem approach

I used a simple traverse approach to solve the question.
The idea was to first traverse the subtree rooted with give node and find the closest leaf in this subtree. Store this distance. Now traverse tree starting from root. If given node x is in left subtree of root, then find the closest leaf in right subtree, else find the closest left in left subtree.

Try solving now

3. Add two linked lists

Moderate
10m average time
80% success
0/80
Asked in companies
QuikrMicrosoftAccenture

You have been given two singly Linked Lists, where each of them represents a positive number without any leading zeros.

Your task is to add these two numbers and print the summation in the form of a linked list.

Example:
If the first linked list is 1 -> 2 -> 3 -> 4 -> 5 -> NULL and the second linked list is 4 -> 5 -> NULL.

The two numbers represented by these two lists are 12345 and 45, respectively. So, adding these two numbers gives 12390. 

So, the linked list representation of this number is 1 -> 2 -> 3 -> 9 -> 0 -> NULL.
Problem approach

I used an optimized approach to solve it.
1. Reverse Both Lists
2. Now traverse both lists and add numbers
3. Reverse resultant linked list and return head

Try solving now
02
Round
Easy
Video Call
Duration80 minutes
Interview date18 Aug 2020
Coding problem3

It was a technical interview. The platform used was google meet for online video calling. The interviewer first introduced himself then asked me to introduce myself. He also asked about my well-being amid the Covid-19 pandemic. He asked me 3 problems from data structures. He put a lot of focus on my project. We discussed about my project for about 20 mins. He asked various questions related to my project and I answered them confidently. After 70-75 mins he said that interview was over and that I may ask him anything. I asked him to give me feedback about my resume and my project. He gave me advice to improve my resume and the interview was over. The first technical interview was easy and was not so challenging as I was prepared.

1. Two Sum

Easy
10m average time
90% success
0/40
Asked in companies
Hexaware TechnologiesFacebookAmazon

You are given an array of integers 'ARR' of length 'N' and an integer Target. Your task is to return all pairs of elements such that they add up to Target.

Note:

We cannot use the element at a given index twice.

Follow Up:

Try to do this problem in O(N) time complexity. 
Problem approach

It is quite an easy problem if you know about arrays.
1. Firstly I sorted the array
2. Then I took 2 pointers.
3. I iterated one from start and other from end and checked sum at each step.
4. I returned the value of element if sum equals K else continue until start<= last

Try solving now

2. Quick Sort

Moderate
10m average time
90% success
0/80
Asked in companies
IBMFreshworksCognizant

You are given an array of integers. You need to sort the array in ascending order using quick sort.

Quick sort is a divide and conquer algorithm in which we choose a pivot point and partition the array into two parts i.e, left and right. The left part contains the numbers smaller than the pivot element and the right part contains the numbers larger than the pivot element. Then we recursively sort the left and right parts of the array.

Example:

Let the array = [ 4, 2, 1, 5, 3 ]
Let pivot to be the rightmost number.

example

After the 1st level partitioning the array will be { 2, 1, 3, 4, 5 } as 3 was the pivot. After 2nd level partitioning the array will be { 1, 2, 3, 4, 5 } as 1 was the pivot for the left part and 5 was the pivot for the right part. Now our array is sorted and there is no need to divide it again.

Problem approach

I explained the algorithm of Quick Sort and wrote its code in C++.He also asked me to explain its time complexity.

Try solving now

3. Merge Sort

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

Given a sequence of numbers ‘ARR’. Your task is to return a sorted sequence of ‘ARR’ in non-descending order with help of the merge sort algorithm.

Example :

Merge Sort Algorithm -

Merge sort is a Divide and Conquer based Algorithm. It divides the input array into two-parts, until the size of the input array is not ‘1’. In the return part, it will merge two sorted arrays a return a whole merged sorted array.

subsequence

The above illustrates shows how merge sort works.
Note :
It is compulsory to use the ‘Merge Sort’ algorithm.
Problem approach

I explained the algorithm of Merge Sort and wrote its code in C++.He also asked me to explain its time complexity.

Try solving now
03
Round
Medium
Video Call
Duration60 minutes
Interview date18 Aug 2020
Coding problem2

This was also a technical round. The interviewer focused on data structures and resume. Apart from some basic questions about my resume, he asked majorly about data structures and algorithms. The interview was an hour long and he asked only 2 problems. Both of them were from trees. In this round, he focused if I can change my approach if a slight change is made in the question. Like he asked me to write code for inorder traversal. Obviously, I used a recursive approach. He then asked me to use the iterative method to find inorder traversal of the tree.

The questions he asked were-
1. Inorder traversal (both recursive and iterative method)
2. Level Order Traversal
( For obvious reasons I knew level order traversal very well. I coded it swiftly, so he asked me to write code for Zig-Zag traversal)

1. Inorder Sucessor

Moderate
30m average time
65% success
0/80
Asked in companies
SAP LabsInnovaccerAmazon

You have been given an arbitrary binary tree and a node of this tree. You need to find the inorder successor of this node in the tree.

The inorder successor of a node in a binary tree is that node that will be visited immediately after the given node in the inorder traversal of the tree. If the given node is visited last in the inorder traversal, then its inorder successor is NULL.

The inorder traversal of a binary tree is the traversal method in which for any node its left subtree is visited first, then the node itself, and then the right subtree.

Note
1. Each node is associated with a unique integer value. 

2. The node for which the successor is to be found is guaranteed to be part of the tree.
Problem approach

1) Create an empty stack S.
2) Initialize current node as root
3) Push the current node to S and set current = current->left until current is NULL
4) If current is NULL and stack is not empty then
a) Pop the top item from stack.
b) Print the popped item, set current = popped_item->right
c) Go to step 3.
5) If current is NULL and stack is empty then we are done.

 

Try solving now

2. zig zag traversal

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

You have been given a Binary Tree of 'N' nodes, where the nodes have integer values. Your task is to print the zigzag traversal of the given tree.

Note:
In zigzag order, level 1 is printed from left to right fashion, level 2 is printed from right to left. and level 3 is printed from left to right again, and so on…..
For example:
For the given binary tree

1

The zigzag  traversal is [1, 4, 3, 5, 2, 7, 6]
Problem approach

1. Zigzag traversal can be implemented using two stacks.
2. Keep track of the direction to traverse using the bool variable isLtoR. If isLtoR is true, then the current level needs to be traversed from left to right and vice versa.
3. Push the root node into curr and set isLtoR to false for the next level.
4. Pop a node from curr and store it in the variable temp. Deduce the direction from isLtoR and decide, depending on the direction, whether the left child or the right child is to be pushed into next first.
5. Repeat the above step until curr is empty. When it is empty, swap the two stacks so that next becomes the emptied curr and curr becomes next.
6. Repeat the steps above until curr is eventually empty.

Try solving now
04
Round
Medium
Video Call
Duration50 minutes
Interview date18 Aug 2020
Coding problem1

This was the final round of the Interview process. My interview was scheduled for 7.30 PM. It started at approximately 7.40 PM. The main focus of the interviewer was on my projects and my skills. He asked me many questions regarding my project like what problems I faced, what did you learn from this, apart from developing skills what else did you learn while developing the project, why did you use this tech instead of this, security features, scalability of the project and many more. I answered almost every question as perfectly as I can. Later he asked me some basic questions from NodeJS (as I am a full stack developer). In the end, he asked a puzzle. I didn't know the solution to the puzzle but we discussed it and I figured out the solution.

1. Camel and banana puzzle

A person has 3000 bananas and a camel. He wants to transport the maximum number of bananas to a destination 1000 KMs away, using only the camel as a mode of transportation. The camel cannot carry more than 1000 bananas at a time and eats a banana every km it travels. What is the maximum number of bananas that can be transferred to the destination using only camel (no other mode of transportation is allowed). 

Problem approach

Tip 1 : Instead of traveling the full distance in one go, divide the distance into 2/3 Parts.
Tip 2 : Try to maintain the number of remaining bananas multiple of 1000 at each intermediate point.

Here's your problem of the day

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

Skill covered: Programming

Which operator is used for exponentiation in Python?

Choose another skill to practice
Similar interview experiences
company logo
SDE - 1
2 rounds | 3 problems
Interviewed by Paytm (One97 Communications Limited)
647 views
0 comments
0 upvotes
company logo
SDE - 1
2 rounds | 5 problems
Interviewed by Paytm (One97 Communications Limited)
526 views
0 comments
0 upvotes
company logo
SDE - 1
3 rounds | 10 problems
Interviewed by Paytm (One97 Communications Limited)
340 views
0 comments
0 upvotes
company logo
SDE - 1
3 rounds | 8 problems
Interviewed by Paytm (One97 Communications Limited)
309 views
0 comments
0 upvotes
Companies with similar interview experiences
company logo
SDE - 1
5 rounds | 12 problems
Interviewed by Amazon
107483 views
24 comments
0 upvotes
company logo
SDE - 1
4 rounds | 5 problems
Interviewed by Microsoft
51829 views
5 comments
0 upvotes
company logo
SDE - 1
3 rounds | 7 problems
Interviewed by Amazon
32108 views
6 comments
0 upvotes