Sr Data Scientist Interview Questions

3,380 sr data scientist interview questions shared by candidates

Explain what the below pseudo-code is trying to do. array[N] # array of N integers, indexed 0 to N-1; # assume it’s populated with [1,4,2,-2,-9,10,2,12,2,-4,-4,-4,-4,2,6,7] peak = array[0] index = 0 output = [] # array of tuples For x in 1..N-1 if (array[x]*array[x-1] > 0) if peak < 0 and array[x] < peak peak = array[x] index = x if peak >= 0 and array[x] > peak peak = array[x] index = x else output.insert( (index, peak) ) peak = array[x] index = x end if end for return output
avatar

Sr. Data Scientist

Interviewed at PriceLabs

4.5
Jul 9, 2023

Explain what the below pseudo-code is trying to do. array[N] # array of N integers, indexed 0 to N-1; # assume it’s populated with [1,4,2,-2,-9,10,2,12,2,-4,-4,-4,-4,2,6,7] peak = array[0] index = 0 output = [] # array of tuples For x in 1..N-1 if (array[x]*array[x-1] > 0) if peak < 0 and array[x] < peak peak = array[x] index = x if peak >= 0 and array[x] > peak peak = array[x] index = x else output.insert( (index, peak) ) peak = array[x] index = x end if end for return output

Viewing 1501 - 1510 interview questions

Glassdoor has 3,380 interview questions and reports from Sr data scientist interviews. Prepare for your interview. Get hired. Love your job.