how to reverse a link list
Software Engineer Interview Questions
467,295 software engineer interview questions shared by candidates
How would you speed up your typical bit reversal algorithm?
Find the missing in an array filled with numbers 1 to n and the size of array is one less than the total numbers. For ex, 1,2,4,5. array is given, find the missing number from first n(here n=5) numbers
A file contains a billion integers, try to find any one integer that is not in the file.
Check if 2 strings are palindrome?
How can we write multiple strings to a file while keeping them separated?
Q: Describe some real life applications of machine learning
How to would you find out whether a substring occurs in a given string?
''' 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 }
Logic based questions. Scenarios. Code reviews
Viewing 1971 - 1980 interview questions