# Paytm Interview Experience for Software Engineer | 6-Months Internship (On Campus-NIT PATNA)

**Round 1:** Online coding round: This round was of 70 minutes and there was 3 coding question to be solved in 70 minutes. one question was easy category; one was of easy to medium level and the third question was of dynamic programming(hard).

- Given a number, return a new number obtained by removing all alternate digits of the number starting from the 2nd digit on left.
- In an array of numbers, segregate numbers in such a way that odd numbers are at odd index and even numbers are in even index. Make sure that the relative ordering of numbers should not be changed i.e., the relative ordering of even numbers should not change among themselves and relative ordering of odd numbers also should not be changed among themselves. The rearrangement was to be done in place and the 0th index of the array should contain an even number.
- How many occurrences of a given search word can you find in a two-dimensional array of characters given that the word can go up, down, left, right, diagonally in all 4 directions?
**Example:**word: hello**Board:**h e l l t p h o

**Output:**2 (as we can see that 2-hello word can be formed from board letters)

After this round 66 students were selected out of 146 students.

**Round 2(technical interview round 1): **This was the interview of 45 minutes. The interviewer asked me the following questions in sequence:

- Tell me about yourself
- Most recent project u did and its technology stack.
- Which data structures u know about.
- What is the difference between tree and heap?
- He shared with me a coding IDE(codeshare) and asked me to detect a loop in a linked list and remove it if it is there. First, he asked me about the approach and when he was satisfied, he told me to code for it. (He asked about time complexities and space complexity of code)
- After this, he asked what is a group by clause in SQL.
- Difference between group by and order by clause.

After this, I was selected for the next round of interviews where about 34 students were selected out of 66.

**Round 3(Technical interview round 2): **This was pure coding; data structures round and the total time was 45 minutes.

You are given a sorted array in which all the numbers are positive. Now, -1 is inserted between these positive numbers such that no of -1 inserted lies always between 0 and 2 (not more than 2). Also, we know that the first and last element of the array is always a positive number.

**Example:**If original array = 2 5 8 12 14 17Array after -1 inserted = 2 -1 5 -1 -1 8 12 -1 -1 14 -1 -1 17 So the given array is arr[]={2, -1 ,5 ,-1, ,-1, 8, 12, -1, -1, 14 ,-1, -1,17} A key is given let say key=5.

How will you search for the given key in the most optimized way? (O(logn))

He first asked the approach of the problem and then told me to code it. I coded it using modified binary search and he was pretty impressed with my code.

Then he asked me to write some time complexities. Like, he asked to write a code that will produce O(2^n) time complexity, a code that will give O(nlogn) time complexity, and a code that gives O(logn.2^n) time complexity.

Then the last question as he gave a binary array containing only 1s and 0s, and I was required to find the maximum length of subarray such that the number of 0 is equal to the number of 1 in that subarray.

Initially, I solved using an extra prefix array, but he wanted me to make it more optimized, then he helped me with the idea that I can remove the whole prefix array, so I removed that array and instead used two variables current and previous to solve this question.

- What does a DNS server do?
- What are the components of IP address? 173::172::25::36 This IP address belongs to IPV6 or IPv4 and how can u say that?
- Write c++ code demonstrating inheritance and composition.
- What is indexing in the database?
- What is the difference between GET, PUT, and POST requests?
- What is the difference between HTTP and HTTPS?
- Difference between Node js and JavaScript?
- Full form of PEP in python?
- What is the ICMP protocol?
- Then the final coding question was given a tree with left, right, and random pointer, u have to create a copy of the same tree and return the head of the copied tree.

The third round was more of coding, optimized simple code with a good structure and speed which is easily comprehendible.

**Round 4(technical interview round 3): **This round was of 1 hour and more into practical and subject knowledge. In this round first I was asked about my most recent project in detail and the technology stacks used. After this, he asked me a sequence of questions which are as below. If I type paytm.com on a web browser what happens next, explain how the web browser retrieves the content of the webpage I am searching for.

In the end, a total of 18 students were shortlisted, and I was one of them. I will just say be good at your subjects like OS, DBMS, NETWORKS, and coding with data structures and algorithms.