Uber | Phone | Pancake Sorting

Difficulty: MEDIUMCategory: InterviewExperienceFrequency: 1Asked On 2020-02-03Added By Anonymous
Source: Link

Company: Uber

Interview Stage: Phone Screen


Original Post Content:


I had one OA on AppSignal coding platform. Which I cleared.


Then scheduled for zoom round.


Zoom Round:


Interviewers: 2 people joined, mainly one person was asking all questions.


Question1 :


Given below matrix:


[[ R R R R R R],

[ R B B B R R],

[ B R R R B B],

[ R B R R R R]]


Find out if Any group of only R's or only B's surrounded by Opposite color stones. such that up, down, left, right corners.


eq: The one I have highlighted is valid set of B's surrounded by R's


Question2 :

https://leetcode.com/problems/pancake-sorting/


You are given a reverse function: reverse(arr, i) -> this function will reverse the array from i till len(array)

Implement your own sorting algorithm, which will use reverse function to sort array.


Do not use any predefined sorting methods.


I was shortlisted and Called for onsite round. Will share that in same post once done.

Comments