Development Lead Interview Questions

1,050 development lead interview questions shared by candidates

Given a list of numbers as input, e.g. : 25626 25757 24367 24267 16 100 2 7277 Output a delta encoding for the sequence. In a delta encoding, the first element is reproduced as-is. Each subsequent element is represented as the numeric difference from the element before it. E.g. for the sequence above, the delta encoding would be: 25626 131 -1390 -100 -24251 84 -98 7275 However, if a difference value does not fit in a single signed byte, i.e. -127 <= x <= 127, then, instead of the difference, we would like to use an escape token, printing it. This will denote that the value following the escape token is a full four-byte difference value, rather than a one-byte difference value. For this exercise, well declare -128 as the escape token. Following the same example above, the final output would be: 25626 -128 131 -128 -1390 -100 -128 -24251 84 -98 -128 7275
avatar

Software Development Team Leader

Interviewed at Booking.com

4.1
Oct 17, 2017

Given a list of numbers as input, e.g. : 25626 25757 24367 24267 16 100 2 7277 Output a delta encoding for the sequence. In a delta encoding, the first element is reproduced as-is. Each subsequent element is represented as the numeric difference from the element before it. E.g. for the sequence above, the delta encoding would be: 25626 131 -1390 -100 -24251 84 -98 7275 However, if a difference value does not fit in a single signed byte, i.e. -127 <= x <= 127, then, instead of the difference, we would like to use an escape token, printing it. This will denote that the value following the escape token is a full four-byte difference value, rather than a one-byte difference value. For this exercise, well declare -128 as the escape token. Following the same example above, the final output would be: 25626 -128 131 -128 -1390 -100 -128 -24251 84 -98 -128 7275

Viewing 681 - 690 interview questions

Glassdoor has 1,050 interview questions and reports from Development lead interviews. Prepare for your interview. Get hired. Love your job.