implement a O(1) min function for Stack
Engineer Interview Questions
1,134,635 engineer interview questions shared by candidates
Giving a windows size K and an array of size N, find the minimum of each window as it slides through the array.
* You have a data structure of integers, which can be negative, zero, or positive, and you need to support an API with two public methods, insert(int) and getmedian(). Describe a data structure you would use to support this API and describe the running time of the two methods. * Imagine you're writing a function that takes an array of integers and an integer and it needs to return true if any pair in the array sum to the 2nd argument. The array can have negative numbers, zero, or positive numbers. Describe how you would design this function and what its running time would be. I ran through the trivial n^2 solution, then modified it to an nlogn and finally to a linear solution.
How would you implement a stack with the additional operation of getMin?
Given a stream of integers of unknown (possibly large) length, how would you pick one at random? Now prove its random.
Find the maximum difference in an unsorted array with the index of max greater than min. array cant be sorted
Given an array like [-1, 2, 3, 5, 4, 6] and it should print the 3 that is order of the array is equal to array element
Given a function for a fair coin, write a function for a biased coin that returns heads 1/n times (n is a param).
Given a multi-step product feature, write SQL to see how well this feature is doing (loading times, step completion %). Then use Python to constantly update average step time as new values stream in, given that there are too many to store in memory.
SQL: 1. Percentage increase in revenue compared to promoted and non-promoted products. 2. Products classes that has the highest transactions 3. Count of Customers who bought 2 items type (A,B) 4. Don't remember Python: 1. Average length of letters to words. 2. Parse an ip address (This is a favourite FB question) 3. [[A],[A,B],[A,C],[B,D],[C,A]] -- Find the alphabet with highest neighbors? -- (Wasnt able to solve because of time limit but the interviewer was like I get what I want to convey.. I gave her an algo of what I would I have done)
Viewing 531 - 540 interview questions