Sde Interview Questions

16,594 sde interview questions shared by candidates

She asked for binary search functionality which tells no exists in array or not. Generally we find mid element through (low+high)/ 2 so she asked to change that and use random function to decide mid. Binary search is performed on sorted array but here unsorted array is given. Two modifications are performed on binary search logic. 1) instead of sorted array, unsorted array has been given 2) Mid element is decided based on random function. Now we have to find out numbers from given array for which this function gives true result. Hint: Function will return true for value x, if all numbers on left side of x are small and all number on the right side of x are greater.
avatar

SDE-2

Interviewed at Google

4.4
Oct 28, 2022

She asked for binary search functionality which tells no exists in array or not. Generally we find mid element through (low+high)/ 2 so she asked to change that and use random function to decide mid. Binary search is performed on sorted array but here unsorted array is given. Two modifications are performed on binary search logic. 1) instead of sorted array, unsorted array has been given 2) Mid element is decided based on random function. Now we have to find out numbers from given array for which this function gives true result. Hint: Function will return true for value x, if all numbers on left side of x are small and all number on the right side of x are greater.

Viewing 531 - 540 interview questions

Glassdoor has 16,594 interview questions and reports from Sde interviews. Prepare for your interview. Get hired. Love your job.