SDE-3 Interview Questions
- 0of 0 votes
AnswersDesign garbage collector in Java
- neer.1304 March 10, 2017 in United States| Report Duplicate | Flag | PURGE
Amazon SDE-3 Software Design - -1of 1 vote
AnswersDesign a system to upload images and tag them. Ability to search images with single and multiple tags.
- neer.1304 March 09, 2017 in United States| Report Duplicate | Flag | PURGE
Amazon SDE-3 Algorithm - 1of 1 vote
AnswersGiven a very large binary number which cannot be stored in a variable, determine the remainder of the decimal equivalent of the binary number when divided by 3. Generalize to find the remainder for any number k.
- neer.1304 March 09, 2017 in United States| Report Duplicate | Flag | PURGE
Amazon SDE-3 Algorithm - 0of 0 votes
AnswersGiven a file having many lines of text(words) and given a dictionary having an API function boolean isValid(String word), which will return true is a word passed to this function is valid word in dic.,and will return false if given passed argument is not a valid word in dic.
- neer.1304 March 09, 2017 in United States
Now read the file and check if each word as well as all possible words from its L to R and R to L combinations, are valid words in dic. or not.| Report Duplicate | Flag | PURGE
Amazon SDE-3 Algorithm - 1of 1 vote
AnswersGiven sequentially placed boxes, each representing a number( which may be positive or negative), we need to select the numbers in order to have the maximum sum, having the constraint that if we select a given box, we cannot select adjacent box to it, but can select any other.
- neer.1304 March 09, 2017 in United States| Report Duplicate | Flag | PURGE
Amazon SDE-3 Algorithm - 0of 0 votes
AnswersGiven 2 integers, add them without using any arithmetic operator
- neer.1304 March 09, 2017 in United States| Report Duplicate | Flag | PURGE
Amazon SDE-3 Algorithm - 0of 0 votes
AnswersImplement a LRU cache with ttl at each block
- neer.1304 March 09, 2017 in United States| Report Duplicate | Flag | PURGE
Amazon SDE-3 Algorithm - 0of 0 votes
AnswersGiven some resources in the form of linked list you have to delete all the resources which sum up to 0(Zero) and return the remaining list.
- neer.1304 March 09, 2017 in United States| Report Duplicate | Flag | PURGE
Amazon SDE-3 Algorithm - 0of 0 votes
AnswersFind all anagrams of a given string in a file of size 1TB.
- neer.1304 March 09, 2017 in United States| Report Duplicate | Flag | PURGE
Amazon SDE-3 Algorithm - 1of 1 vote
AnswersGiven two strings print all possible permutations of two strings such that the order of characters are maintained.
- neer.1304 March 09, 2017 in United States| Report Duplicate | Flag | PURGE
Amazon SDE-3 Algorithm - 0of 0 votes
AnswersGiven an array,generate all valid ip address from the array.
- neer.1304 March 09, 2017 in United States| Report Duplicate | Flag | PURGE
Amazon SDE-3 Algorithm - 0of 0 votes
AnswersFind Longest Repeated Substring in the given string.
- neer.1304 March 09, 2017 in United States| Report Duplicate | Flag | PURGE
Amazon SDE-3 Algorithm - 0of 0 votes
AnswersGiven a equi-weighted uni directed graph and need to find the max distance possible from a given node.
- neer.1304 March 08, 2017 in United States| Report Duplicate | Flag | PURGE
Amazon SDE-3 Algorithm - 0of 0 votes
AnswersIn a binary tree return the maximum "turns" in tree. A "turn" is defined as LRL or RLR traversal.
- neer.1304 March 08, 2017 in United States| Report Duplicate | Flag | PURGE
Amazon SDE-3 Algorithm - 0of 0 votes
AnswersImplement multiple stacks using a single contiguous block of memory
- neer.1304 January 21, 2017 in United States| Report Duplicate | Flag | PURGE
Ola Cabs SDE-3 Algorithm - 0of 0 votes
AnswersWrite an efficient solution to give the next best available slot in a parking lot given that you need to minimize the effort to park and exit from the lot.
- neer.1304 January 21, 2017 in United States| Report Duplicate | Flag | PURGE
Ola Cabs SDE-3 Algorithm - 0of 0 votes
AnswersWrite a program to implement event bus
- neer.1304 January 21, 2017 in United States| Report Duplicate | Flag | PURGE
Ola Cabs SDE-3 Algorithm - 0of 0 votes
AnswerDesign and implement a sender and receiver system where there can be multiple senders and receivers subscribed to Topics. Each event generated at sender should be received by all receivers subscribed to that topic. Bonus if you can implement group mechanism at receiver side where event is received by one of the receiver in group and received by all groups subscribed to that Topic.
- neer.1304 January 20, 2017 in United States| Report Duplicate | Flag | PURGE
Ola Cabs SDE-3 Algorithm - 0of 0 votes
AnswerImplement in-memory file system
- neer.1304 January 20, 2017 in United States| Report Duplicate | Flag | PURGE
Ola Cabs SDE-3 Algorithm - 0of 0 votes
AnswersIn memory cache implementation which supports concurrent operations for PUT, GET and DELETE
- neer.1304 January 20, 2017 in United States| Report Duplicate | Flag | PURGE
Ola Cabs SDE-3 Algorithm - 0of 0 votes
AnswersStream of news events come; Need to find top 5 news at any time. use suitable data structure as score of news can dynamically increase or decrease.
- neer.1304 January 20, 2017 in United States| Report Duplicate | Flag | PURGE
Ola Cabs SDE-3 Algorithm - 0of 0 votes
AnswersImplement thread safe generic typed hashmap.
- neer.1304 January 20, 2017 in United States| Report Duplicate | Flag | PURGE
Ola Cabs SDE-3 Algorithm - 0of 0 votes
AnswerDetermine if a point is inside a 2D convex polygon
- neer.1304 January 20, 2017 in United States| Report Duplicate | Flag | PURGE
Ola Cabs SDE-3 Algorithm - 0of 0 votes
AnswerDesign and write algo for a bowling game wherein multiple games could be played in parallel and the scores to be shown for each game.
- neer.1304 January 20, 2017 in United States
Detailed question
Design the entire bowling alley system. One bowling game will be played by multiple players on a single lane.
During the game,players and their scores will be maintained and shown by the system and winner will be declared at the end of the game.
Likewise multiple games can be played in parallel on multiple free lanes.
Some rules about bowling:
A game consists of ten sets
In each set,the player has two opportunities to knock down ten pins.
The score for a set is the total number of pins knocked down,plus bonuses for strikes and spares.
A spare is when the player knocks down all ten pins in two tries.If there is spare the player gets 5 bonus points.
A strike is when the player knocks down all ten pins on his/her first try.If there is a strike the player gets 10 bonus points.
In the final set a player who rolls a spare or a strike is allowed to roll the extra balls to complete the set.However only a maximum of three balls can be rolled in the final set.| Report Duplicate | Flag | PURGE
Ola Cabs SDE-3 design - 0of 0 votes
AnswersDesign rubik’s cube and its operation (all rotations and checking final state)
- neer.1304 January 20, 2017 in United States| Report Duplicate | Flag | PURGE
Ola Cabs SDE-3 Algorithm - 0of 0 votes
AnswersGiven a list L of numbers from 0 to n, and another number k = [0-9], find how many times k appears in L. If the target number in L is more than one digit, treat each digit separately. For example, k=0 appears twice in L = [0,10].
- / January 15, 2017 in United States| Report Duplicate | Flag | PURGE
Adobe SDE-3 Algorithm - 0of 0 votes
AnswersCombination of these two leetcode question.
- nauld November 22, 2016 in United States
Given a digital strings, find all the sentence it can represent.
Digital to letter mapping is same as telephone keypad.
Separating the letters according to a dictionary to form sentences.
https://leetcode.com/problems/letter-combinations-of-a-phone-number/
https://leetcode.com/problems/word-break-ii/| Report Duplicate | Flag | PURGE
Google SDE-3 Algorithm - 0of 2 votes
Answers// TokenBucket
- nauld November 22, 2016 in United States
// Goal: regulate a resource of some kind (1 token = 1 unit of a resource)
//
// init(start_tokens, max_tokens, fill_rate)
// get_tokens(int tokens)
// - block until those tokens are available in the token bucket
// - if number of tokens in the bucket is less than requested number of tokens, wait
// put_tokens(int tokens)
// - block until there is space in the token bucket for those tokens.
// fill_rate: x tokens per sec are added to the token bucket
Thread communication methods allowed are listed below. No thread safe collections are allowed.
// Lock()
// - lock()
// - unlock()
// ConditionVariable()
// - wait(lock, max_time_to_wait_in_secs)
// - releases lock before sleep and then reacquires lock upon waking
// - notify(): This wakes up 1 waiter on this condition variable
// - notifyAll(): Wakes up all waiters on this condition variable| Report Duplicate | Flag | PURGE
Google SDE-3 Algorithm - 0of 0 votes
AnswersGiven a set of numbers, find out all subsets of the set such that
the sum of all the numbers in the subset is equal to a target number.s = [ 1, 2, 3, 4, 5 ] target = 5 op = [ [ 1,4 ] , [2,3] , [5] ]
Application: Given a fixed budget, and work items we are doing back filling to check what all we can attain with the budget.
Continuation. Imagine the set is actually a set of work items, with cost and utility involved :def work_item : { name : 'foo bar' , cost : 10 , utility : 14 }
Now, solve this to maximise utility.
Continuation. Imagine that the work items are related, so that, if work item w1 is already in the
subset of the work items selected, w2 's utility increases further!.
( Can you imagine how it can happen? Effectiveness of Mesi increases when he plays for Barca)
So, you are given a list like this :w1 -> normal utility 14, with w2 20, ....
Now maximize payoff.
NOTE: Payoff is a matrix. This comes from game theory.
Hence, a payoff matrix looks like :w1 w2 w3 w4 .... w1 w1 w2 w2 w3 w3 w4 w4
A cell ( i,j) is filled up with if a list contains both wi and wj, then how much the payoff would be. It is a symmetric matrix.
- NoOne October 15, 2016 in United States| Report Duplicate | Flag | PURGE
Amazon SDE-3 Algorithm - 0of 0 votes
AnswersConsider that your office provides an app to book meeting rooms. You provide the start and end time of the meeting. The app list the available rooms for that slot and you select a room and confirm your booking.
- Coding Panda September 30, 2016 in United States
All meeting happen between 9am - 6pm.
Write a method for getAvailableRooms(startTime, endTime). Use appropriate data structures.| Report Duplicate | Flag | PURGE
Amazon SDE-3 Algorithm