Software Engineer Interview Questions
- 2of 2 votes
AnswerAirbnb: Design webbrowser back button
- aonecoding May 23, 2018 in United States
Your web browser supports will support three actions: back, forward and open. The init webpage is “about:blank”.
Given a sequence of commands. Return the result page.| Report Duplicate | Flag | PURGE
Airbnb Software Engineer Algorithm - 0of 0 votes
Answersfind the sum of bit wise OR of minimum and Maximum element of all the subsets whose length is greater than 2 of the given of set.
- MukeshGupta0315 May 20, 2018 in India
for ex:-
{1,2,3} is set
then possible subsets of length is{ 1,2},{1,3},{2,3}{1,2,3} answer 1|2 +1|3 +2|3 +1|3=12| Report Duplicate | Flag | PURGE
Samsung Software Engineer Java - 0of 0 votes
AnswersThe wildcard regex can include the characters * and + .
- alex May 17, 2018 in United States
‘+’ – matches any single character or empty character!
‘*’ – Matches any sequence of characters (including the empty sequence) For example,
Text = "baaabab":
regex = "ba*a++", output : true
regex = "ba*a+", output : true
regex = "a*ab", output : false
//empty string
Text=""
Regex= "+" , output : true| Report Duplicate | Flag | PURGE
Google Software Engineer Dynamic Programming - 0of 0 votes
AnswersI was asked this question in a recent interview for a startup.
- bulletblp4 May 13, 2018 in United States
We have coffee vending machine with 3 buttons which can dispense 4oz, 7oz and 13oz of coffee.
Given a cup and the min and max amount(oz) of coffee it should fill. determine if the coffee vending machine can satisfy the condition.
The buttons can be pressed as many times as possible to fill the cup. Coffee shouldn't overflow..| Report Duplicate | Flag | PURGE
Software Engineer - 2of 2 votes
AnswersAWS phone interview
- aonecoding May 13, 2018 in United States
Find the left view of binary tree
1
/ \
2 3
/\ \
4 5 6
/ /
7 8
/
9
return [1, 2, 4, 7, 9]| Report Duplicate | Flag | PURGE
Amazon Software Engineer Algorithm - -5of 5 votes
AnswersIf b == “1”:
- TubbyOPPO May 09, 2018 in England
quit()| Report Duplicate | Flag | PURGE
Facebook Software Engineer - 1of 1 vote
AnswersWrite a method that can take in an unordered list of airport pairs visited during a trip, and return the list in order:
- mandy May 08, 2018 in United States
Unordered: ("ITO", "KOA"), ("ANC", "SEA"), ("LGA", "CDG"), ("KOA", "LGA"), ("PDX", "ITO"), ("SEA", "PDX")
Ordered: ("ANC", "SEA"), ("SEA", "PDX"), ("PDX", "ITO"), ("ITO", "KOA"), ("KOA", "LGA"), ("LGA", "CDG")| Report Duplicate | Flag | PURGE
Amazon Software Engineer - 2of 2 votes
AnswersApril Google Interview 1/4
- aonecoding May 06, 2018 in Korea
A = a+b-c-a-b-c-a-b (Tree)
B = b+a+c+a+b-c+b (Tree)
is A equal to B| Report Duplicate | Flag | PURGE
Google Software Engineer Algorithm - 2of 2 votes
AnswersApril Google Interview 3/4
- aonecoding May 06, 2018 in Korea
Maze
N,M array
Level 1 0,0 to N-1,M-1 => Path exsits?
Level 2 if path exists then print path
Level 3 if path exists then print min cost path
Level 4 O(nm log mn) using Priority Queue.| Report Duplicate | Flag | PURGE
Google Software Engineer Algorithm - 0of 0 votes
Answers/**
* Definition for a binary tree node.
* public class TreeNode {
* int val;
* TreeNode left;
* TreeNode right;
* TreeNode(int x) { val = x; }
* }
*/Find the largest duplicate subtree in a binary tree For example, 1 / \ 2 3 / / \ 4 2 4 / 4 The following are two duplicate subtrees: 2 / 4 and 4
but the former is the largest, thus return the root of the first subtree
- ajay.raj May 05, 2018 in United States| Report Duplicate | Flag | PURGE
Amazon Software Engineer - 0of 0 votes
AnswersGiven a target string, an input request replaces the word after the given index a->b such as:
- ajay.raj May 04, 2018 in United States
Target string: "Hello world!"
Input:{s:0, a:Hello b: Goodbye}
Output:"Goodbye world!".
The requirement is that input be given to several words that need to be changed at one time: {{s:0,a:Hello,b:Goodbye},{s:11,a:!,b:?},{s:6 a: World,b:friend}}
And each modified index is based on the original unmodified target string so the end result is
"Goodbye friend?"| Report Duplicate | Flag | PURGE
Amazon Software Engineer - 0of 0 votes
Answersgiven a n-ary tree, find the total distance from this node to any other nodes
- ajay.raj May 04, 2018 in United States
class TreeNode {
int val;
List<TreeNode> children;
TreeNode(int val) {
this.val = val;
children = new ArrayList<>();
}
}
public int findDistance(TreeNode root, TreeNode node) {
}| Report Duplicate | Flag | PURGE
Amazon Software Engineer - 0of 0 votes
AnswersDesign a Twitter-like topic system so that the most popular topics can be retrieved from the system. A post can have one or more topics and these topics can be shared by multiple posts. (hint: thinking of scalability)
- fz May 01, 2018 in United States| Report Duplicate | Flag | PURGE
Software Engineer Software Design - 1of 1 vote
AnswersAssume courses labeled by their index in an array. Given a list of pairs where the first element represents a prerequisite course required for the second course, derive an ordered list of courses.
- vmayer99 April 30, 2018 in United States| Report Duplicate | Flag | PURGE
Software Engineer Algorithm - 0of 0 votes
AnswersFor a given set of non-negative integers get the number of subsets that add up to a target value k.
- vmayer99 April 30, 2018 in United States| Report Duplicate | Flag | PURGE
Linkedin Software Engineer Algorithm - 0of 0 votes
AnswersFor a given array of integers compute the maximum sum of any range in the array. Then modify the function to find maximum product (note the effect of negatives on max product).
- vmayer99 April 30, 2018 in United States| Report Duplicate | Flag | PURGE
Linkedin Software Engineer - 0of 0 votes
AnswersWrite a function to compute n^k. (don't forget negative exponents)
- vmayer99 April 30, 2018 in United States| Report Duplicate | Flag | PURGE
Linkedin Software Engineer Algorithm - 1of 1 vote
AnswersPrint (or return) the longest movie title found by successively matching the last and first words in each title, joining to form new titles, given a file containing a list of movie titles.
- gsgy11 April 30, 2018 in United States
For example: 'OF MICE AND MEN' and 'MEN IN BLACK' join to form 'OF MICE AND MEN IN BLACK'.
You could further join 'OF MICE AND MEN IN BLACK' wth 'BLACK MASS' to form 'OF MICE AND MEN IN BLACK MASS'.
The longest title I found (at 143 characters is): WENT TO CONEY ISLAND ON A MISSION FROM GOD BE BACK BY FIVE WIVES THREE SECRETARIES AND ME WITHOUT YOU CANT TAKE IT WITH YOU WERE NEVER LOVELIER| Report Duplicate | Flag | PURGE
Google Software Engineer - 0of 0 votes
AnswersGiven a bar chart which the heights of bars are notated as an array of positive integers. Rectangles can be formed in areas covered by one or more bars. Find the largest rectangle.
- fz April 21, 2018 in United States| Report Duplicate | Flag | PURGE
Software Engineer Algorithm - 6of 6 votes
AnswersFB On-site March
- aonecoding April 21, 2018 in United States
Q: Find number of Islands.
XXXOO
OOOXX
XXOOX
Return 3 islands.
1 1 1OO
OOO2 2
3 3OO 2
Followup: If the board is too big to fit in memory, how to get the number?| Report Duplicate | Flag | PURGE
Facebook Software Engineer Algorithm - 0of 0 votes
AnswerGiven two sets of intervals such as {[1, 2], [4, 8]} and {[2, 5]}. Find their union {[1, 8]} for the two intervals.
- fz April 20, 2018 in United States| Report Duplicate | Flag | PURGE
Software Engineer Data Structures - 0of 0 votes
AnswersDesign a dictionary which words are grouped by the same characters. For example, dog and god are in the same group. And how to make it scalable to handle a huge number of words?
- fz April 20, 2018 in United States| Report Duplicate | Flag | PURGE
Software Engineer Data Structures - 0of 0 votes
Answerfind max path sum in DAG, weight can be negative
- ajay.raj April 06, 2018 in United States| Report Duplicate | Flag | PURGE
Amazon Software Engineer - 1of 1 vote
AnswersGiven a string as input, return the list of all the patterns possible:
'1' : ['A', 'B', 'C'], '2' : ['D', 'E'], '12' : ['X'] '3' : ['P', 'Q']
Example if input is '123', then output should be [ADP, ADQ, AEP, AEQ, BDP, BDQ, BEP, BEQ, CDP, CDQ, CEP, CEQ, XP, XQ]
- ngupta32@hawk.iit.edu March 30, 2018 in United States| Report Duplicate | Flag | PURGE
Facebook Software Engineer Algorithm Coding Data Structures - 0of 0 votes
AnswersGiven an Input file of IPv4 addresses, filter and write them into Valid and Invalid IPs.
- pragramticProgrammer March 28, 2018 in United States
Input file = ["192.100.0.1, "10.0.0.1", "aa.bb.cc.dd", "10.0", "999.10.10.1"]
Valid = []
Invalid = []| Report Duplicate | Flag | PURGE
Amazon Software Engineer - 0of 0 votes
AnswerEvaluate infix expression: 2 + 3 * 5
- annu025 March 21, 2018 in United States| Report Duplicate | Flag | PURGE
Microsoft Software Engineer - 0of 0 votes
AnswersInterleave two singly linked lists into one.
- annu025 March 21, 2018 in United States
LL1: 1 -> 2 -> 3 -> 4
LL2: 10 -> 20 -> 30 -> 40 ->50
Output LL1: 1-> 10 -> 2 -> 20 -> 3 -> 30 -> 4.
Note: Stop when we hit null for LL1.| Report Duplicate | Flag | PURGE
Microsoft Software Engineer - 2of 2 votes
AnswersDropbox
- aonecoding March 21, 2018 in United States
Grid Illumination: Given an NxN grid with an array of lamp coordinates.
Each lamp provides illumination to every square on their x axis,
every square on their y axis, and every square that lies in their diagonal
(think of a Queen in chess).
Given an array of query coordinates,
determine whether that point is illuminated or not. The catch is when checking a query all lamps adjacent to, or on,…| Report Duplicate | Flag | PURGE
Dropbox Software Engineer Algorithm - 2of 2 votes
AnswersMarch 2018 Phone Interview FB
- aonecoding March 17, 2018 in United States
Calculate a moving average that considers the last N values.
Circular Queue (Interviewer didn't agree with the linked list queue that I suggested at first. Said the pointers took space)| Report Duplicate | Flag | PURGE
Facebook Software Engineer Algorithm - 4of 4 votes
AnswersFeb On-site Google
- aonecoding March 10, 2018 in United States
DP Problem. Given the length and width of a matrix, get the number of paths from bottom-left to bottom right.
You may only walk into those 3 directions ➡ (right) ↗ (upper-right) ↘ (lower-right) at each point.
Follow-up: optimize 2d DP to 1d DP of linear extra space.
Follow-up: what if some cells are blocked
System Design
Availability test/debug on distributed system. Discussed and drafted about failover, replication, NoSQL etc.
Interviewer seemed to be expecting more but time ran out.| Report Duplicate | Flag | PURGE
Google Software Engineer Algorithm
Open Chat in New Window