employer cover photo
employer logo
employer logo

Pramati Technologies

Is this your company?

Pramati Technologies interview question

find missing value from n continuos numbers. they say it as algorithm question

Interview Answers

Anonymous

20 Mar 2018

sum of n continuous numbers from algebra.( n*n+1)/2. loop through each value and subtract from sum. at last you will have missing value

1

Anonymous

10 Apr 2018

Worst case complexity for above solution is O(n). Bettet solution is to binary search approach which has worst complexity as O(log n). If middle is not as expected, then missing number is in left side of middle number. Apply the same on sub-array on left side