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

SDE - Intern

Razorpay
upvote
share-icon
2 rounds | 5 Coding problems

Interview preparation journey

expand-icon
Journey
I was admitted to KIIT Bhubaneswar for B.Tech in CSE. Honestly, I love the CSE field, and I always wanted to pursue my passion, which brought me here. I found a good environment at my college and a supportive friend circle who always motivates me. I practised a 190-question DSA sheet by Strive, which helped me gain proficiency in DSA. I also learned development skills from an online course.
Application story
Razorpay visited our campus to hire candidates for internship profiles. Internships are essential for gaining experience and enhancing your resume. Therefore, I participated in the internship selection process at Intuit.
Why selected/rejected for the role?
The selection process was moderately challenging. I managed to solve most of the coding questions. However, what mattered most was that I attempted every question and provided at least one or two approaches for each. As a result, I was eventually selected by them.
Preparation
Duration: 2 months
Topics: Data Structures, Algorithms, Operating Systems, Database Management, Computer Networks.
Tip
Tip

I used the Codezen platform from Coding Ninjas to practice data structures-related questions. There, you will find topic-wise questions. So, try to practice there or on any other coding portal to enhance your speed and efficiency.

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

Include high-level projects on your resume, along with internships or previous experiences, providing a brief explanation of your role and accomplishments in each internship.

Interview rounds

01
Round
Hard
Online Coding Test
Duration90 minutes
Interview date16 Mar 2022
Coding problem2

This was a coding round in which two questions were asked. I solved the first question fully and the second question partially.

1. Distributing Coins

Moderate
45m average time
55% success
0/80
Asked in companies
AppleUberRazorpay

You are given the ‘ROOT’ of a binary tree with ‘N’ nodes where each node in the tree has some coins, and there are ‘N’ coins total. In one move, we may choose two adjacent nodes and move one coin from one node to another.

Your task is to return the number of moves required to make every node have exactly one coin.

Note:

A move may be from parent to child or from child to parent.

For example,

Given ‘ROOT’ = [2,-1,0,-1,-1]

The tree would look like this : 

The answer would be 1, because the root node will transfer 1 coin to its right child. Thus both nodes have the same number of coins now.
Problem approach

I solved this using permutations and combinations. The approach was to calculate the total ways to distribute N items among three people and then subtract invalid distribution from the total ways will result in the required answer.

Try solving now

2. Replace ‘O’ With ‘X’

Moderate
35m average time
60% success
0/80
Asked in companies
RazorpayIntuitDTCC

Given a 2D array grid G of 'O's and 'X's. The task is to replace all 'O' with 'X' contained in each island. Where, an island is a set of 'O's connected horizontally or vertically and surrounded by 'X' from all of it's boundaries. (Boundary means top, bottom, left and right)

Example:
{{X, X, O, X, X, X},
 {X, X, O, X, O, X},
 {X, X, X, O, O, X},
 {X, O, X, X, X, X},
 {O, X, O, O, X, X},
 {X, X, X, X, O, X}}

In the above example, there are 3 islands. Considering Zero based indexing of rows and columns, in the following islands described here, (x,y) represents the element in xth row and yth column.

Island 1: Formed by three elements at (1, 4), (2, 3), (2, 4) positions.

Island 2: Formed by a single element at (3, 1) position.

Island 3: Formed by two elements at (4, 2), (4, 3) positions.

Note:

In the above example, elements at positions (0, 2) and (1,2) do not form an island as there is no 'X' surronding it from the top.
Problem approach

I solved this question using the Flood-fill algorithm by replacing ‘O’ with a special character and applying Flood-fill for every edge of the matrix by traversing it.

Try solving now
02
Round
Medium
Face to Face
Duration50 minutes
Interview date16 Mar 2022
Coding problem3

This was face to face interview round and the interviewer asked me one coding-only and project-related questions.

1. Smallest Subarray with K Distinct Elements

Easy
20m average time
80% success
0/40
Asked in companies
IntuitUberGoldman Sachs

Given an array 'A' consisting of 'N' integers, find the smallest subarray of 'A' containing exactly 'K' distinct integers.

Note :
If more than one such contiguous subarrays exist, consider the subarray having the smallest leftmost index.

For example - if A is [1, 2, 2, 3, 1, 3 ] and k = 2 then the subarrays: [1,2], [2,3], [3,1], [1,3] are the smallest subarrays containing 2 distinct elements. In this case, we will consider the starting and ending index of subarray [1,2] i.e. 0 and 1.
Problem approach

I used the concept of a Sliding window to solve this question. I initialized the start pointer and end pointer to 0, then moved the end pointer to a point at which the distinct elements between the start and end pointer were equal to k, I kept the track through a map and then moved the start pointer ahead till the point where distinct elements between the start and end pointer were equal to k - 1 and accordingly stored the minimum difference between end and start pointer over the whole array. Also after the algorithm explanation, I wrote to him fully commented on neat and clean code and dry run it on test cases given by the interviewer.

Try solving now

2. Project based questions

I explained the project thoroughly by describing its objective, features, tech stack, and flow diagram.

3. OOPS Questions

  1. What is the concept of function overriding? (Learn)
  2. What Is Memory Distribution in C++?
Problem approach

Tip 1: I explained the concept of function overriding in inheritance to him by providing a proper example. I also introduced the concept of virtual functions during this discussion.

Tip 2: I used diagrammatic explanations to illustrate the concept, detailing where variables reside in memory and how code is stored in different segments.

Here's your problem of the day

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

Skill covered: Programming

What is recursion?

Choose another skill to practice
Similar interview experiences
SDE - 1
3 rounds | 5 problems
Interviewed by Razorpay
3039 views
0 comments
0 upvotes
SDE - Intern
1 rounds | 3 problems
Interviewed by Razorpay
1331 views
0 comments
0 upvotes
SDE - Intern
3 rounds | 5 problems
Interviewed by Razorpay
2716 views
0 comments
0 upvotes
SDE - Intern
3 rounds | 8 problems
Interviewed by Razorpay
63 views
0 comments
0 upvotes
Companies with similar interview experiences
company logo
SDE - Intern
3 rounds | 6 problems
Interviewed by Amazon
15480 views
4 comments
0 upvotes
company logo
SDE - Intern
4 rounds | 7 problems
Interviewed by Microsoft
15338 views
1 comments
0 upvotes
company logo
SDE - Intern
2 rounds | 4 problems
Interviewed by Amazon
10142 views
2 comments
0 upvotes