One of the questions was asked by Ahmed Bashir, who (I later learned) was a Director level and the manager of the hiring manager. The question was as follows. You are given 25 horses. In each race only up to 5 horses can run and each race only reveals the ranking between the horses (i.e., we do not know the actual time). What is the minimum number of races you need to have in order to reveal the 3 fastest horses between the 25.
Engineer Software Interview Questions
512,496 engineer software interview questions shared by candidates
Is the given number a bitwise palindrome?
How would you design a Zoo class using OO design?
post order traversal of a Binary Search Tree Follow up Create a BST from this post order traversed array and write test cases for this function
Reverse each word of the string without reversing the order of the words this is a test BECOMES siht si a tset
How can we write multiple strings to a file while keeping them separated?
''' 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.
The question was: Given a text written in some language where the alphabets are represented with 1 byte or 2 byte. But the one byte alphabets always have their MSB 1 and the 2 byte charecters always have their MSB 0. Now when at some point user presses a back space how many bytes are to be deleted to erase the alphabet?
Q: In an array that has one value for more than half of its elements, how can you find that value?
Viewing 2341 - 2350 interview questions