Entwickler Interview Questions

467,369 entwickler interview questions shared by candidates

''' We want to implement a feature to suggest to users the cheapest hotel that is more popular than the one they are looking at. Write a function that given an array of hotels, sorted by their popularity returns a map from the hotel ids that associates each hotel with the cheapest hotel that is more popular than the one in question. if there is no hotel that is cheaper and more popular than the one with that id, then it shouldn't be put in the map. You can assume that hotel ids and prices are integers and that hotels have the following format: struct hotel{ int id; int price; } Example 1: input = [ { id => 123, price => 200 }, # Most popular { id => 55, price => 150 }, # Second most popular { id => 17, price => 70 }, # Third most popular { id => 18, price => 500 }, # ... { id => 27, price => 270 }, { id => 101, price => 230 } # Least popular ] output = { 18 : 17, 27 : 17, 101 : 17 }
avatar

Software Developer

Interviewed at Booking.com

4
Mar 4, 2018

''' We want to implement a feature to suggest to users the cheapest hotel that is more popular than the one they are looking at. Write a function that given an array of hotels, sorted by their popularity returns a map from the hotel ids that associates each hotel with the cheapest hotel that is more popular than the one in question. if there is no hotel that is cheaper and more popular than the one with that id, then it shouldn't be put in the map. You can assume that hotel ids and prices are integers and that hotels have the following format: struct hotel{ int id; int price; } Example 1: input = [ { id => 123, price => 200 }, # Most popular { id => 55, price => 150 }, # Second most popular { id => 17, price => 70 }, # Third most popular { id => 18, price => 500 }, # ... { id => 27, price => 270 }, { id => 101, price => 230 } # Least popular ] output = { 18 : 17, 27 : 17, 101 : 17 }

This function performs a basic smoothing of inlist and returns the result (outlist). Both lists have the same length, N. Each item in inlist is assumed to have type 'float', and 'h' is assumed to be an integer. For each i, outlist[i] will be the average of inlist[k] over all k that satisfy i-h <= k <= i+h and 0 <= k <= N-1.
avatar

Software Engineer

Interviewed at Viridien

3.6
May 18, 2022

This function performs a basic smoothing of inlist and returns the result (outlist). Both lists have the same length, N. Each item in inlist is assumed to have type 'float', and 'h' is assumed to be an integer. For each i, outlist[i] will be the average of inlist[k] over all k that satisfy i-h <= k <= i+h and 0 <= k <= N-1.

Viewing 1971 - 1980 interview questions

Glassdoor has 467,369 interview questions and reports from Entwickler interviews. Prepare for your interview. Get hired. Love your job.