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

SDE - 1

OYO
upvote
share-icon
3 rounds | 5 Coding problems

Interview preparation journey

expand-icon
Preparation
Duration: 6.5 months
Topics: Data Structures and Algorithms, Operating Systems, OOPS, Database Management Systems, Low level Design
Tip
Tip

Tip 1 : Prepare basics, no one expects you to know hard topics
Tip 2 : Intra-personal skills are more important than solving the question
Tip 3 : Coding style is more important than the optimal approach

Application process
Where: Campus
Eligibility: 8.8CGPA, No backlogs
Resume Tip
Resume tip

Tip 1 : Be thorough with whatever you have written in the resume
Tip 2 : For projects, focus on why and what rather than how

Interview rounds

01
Round
Easy
Online Coding Interview
Duration75 minutes
Interview date27 Jul 2021
Coding problem3

Online coding round

1. Best Time to Buy and Sell Stock IV

Hard
20m average time
80% success
0/120
Asked in companies
AdobeRazorpayOYO

You have been given an array 'PRICES' consisting of 'N' integers where PRICES[i] denotes the price of a given stock on the i-th day. You are also given an integer 'K' denoting the number of possible transactions you can make.

Your task is to find the maximum profit in at most K transactions. A valid transaction involves buying a stock and then selling it.

Note
You can’t engage in multiple transactions simultaneously, i.e. you must sell the stock before rebuying it.
For Example
Input: N = 6 , PRICES = [3, 2, 6, 5, 0, 3] and K = 2.
Output: 7

Explanation : The optimal way to get maximum profit is to buy the stock on day 2(price = 2) and sell it on day 3(price = 6) and rebuy it on day 5(price = 0) and sell it on day 6(price = 3). The maximum profit will be (6 - 2) + (3 - 0) = 7.
Try solving now

2. Longest Sub-string with at most K Distinct Characters

Moderate
35m average time
65% success
0/80
Asked in companies
GoogleAmazonSAP Labs

You are given string S of length N, and an integer K. Your task is to find the length of the longest substring that contains at most K distinct characters.

Try solving now

3. Equal global and local inversions

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

You are given an integer array ‘ARR’ of size ‘N’ which is a permutation of the integers in the range [0, N-1].

Global inversions are defined as the number of unique pairs of the form ‘(i, j)’ where:

‘0 <= i < j < N’.
‘ARR[i] > ARR[j]’.

Local inversions are defined as the number of indexes ‘i’ where:

‘0 <= i < N - 1’.
‘ARR[i] > ARR[i + 1]’

Your task is to return ‘True’ if the number of global inversions is equal to the number of local inversions. Otherwise, return ‘False’.

Example:
‘N = 6’
‘ARR’ = [2, 0, 1, 5, 6, 3]’   

Pair of indexes that are global inversions: ‘(0, 1)’, ‘(0, 2)’, ‘(3, 5)’, ‘(4, 5)’.
Indexes that are local inversions: ‘0’, ‘4’.
Thus, you should return ‘False’ as the answer as the number of global inversions, and the number of local inversions is not equal. 
Note:
1. All integers in ‘ARR’ are unique and ‘ARR’ is a permutation of the integers in the range [0, N - 1].  
Try solving now
02
Round
Easy
Face to Face
Duration50 minutes
Interview date1 Aug 2021
Coding problem1

The interviewer was friendly, Gave a lot time to me to ask questions to her. Understood my projects and asked only one coding question. We had to write the code on a compiler, I used codechef compiler, if any error came, she gave time to correct the code and find out the error. She also pointed out my coding style and what could be improved to increase modularity in the code. She pasted an image for the test case as soon as the interview began

1. Binary Matrix

Hard
25m average time
75% success
0/120
Asked in companies
UberAppleSnapdeal

You are given a matrix ‘MAT’ consisting of ‘N’ rows and ‘M’ columns. Let (i, j) represent the cell at the intersection of the ith row and the jth column. Each cell of the matrix ‘MAT’ has either integer 0 or 1. For each cell in ‘MAT’, you have to find the Manhattan distance of the nearest cell from this cell that has the integer 0. The nearest cell will be the cell having the minimum Manhattan distance from it.

Manhattan distance between two cells, (p1, q1) and (p2, q2) is |p1 - p2| + |q1 - q2|.

You should return a matrix consisting of ‘N’ rows and ‘M’ columns, where the cell (i, j) represents the Manhattan distance of the nearest cell from the cell (i, j) in ‘MAT’ that has integer 0.

Note
1. There is at least one cell having the integer 0 in the given matrix.
Example:
Consider the following 2*3 matrix ‘MAT’:
                 [0, 1, 1]
                 [0, 1, 1]

Here, the nearest cell having the integer 0 from the cell (0, 0) is the cell (0, 0) itself. The Manhattan distance between them is |0 - 0| + |0 - 0| = 0.

The nearest cell having the integer 0 from the cell (0, 1) is cell (0, 0). The Manhattan distance between them is |0 - 0| + |1 - 0| = 1.

The nearest cell having the integer 0 from the cell (0, 2) is cell (0, 0). The Manhattan distance between them is |0 - 0| + |2 - 0| = 2.

The nearest cell having the integer 0 from the cell (1, 0) is cell (1, 0) itself. The Manhattan distance between them is |1 - 1| + |0 - 0| = 0.

The nearest cell having the integer 0 from the cell (1, 1) is cell (1, 0). The Manhattan distance between them is |1 - 1| + |1 - 0| = 1.

The nearest cell having the integer 0 from the cell (1, 2) is cell (1, 0). The Manhattan distance between them is |1 - 1| + |2 - 0| = 2.
Thus we should return matrix:

                [0, 1, 2]
                [0, 1, 2]
Problem approach

Input: mat = [[0,0,0],[0,1,0],[1,1,1]]
Output: [[0,0,0],[0,1,0],[1,2,1]]

Input: mat = [[0,0,0],[0,1,0],[0,0,0]]
Output: [[0,0,0],[0,1,0],[0,0,0]]

Try solving now
03
Round
Medium
Face to Face
Duration45minutes
Interview date1 Aug 2021
Coding problem1

Interviewer was a senior manager, not that frank, jumped directly to the questions and asked only one question. Asked to write the code on a google doc and asked me to explain the code fully before writing. While writing he asked my about different data structures that are widely used. For my solution, I was a little confused and gave a solution including various data structures, later on he gave me a hint and I solved the question within next 6 minutes.

1. Data Structure Supporting Insert Delete And GetRandom

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

Design and implement a data structure which supports the following operations:

insert(X): Inserts an element X in the data structure and returns true if the element was not present, and false otherwise.

remove(X): Removes the element X from the data structure, if present. Returns true if the element was present and false otherwise.

search(X): Search the element X in the data structure. Returns true if the element was present and false otherwise.

getRandom(): Return a random element present in the data structure.

Four types of queries denote these operations:

Type 1: for insert(X) operation.
Type 2: for remove(X) operation.
Type 3: for search(X) operation.
Type 4: for getRandom() operation.
Note:
It is guaranteed that at least one element will be present in the data structure when getRandom() operation is performed.
Follow Up:
Can you implement every operation such that it works in O(1) time?
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

Which SQL keyword removes duplicate records from a result set?

Choose another skill to practice
Similar interview experiences
company logo
SDE - 1
3 rounds | 7 problems
Interviewed by OYO
1632 views
0 comments
0 upvotes
company logo
SDE - 1
3 rounds | 9 problems
Interviewed by OYO
0 views
0 comments
0 upvotes
company logo
SDE - 1
2 rounds | 4 problems
Interviewed by OYO
804 views
0 comments
0 upvotes
company logo
SDE - 1
2 rounds | 5 problems
Interviewed by OYO
570 views
0 comments
0 upvotes
Companies with similar interview experiences
company logo
SDE - 1
5 rounds | 12 problems
Interviewed by Amazon
107832 views
24 comments
0 upvotes
company logo
SDE - 1
4 rounds | 5 problems
Interviewed by Microsoft
52129 views
5 comments
0 upvotes
company logo
SDE - 1
3 rounds | 7 problems
Interviewed by Amazon
32261 views
6 comments
0 upvotes