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
3 rounds | 6 Coding problems

Interview preparation journey

expand-icon
Preparation
Duration: 3 Months
Topics: Data structures, algorithms, Dynamic Programming, Graphs, Trees, Stacks, Queues, Linked List
Tip
Tip

Tip 1 : Try to understand the basics of every topic. 
Tip 2 : Try to spend atleast 15-20 mins for reading the problem and thinking of bruteforce approach
Tip 3 : Try to do pen-paper coding.

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

Tip 1 : Keep the information on resume crisp and legitimate
Tip 2 : Have atleast 2 projects . Know the ins and outs of those projects.

Interview rounds

01
Round
Medium
Online Coding Interview
Duration90 Minutes
Interview date9 Aug 2020
Coding problem2

The round was at 10 AM . The questions asked were 2 medium level questions. The camera monitoring was constantly on.

1. Next Greater Element

Easy
10m average time
90% success
0/40
Asked in companies
MicrosoftAmazonPaytm (One97 Communications Limited)

You have been given an array/list ‘ARR’ consisting of ‘N’ positive integers. Your task is to return the Next Greater Element(NGE) for every element.

The Next Greater Element for an element ‘X’ is the first element on the right side of ‘X’ in the array 'ARR', which is greater than ‘X’. If no such element exists to the right of ‘X’, then return -1.

For example:
For the given array 'ARR' = [7, 12, 1, 20]

The next greater element for 7 is 12.
The next greater element for 12 is 20. 
The next greater element for 1 is 20. 
There is no greater element for 20 on the right side.

So, the output is [12, 20, 20, -1].
Try solving now

2. Ways To Make Coin Change

Moderate
20m average time
80% success
0/80
Asked in companies
SamsungBNY MellonIBM

You are given an infinite supply of coins of each of denominations D = {D0, D1, D2, D3, ...... Dn-1}. You need to figure out the total number of ways W, in which you can make a change for value V using coins of denominations from D. Print 0, if a change isn't possible.

Problem approach

It was a dp problem. Firstly I used recursion to solve it.

static int count(int S[], int m, int n)
{

// If n is 0 then there is 1 solution
// (do not include any coin)
if (n == 0)
return 1;

// If n is less than 0 then no
// solution exists
if (n < 0)
return 0;

// If there are no coins and n
// is greater than 0, then no
// solution exist
if (m <= 0)
return 0;

// count is sum of solutions (i)
// including S[m-1] (ii) excluding S[m-1]
return count(S, m - 1, n) +
count(S, m, n - S[m - 1]);
}

It was an exponential solution ie TC - 2^n

We then used an array which reduced TC to n^2

static long countWays(int S[], int m, int n)
{
//Time complexity of this function: O(mn)
//Space Complexity of this function: O(n)

// table[i] will be storing the number of solutions
// for value i. We need n+1 rows as the table is
// constructed in bottom up manner using the base
// case (n = 0)
long[] table = new long[n+1];

// Initialize all table values as 0
Arrays.fill(table, 0); //O(n)

// Base case (If given value is 0)
table[0] = 1;

// Pick all coins one by one and update the table[]
// values after the index greater than or equal to
// the value of the picked coin
for (int i=0; i for (int j=S[i]; j<=n; j++)
table[j] += table[j-S[i]];

return table[n];
}

Try solving now
02
Round
Medium
Video Call
Duration60 Minutes
Interview date10 Aug 2020
Coding problem2

The round was at 11 AM. The interviewer was polite. The camera monitoring was on constantly.

1. String Sorting

Moderate
30m average time
60% success
0/80
Asked in companies
FacebookHCL TechnologiesPaytm (One97 Communications Limited)

You and your friend found a string ‘S’ of length ‘N’. You love to rearrange the strings, So you decided to rearrange this string too. But this time, your friend puts a constraint on rearranging. He gave you ‘M’ pairs of integers, each pair denoting two indices of the string ‘S’. He also gave you an operation. In one operation, you can select a pair of indices from the given ‘M’ pairs and swap the character present at those indices in the string.

Your task is to rearrange the strings following the given constraints and find the lexicographically smallest string that you can obtain by doing the operations any number of times (might be 0 as well).

Try solving now

2. Longest Increasing Subsequence

Moderate
0/80
Asked in companies
Paytm (One97 Communications Limited)PayUGoldman Sachs

'N' students are standing in a row. You are given the height of every student standing in the row. Your task is to find the longest strictly increasing subsequence of heights from the row such that the relative order of the students does not change.

A subsequence is a sequence that can be derived from another sequence by deleting zero or more elements without changing the order of the remaining elements.
Problem approach

It was a basic DP problem and the interviewer wanted to see my solution building approach.
I started of by using recursion. which took exponential time.

L(i) = 1 + max( L(j) ) where 0 < j < i and arr[j] < arr[i]; or
L(i) = 1, if no such j exists.

I then used an array to build the optimal approach by comparing the previous occurring array elements with the current one.

public int lengthOfLIS(int[] nums) {

int m = nums.length;

if(m==0)return 0;

int[] dp = new int[m+1];

Arrays.fill(dp,1);

int max = Integer.MIN_VALUE;

for(int i=0;i {
//System.out.println(Arrays.toString(dp));
for(int j=0;j 
if(nums[j] dp[i]=Math.max(dp[i],dp[j]+1);

}

max = Math.max(max,dp[i]);

}
return max;
}

Try solving now
03
Round
Medium
Video Call
Duration60 Minutes
Interview date11 Aug 2020
Coding problem2

The round was at 4 PM . The camera was on. The interviewer was technical lead in Paytm Fastag team.

1. LCA of Two Nodes In A BST

Moderate
15m average time
85% success
0/80
Asked in companies
ShareChatSamsungAmazon

You are given a binary search tree of integers with N nodes. You are also given references to two nodes 'P' and 'Q' from this BST.


Your task is to find the lowest common ancestor(LCA) of these two given nodes.


The lowest common ancestor for two nodes P and Q is defined as the lowest node that has both P and Q as descendants (where we allow a node to be a descendant of itself)


A binary search tree (BST) is a binary tree data structure which has the following properties.

• The left subtree of a node contains only nodes with data less than the node’s data.
• The right subtree of a node contains only nodes with data greater than the node’s data.
• Both the left and right subtrees must also be binary search trees.


For example:
'P' = 1, 'Q' = 3
tree = 2 1 4 -1 -1 3 -1 -1 -1,

The BST corresponding will be- 

Here, we can clearly see that LCA of node 1 and node 3 is 2.
Problem approach

For Binary search tree, while traversing the tree from top to bottom the first node which lies in between the two numbers n1 and n2 is the LCA of the nodes, i.e. the first node n with the lowest depth which lies in between n1 and n2 (n1<=n<=n2) n1 < n2. So just recursively traverse the BST in, if node’s value is greater than both n1 and n2 then our LCA lies in the left side of the node, if it’s is smaller than both n1 and n2, then LCA lies on the right side. Otherwise, the root is LCA (assuming that both n1 and n2 are present in BST).

Algorithm: 

1. Create a recursive function that takes a node and the two values n1 and n2.
2. If the value of the current node is less than both n1 and n2, then LCA lies in the right subtree. Call the 
recursive function for the right subtree.
3. If the value of the current node is greater than both n1 and n2, then LCA lies in the left subtree. Call the 
recursive function for the left subtree.
4. If both the above cases are false then return the current node as LCA

Try solving now

2. SQL Questions

The interviewer asked me various questions. 
1. What is the difference between SQL and NO-SQL dbs as I used mongo db in one of the projects?
2. What are joins in SQL.

Problem approach

Tip 1 : Always prepare your projects well enough.
Tip 2 : You should be aware of the basics of tech stack used in your projects.
Tip 3 : Prepare basics of SQL. Basic joins and where clause queries should be prepared well.

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
2 rounds | 3 problems
Interviewed by Paytm (One97 Communications Limited)
923 views
0 comments
0 upvotes
company logo
SDE - 1
2 rounds | 5 problems
Interviewed by Paytm (One97 Communications Limited)
716 views
0 comments
0 upvotes
company logo
SDE - 1
3 rounds | 10 problems
Interviewed by Paytm (One97 Communications Limited)
541 views
0 comments
0 upvotes
company logo
SDE - 1
3 rounds | 8 problems
Interviewed by Paytm (One97 Communications Limited)
521 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