Software Engineer Interview Questions
- 0of 0 votes
AnswerGiven 2 numbers m and n , find if the sum m+n has the same number of digits as n . If true then print m+n otherwise print n.
- Rising star November 29, 2017 in India| Report Duplicate | Flag | PURGE
Megasoft Software Engineer - 3of 3 votes
AnswersGiven a list of daily temperatures, produce a list that, for each day in the input, tells you how many days you would have to wait until a warmer temperature.
- md.lisul.islam November 22, 2017 in United States
[73, 74, 75, 71, 70, 76, 72] -> [1, 1, 3, 2, 1, nothing, nothing]| Report Duplicate | Flag | PURGE
Google Software Engineer Algorithm - 0of 0 votes
AnswersWrite code to find unmatched parentheses and return it in the below format:
- 1080ti November 18, 2017 in United States
((a) -> -10a1
(a)) -> 0a1-1
(((abc))((d))))) -> 000abc1100d111-1-1| Report Duplicate | Flag | PURGE
Google Software Engineer Algorithm - 1of 1 vote
AnswersGiven an array of sorted integers and find the closest value to the given number. Array may contain duplicate values and negative numbers.
- Vijay November 17, 2017 in India
Example : Array : 2,5,6,7,8,8,9
Target number : 5
Output : 5
Target number : 11
Output : 9
Target Number : 4
Output : 5| Report Duplicate | Flag | PURGE
Google Software Engineer Algorithm Arrays Coding Data Structures - 0of 0 votes
AnswersImplement a trie tree which can add and search word, an extra "*" sign will also be considered, similar to Leetcode 211 but with "*"
- Aamir November 09, 2017 in United States
'*' means any sequence of characters (including the empty sequence).| Report Duplicate | Flag | PURGE
Facebook Software Engineer - 2of 4 votes
AnswerCongrats to aonecode's member F.L.
- aonecoding November 03, 2017 in United States
Got offers from - Youtube(G), LinkedIn, Airbnb, Square, Wish, Blend and NextDoor!
Thanks for sharing the interview experience with us.
Youtube Interview
- Phone: Find anagrams of string A from string B (sliding window)
- Phone: Find if two frames in a screen are equal. Frames may overlap. (equal method)
Onsite:
- LC41 first missing positive
- LC499+LC505 The maze
- LC161 one edit distance
- Similar to hangman but make guesses based on a dictionary.
Assume a dictionary has words - {house, morse, jesus} and ‘morse’ is the answer. If your first guess is ‘house’, output will be ‘_o_se’, which indicates 3 letters are correct. (Here the arrangement of letters does not matter. Your guess can be ‘co’ and if answer is ‘ok’ then the output is gonna be ‘_o’ which indicates letter ‘o’ in answer. )
Try to get the answer with minimum guesses.
(Interviewer expects pre-processing the dictionary. Key: letter; Value: frequency. Begin with combinations of most frequent letters first)| Report Duplicate | Flag | PURGE
Google Software Engineer Algorithm - 1of 3 votes
AnswerCongrats to F.L.
- aonecoding November 03, 2017 in United States
Got offers from - Youtube(G), LinkedIn, Airbnb, Square, Wish, Blend and NextDoor!
Thanks for sharing the interview experience with us.
LinkedIn
Phone:
- Questions from LC tagged LinkedIn.
Onsite:
- Get sqrt(x). Output a floored integer if result is not a perfect square. sqrt(18) = 4
- Implement BST, insert, delete, search.
- Design a dashboard for service logs stats (sort and aggregate). Scale from 1 to more machines. Discuss async and realtime as different scenarios.| Report Duplicate | Flag | PURGE
Linkedin Software Engineer Algorithm - 2of 2 votes
AnswerFacebook
- aonecoding November 03, 2017 in United States
-Phone: LC304 & longest arithmetic sequence. Return the sequence.| Report Duplicate | Flag | PURGE
Facebook Software Engineer Algorithm - 0of 0 votes
AnswersGiven a string S(a data structure) that contains only square brackets, convert it to an array that stores arrays in the following format: [positionOpeningBracket, positionClosingBracket, nestedDataStructure]. Example: https://i.imgur.com/vZhlZdr.png
- lopogax October 29, 2017 in United Statesdef parser(S): #whatever... print(r) parser("[[]][]") #output: [[0,3,[1,2,null]], [4, 5, null]]
| Report Duplicate | Flag | PURGE
unknown Software Engineer Problem Solving - 3of 3 votes
AnswersQuestion 1.
- anonymous October 24, 2017 in India
You are given a string composed of uppercase English letters (‘A’ through ‘Z’).
Set of letters (‘A’, ‘E’, ‘I’, ‘O’, ‘U’) are called vowels. Other letters are called consonants.
We define foo value of a string as number of pairs of exactly same consecutive vowel letters.
For example,
Ex.1: BCDEEIOU - This has a foo value of 1 (because of EE). Note that although I is next to E, and O is next to I, and U is next to O, they aren’t exactly same neighbours, so they don’t contribute to foo value
Ex.2: BCDEEEIOU - This has foo value of 2. Because of first pair of EE and immediately next pair of EE
Ex.3: ABCDEFG - This has foo value of 0. There are no consecutive vowels
Ex.4: ABEUUOUOO - This has foo value of 2, because of UU and OO
You are given 2 inputs, N and K.
How many strings of length N can you form such that they all have foo value of K?
Let’s assume the constraints as:
1<=N<=15
0<=K<N| Report Duplicate | Flag | PURGE
Google Software Engineer - 0of 0 votes
AnswersGiven a sorted list of integers, square the elements and give the output in sorted order.
- nra October 19, 2017 in United States| Report Duplicate | Flag | PURGE
Facebook Software Engineer - 0of 0 votes
AnswersFind the distance between the farthest two elements in a binary tree.
- nra October 19, 2017 in United States| Report Duplicate | Flag | PURGE
Facebook Software Engineer Algorithm - 0of 0 votes
Answers
- Anonymous October 13, 2017 in United States for SeattleA text file contains {candidateID,voterID} details of an ongoing voting. Read this file in real time and report top 5 candidates. Also report a fraud if a Voter tries to vote twice or try to vote more then one candidate. Assume that the database is offline.
| Report Duplicate | Flag | PURGE
Uber Software Engineer Algorithm - 0of 0 votes
AnswersGiven list of line segments({x_start, y_start}, {x_end, y_end}) find out the maximum number of points they intersect. (interviewer said, he can make it simpler by assuming only vertical or horizontal lines with no overlapping lines)
- bottomcoder October 13, 2017 in United States
Givenen tree in which each node has (or grows) exactly 4 children with values (2, 2.5, 8, 50) plus the value of its parent node. Find out the least K values.
e,g, k = 5, node with value 2, 2.5, 4, 4.5, 6| Report Duplicate | Flag | PURGE
Microsoft Software Engineer - 0of 0 votes
AnswersList of processes with start time, end time and bandwidth. Find the maximum bandwidth for the list.
- bottomcoder October 13, 2017 in United States
2. Given N teams which need to play each other exactly once but at most once in one day, output the game schedule.| Report Duplicate | Flag | PURGE
Microsoft Software Engineer - 0of 0 votes
AnswersSnake and ladder game. Given a board state with position information for snakes and ladders, find the minimum number of ways(aka dice throws) one can reach from start to end.
- bottomcoder October 13, 2017 in United States| Report Duplicate | Flag | PURGE
Microsoft Software Engineer - 0of 0 votes
AnswersLongest substring palindrome
- bottomcoder October 13, 2017 in United States
(interview looking for n^2 or less solution)| Report Duplicate | Flag | PURGE
Microsoft Software Engineer - 2of 2 votes
AnswerAirbnb Online Assessment Paginate List
- aonecoding October 13, 2017 in United States
5
13
1,28,310.6,SF
4,5,204.1,SF
20,7,203.2,Oakland
6,8,202.2,SF
6,10,199.1,SF
1,16,190.4,SF
6,29,185.2,SF
7,20,180.1,SF
6,21,162.1,SF
2,18,161.2,SF
2,30,149.1,SF
3,76,146.2,SF
2,14,141.1,San Jose
Here is a sample input. It’s a list generated by user search.
(1,28,100.3,Paris) corresponds to (Host ID, List ID, Points, City).
5 in the first row tells each page at most keeps 5 records.
13 in the second row is the number of records in the list.
Please paginate the list for Airbnb by requirement:
1. When possible, two records with same host ID shouldn’t be in a page.
2. But if no more records with non-repetitive host ID can be found, fill up the page with the given input order (ordered by Points).
Expected output:
1,28,310.6,SF
4,5,204.1,SF
20,7,203.2,Oakland
6,8,202.2,SF
7,20,180.1,SF
6,10,199.1,SF
1,16,190.4,SF
2,18,161.2,SF
3,76,146.2,SF
6,29,185.2,SF -- 6 repeats in page bec no more unique host ID available
6,21,162.1,SF
2,30,149.1,SF
2,14,141.1,San Jose| Report Duplicate | Flag | PURGE
Airbnb Software Engineer Algorithm - 2of 2 votes
AnswersFind the indices of all anagrams of a given word in a another word.
- aonecoding October 09, 2017 in United States
For example: Find the indices of all the anagrams of AB in ABCDBACDAB (Answer: 0, 4, 8)| Report Duplicate | Flag | PURGE
Amazon Software Engineer Algorithm - 1of 1 vote
AnswersGiven 2 words, return true if second word has a substring that is also an anagram of word 1.
- anonymous October 07, 2017 in United States
LGE , GOOGLE- True
GEO, GOOGLE - False| Report Duplicate | Flag | PURGE
Google Software Engineer - 1of 1 vote
AnswersGiven two list of unsorted intervals V1 and V2 write 2 functions 'OR ' and 'And' to return a new list
- sachin323 October 05, 2017 in United States
OR Function (union of list ): Input V1 = (2,4) (6,8) (1,3) V2 = (7,9) (2,5)
output = (1,5) (6,9)
And function : This will be intersection function and will return intersection of the lists| Report Duplicate | Flag | PURGE
Uber Software Engineer Algorithm - 0of 0 votes
AnswersCheck if two DOM Trees have the same text.
- wtcupup2017 September 28, 2017 in United States
e.g. <html><p>hello</p></html>, <html><p><b>h</b>ello</p></html> should be the same text
DOMNode class definition (string tag, string text, bool isText, vector<DOMNode*> children)| Report Duplicate | Flag | PURGE
Google Software Engineer Algorithm - 1of 1 vote
Answerscreate a class of integer collection,
- aonecoding September 22, 2017 in United States
3 APIs:
append(int x),
get(int idx),
add_to_all(int x),
in O(1) time。
Follow-up:
implement
multiply_to_all(int x)
e.g.
insert(1)
insert(2)
add_to_all(5)
insert(3)
get(0) -> returns 6
get(2) -> return 3
multiply_to_all(10)
insert(4)
get(1) -> returns 70
get(2) -> returns 30
get(3) -> returns 4| Report Duplicate | Flag | PURGE
Google Software Engineer Algorithm - 0of 0 votes
AnswersLonely Pixel
- aonecoding September 22, 2017 in United States
Given an N x M image with black pixels and white pixels, if a pixel is the only one in its color throughout its entire row and column, then it is a lonely pixel. Find the number of lonely pixels in black from the image. (O(NM))| Report Duplicate | Flag | PURGE
Google Software Engineer Algorithm - 1of 1 vote
AnswersFind max size of contiguous shape below, where X represents a shape and . is empty:
- steez September 21, 2017 in United States
.XXXXXX....
...X..XX..X
...XXXX....
..X.....X..
..XXX..XX..
.....XX....
/*method stub*/
public int GetMaxShape(char[][] array) {
}
i was able to come up with a recursive solution but i'd love tips on a dp solution| Report Duplicate | Flag | PURGE
Google Software Engineer - 0of 0 votes
AnswersInserting dashes between two odd numbers and star between two even numbers
- praveenz.poola September 15, 2017 in India| Report Duplicate | Flag | PURGE
JP Morgan Software Engineer - 2of 2 votes
AnswersPrint Common Suffix In Strings
- praveenz.poola September 15, 2017 in India
Ex: cornfiled , Exfiled --- field| Report Duplicate | Flag | PURGE
Cisco Systems Software Engineer Java - 0of 0 votes
AnswersGiven an unsorted array. for example [2, 3, 1, 4, 5].
- OldChang September 12, 2017 in United States
Sort the array, we have new array [1, 2, 3, 4, 5],
if we draw the line between the 2 arrays for the same number, for example:
[3, 2, 1,4,5]
\ | /
\|/
/|\
[1, 2, 3,4,5]
then we have 3 line-cross:
line (1 to 1) cross line (2 to 2)
line (1 to 1) cross line (3 to 3)
line (2 to 2) cross line (3 to 3)
Note: the line between two 4s and the line between two 5s don't cross any other lines;
Implement the algorithm to calculate the how many line crosses for an unsorted array.| Report Duplicate | Flag | PURGE
Software Engineer Algorithm - 0of 0 votes
AnswersYou are given an alphanumeric string. Complete the function sortSegments that will segment the string into substrings of consecutive letters or numbers and then sort the substrings.
- Smart September 11, 2017 in United States
For example, the string "AZQF013452BAB" will result in "AFQZ012345ABB". The input letters will be uppercase and numbers will be between 0 and 9 inclusive.| Report Duplicate | Flag | PURGE
Software Engineer - 0of 0 votes
AnswersYou are given an integer array n. Complete the function sortIntegers which takes as an argument, an integer array n of up to 1 million integers such that 1 <= n_i <= 10.
- Smart September 11, 2017 in United States
for every element n_i in the array, and returns the sorted array. The sort does not need to occur in-place.
Please do not call a standard sorting function like quicksort, you can do better. A sample input is {3, 1, 4, 1, 5, 9, 2, 6, 5} and the corresponding output is {1, 1, 2, 3, 4, 5, 5, 6, 9}. Constraints: i <= 10^9; 1 <= n_i <= 10| Report Duplicate | Flag | PURGE
Software Engineer
Open Chat in New Window