# Oyo Rooms Interview Experience | Set 9

Round 1 : This was online codingÂ  round consisting of 2 coding questions each of 100 marksÂ  and 15 objective questions each of 2 marks.If you have basic knowledge of C, Java, Operating System, DBMSÂ  you can score easily.

Coding question 1 –Â Given an array A. Three integers a, b and d. You can add or subtract a or b any number of times to d. You need to check how many elements can be formedÂ  by applying these operations to d and those elements should be in range 0 to 10^9.
Solution:Â  So consider the equation ax + by = c. For an integer solution to (x, y) c should be divisible by gcd(a, b)
So answer= multiples of gcd in given range for ex if a=2 and b=4 and d=5. gcd(2, 4)=2 so elements that can be formed are 1(5-4), 3(5-2) 5, 7, 9, 11, 13, 15 ….

Coding question 2 –Â Given a matrix. Empty cells are represented by â€˜.â€™, cells which are occupied are represented by â€˜Bâ€™. Given two cells â€˜Sâ€™ and â€˜Dâ€™, find the minimum distance required from S to D.

..S…
..BB..
..B…
.D….
initialize dis[m][n] as infinite.

This is a simple BFS question.Â  This question is not a dp question as we can move in all 4 directions .You can use bfs and each time update corresponding distance in tht cell i, j if i, j is a valid move and dis[i][j]>curr dist then dis[i][j] =curr and curr++;

For objective questions go through geeksforgeeks CS Subjects Section.

Only 2 students were able to solve both coding questions. I was one of those :p .But still 6 students were shortlisted for interview round.

Round 2:Â This round lasted about 50 minutes. The interviewer asked me some basic DS questions( 2-3 ques from interview bit Â ) after asking about my projects and internship.
1.Given a set of time intervals in any order, merge all overlapping intervals into one and output the result which should have only mutually exclusive intervals
Refer – https://www.geeksforgeeks.org/merging-intervals/

2. Implement LRU Cache. He asked me to implement it in my project.

3. Find the distance between two keys in a binary tree, no parent pointers are given.
Refer – https://www.geeksforgeeks.org/find-distance-between-two-nodes-of-a-binary-tree/

4 Given a binary tree, print boundary nodes of the binary tree Anti-Clockwise starting from the root

5 Given three stack of the positive numbers, the task is to find the possible equal maximum sum of the stacks with removal of top elements allowed.
Refer- https://www.geeksforgeeks.org/find-maximum-sum-possible-equal-sum-three-stacks/

last que (easiest one ) sutta kaha milta hai tumhare campus mein :p

I answered all ques ðŸ™‚ and last one with full confidence :p

Round 3:.

1. Basic paging segment and OS scheduling questions
2. Code for Dining philosopher problem
3. Â print all views of a binary tree ?
I soved in 2 traversal . Then he asked me to solve in 1 . Finally i did
Refer- for left view https://www.geeksforgeeks.org/print-left-view-binary-tree/
Refer for right view – https://www.geeksforgeeks.org/print-right-view-binary-tree-2/
but u have to print all views (bottom top right left ) all in traversal.Use bfs traversal and for each level the leftmost one will be left view at that level and rightmost one will be the right one
and for top and bottom use https://www.geeksforgeeks.org/print-nodes-top-view-binary-tree/ (hosrizontal dis technique) for each dis the first node will be top view and the last node for tht dis will be bottom view
use hashing to do store all view separately in 1 traversal
4. Given a number x, find sum of digits in all numbers from 1 to n.
Refer –https://www.geeksforgeeks.org/count-sum-of-digits-in-numbers-from-1-to-n/

2 studentsÂ  were selected after 2 rounds. Other had round 3 also .

Final Tip : when its your day to get selected . no one can stop u . Go for it just go through geeksforgeeks that would be enough.

Whether you're preparing for your first job interview or aiming to upskill in this ever-evolving tech landscape, GeeksforGeeks Courses are your key to success. We provide top-quality content at affordable prices, all geared towards accelerating your growth in a time-bound manner. Join the millions we've already empowered, and we're here to do the same for you. Don't miss out - check it out now!

Previous
Next