Recent Interview Questions
- 3of 3 votes
AnswersDropBox Dec 2017
- aonecoding December 15, 2017 in United States
Congrats to Brian landing @DropBox
Dropbox always has the most responsive HR and gives review on the interview within a week. The canteen is also one of the best in Bay Area.
Phone:
LC: game of life
What if the board is huge?
Store in disk
with bitmap
Load into memory, process and write to disk row by row
Visit AONECODE.COM for private lessons by FB, Google and Uber engineers
Our ONE TO ONE class offers
SYSTEM DESIGN Courses (highly recommended for candidates of FB, LinkedIn, Amazon, Google & Uber etc.)
ALGORITHMS (conquer DP, Greedy, Graph, Advanced Algos & Clean Coding),
latest interview questions sorted by companies,
mock interviews.
Members get hired from G, U, FB, Amazon, LinkedIn, MS and other top-tier companies after weeks of training.
Email us aonecoding@gmail.com with any questions. Thanks!
Onsite:
Round 1:
Given an array of byte and a file name, find if the array of byte is in file.
Solution: Rolling hash
Round 2:
Given an Iterator of some photo with IDs, find the top K most hit photo IDs.
Follow up: What if the input is from a stream? When iterator reaches the end, moments later new hits can be added to the iterator. Modify code for this scenario.
Lunch was great.
Then came a demo round. Discussed Dropbox Paper| Report Duplicate | Flag | PURGE
Dropbox Software Engineer - 3of 3 votes
AnswersCongrats on aonecode.com member V.S. on the offer from Microsoft and thanks for sharing with us the experience.
- aonecoding December 02, 2017 in United States
Coding Question 1 - Find all the paths between two nodes
Coding question 2 : Max sum in adjacent sub array
Design Question - Design a ticketing System
Design Question 2 - Design a system which allows multiple agents to read different data from same tables. Latency should be low. Algorithm should rank agents through some logic and assigned work according to that so that each agents are reading different set of rows from same table. Scale it for 20 million active agents .
Follow up - If Data Sharding is allowed, what will be the Shard Id and how the partition will look like? How your system will respond if there are agents which are also writing at same time. Consistency should be given high preference over availability.
Looking for coaching on interview prep?
Visit AONECODE.COM for ONE-TO-ONE private lessons by FB, Google and Uber engineers!
Customized course covers
System Design (for candidates of FB, LinkedIn, AMZ, Google & Uber etc)
Algorithms (DP, Greedy, Graph etc. every aspect you need in a coding interview & Clean Coding)
Interview questions sorted by companies
Mock Interviews
Our members got into G, U, FB, Amazon, LinkedIn, MS and other top-tier companies after weeks of training.
Feel free to email us aonecoding@gmail.com with any questions. Thanks!| Report Duplicate | Flag | PURGE
Microsoft Software Engineer Algorithm - 3of 3 votes
AnswersI get a chance to talk to Facebook software engineer during my android engineer interview. He asked me couple of question about native android like diff between views and fragment, mutable and immutable string, diff between string builder and string and a programming question convert int into words.
- Helper Guide September 08, 2017 in UK| Report Duplicate | Flag | PURGE
Facebook Android Engineer Android - 3of 3 votes
Answerscreate a grid and show data, they have provided some JSON file for it. we should be able to configure sorting anf fitering for some coumns. paging is also required. we need to make it in pure JS.
- rajansoft1 May 14, 2015 in India| Report Duplicate | Flag | PURGE
Payu Software Engineer JavaScript - 3of 0 votes
AnswersFunction which lists all the possible dates for given year.
- Ripul Patel May 09, 2008| Report Duplicate | Flag | PURGE
Epic Systems Software Engineer / Developer Coding - 3of 0 votes
AnswersHad a phone interview with Bloomberg... some time back. These were the questions....
- Stranger September 09, 2007
1) Difference between delete and free.
2) Why cant one throw exception from destructor.
3) How is exception handling implemented in C++
3a)What is stack unwinding in exception handling.
4) Given two files find the intersection of it in O(n). What if files are too large, i.e. memory constraint.
5) How is fork and exec different
6) How is background and foreground process implemented in unix shell
7) How to bring some process in foreground.
8) How to find if some process is leaking memory.
9) Given a code, where are static, object cretead by new and automatic members stored.
10) What is memory leak and why.
11) What is auto-ptr and how is it implemented.
12) What happens in fork .. expalain.| Report Duplicate | Flag | PURGE
Bloomberg LP Software Engineer / Developer Algorithm - 3of 0 votes
AnswersWrite a code to calculate kth power of a matrix of size nxn. You can assume that matrix multiplication is O(n^3).
- Meghna December 05, 2008| Report Duplicate | Flag | PURGE
Amazon Software Engineer / Developer Matrix - 3of 0 votes
AnswersThere are 10 PC in a network. 9 PC work fine and can open any internet website including google.com
- Prateek Mehrotra April 18, 2008
but 10th pc in network had a small exception. You can surf any website on that pc but when you try to open google.com its shows page not found error.
Whats is the problem on that 10th pc and how you will resolve it ?| Report Duplicate | Flag | PURGE
Citrix Online Software Engineer in Test Networking / Web / Internet - 3of 0 votes
AnswersGiven an array of positive and negative numbers, find the maximum sum of any subsequence. Return both the sum and the subsequence.
- xmagics August 31, 2008| Report Duplicate | Flag | PURGE
Amazon Software Engineer / Developer Coding - 2of 10 votes
AnswersHow many times “Hello World” is printed by following program?
- whatsmyname1993 October 22, 2013 in India
int main()
{
if(fork() && fork())
{
fork();
}
if(fork() || fork())
{
fork();
}
printf(“Hello world”);
return 0;
}
a. 16
b. 20
c. 24
d. 64| Report Duplicate | Flag | PURGE
Google Software Engineer / Developer Operating System - 2of 6 votes
Answersthere is an infinite line.you are standing at a particular point you can either move 1 step forward or 1 step backward.you have to search for an object in that infinite line.your object can be in any direction. Give optimal algorithm.
- Amit September 03, 2013 in United States| Report Duplicate | Flag | PURGE
Amazon - 2of 6 votes
AnswersCOUNT 1s in BINARY FORMAT OF A NUMBER.
- codechamp March 29, 2014 in United States for Search| Report Duplicate | Flag | PURGE
A9 Software Engineer / Developer - 2of 6 votes
AnswersGiven an array of n numbers with repetition of numbers. You need to find the max length of continuous sub array with at max 3 unique elements.
- Nascent August 05, 2013 in India
For eg
array: 1 2 3 1 4 3 4 1 2
ans: 6 (3 1 4 3 4 1)
Solution: Time complexity O(n)
Extra Space O(1)| Report Duplicate | Flag | PURGE
Amazon - 2of 4 votes
Answers/*
- friendlytechs June 25, 2014 in United States
Write an algorithm that brings all nonzero elements to the left of the array, and returns the number of nonzero elements.
Example input: [ 1, 0, 2, 0, 0, 3, 4 ]
Example output: 4
[1, 4, 2, 3, 0, 0, 0]
* The algorithm should operate in place, i.e. shouldn't create a new array.
* The order of nonzero elements does not matter
*/| Report Duplicate | Flag | PURGE
Facebook Android test engineer - 2of 4 votes
AnswersGiven a sequence of numbers A(1) ..A(n), find the continuous subsequenceA(i)..A(j) for which the sum of elements is maximum.
- pirate July 28, 2013 in India
condition: we should not select two contiguous numbers| Report Duplicate | Flag | PURGE
Yahoo Facebook Software Engineer / Developer Algorithm - 2of 4 votes
AnswersA string contains a-z, A-Z and spaces. Sort the string so that all lower cases are at the beginning, spaces in the middle and upper cases at the end. Original order among lower and upper cases needs to remain the same. For example: a cBd LkmY becomes ackm BLY. Is there a way in O(n) without extra space?
- chad August 13, 2015 in United States| Report Duplicate | Flag | PURGE
Amazon Software Developer Algorithm Arrays - 2of 4 votes
AnswersGiven a sorted array of integers, write a function that will return the number with the biggest number of repetitions.
- GeorgyBoy December 30, 2013 in Israel
(Asked to refine the solution to be more efficient)| Report Duplicate | Flag | PURGE
Google Software Engineer / Developer Algorithm Arrays Coding Data Structures Problem Solving Sorting - 2of 4 votes
AnswersThere is an array of 3-tuple, in the form of (a, 1, 5). The first element in the tuple is the id, the second and third elements are both integers, and the third is always larger than or equal to the second. Assume that the array is sorted based on the second element of the tuple. Write a function that breaks each of the 3-tuple into two 2-tuples like (a, 1) and (a, 5), and sort them according to the integer.
- Nobody September 11, 2014 in United States
E.g. given (a, 1, 5), (b, 2, 4), (c, 7, 8), output (a, 1), (b, 2), (b, 4), (a, 5), (c, 7), (c, 8).| Report Duplicate | Flag | PURGE
Google Software Engineer / Developer Algorithm - 2of 4 votes
Answersfind the substring count from a string without string functions in java?
- Neo March 05, 2013 in United States
Given String str = "abcdefghcde";
String find = "cde";
Count occurrences of cde in String str| Report Duplicate | Flag | PURGE
Salesforce Software Engineer Intern Java - 2of 4 votes
AnswersPartition a set of numbers into two such that difference between their sum is minimum, and both sets have equal number of elements.
- anonymous August 16, 2011
For example: {1, 4, 9, 16} is partitioned as {1,16} and {4,9} with diff = 17-13=4.
Does greedy work here? First sorting, and then picking smallest and largest to fall in set 1, and picking 2nd smallest and 2nd largest to fall in set 2.
I was asked to prove which I failed :(| Report Duplicate | Flag | PURGE
Google - 2of 4 votes
AnswersInplace reverse a sentence
You given a sentence of english words and spaces between them.
Nothing crazy:
1) no double spaces
2) no empty words
3) no spaces at the ends of a sentencevoid inplace_reverse(char* arr, int length) { // your solution }
Example:
- Sergey January 17, 2015 in United States
input "I wish you a merry Christmas"
output "Christmas merry a you wish I"
Constrains: O(1) additional memory| Report Duplicate | Flag | PURGE
Facebook Software Engineer / Developer Algorithm - 2of 4 votes
AnswersGiven a binary tree return the level with maximum number of nodes
- ruddermechanic February 07, 2013 in United States1 / \ 2 3 /\ /\ 4 5 6 7 / \ 8 9
| Report Duplicate | Flag | PURGE
Microsoft Software Engineer / Developer Trees and Graphs - 2of 4 votes
AnswersGiven a dictionary, and a list of letters ( or consider as a string), find the longest word that only uses letters from the string. [I didn't meet this question, what's the best solution?]
- Obiwana March 11, 2014 in United States| Report Duplicate | Flag | PURGE
Google Software Engineer / Developer - 2of 4 votes
AnswersHow do you find the greatest 1000 elements in a list of a million elements? No other information given. What would be the runtime? Hint: You can do better than O(n log n). I didn't realize but it could be possible with Tree or Heaps.
- Ana April 23, 2013 in United States| Report Duplicate | Flag | PURGE
Google Software Engineer / Developer Algorithm - 2of 4 votes
AnswersC program to Delete a node from SLL, in which the last node points to the middle node( in case of even no of nodes, it points to the first middle node) and update the SLL.
- saran August 06, 2013 in India| Report Duplicate | Flag | PURGE
Microsoft Program Manager Intern Linked Lists - 2of 4 votes
AnswersWe have a long string. We label some substrings with tags.
- Bill December 10, 2015 in United States
- A tag entry is [startIndex, endIndex, tag].
- Query: 1 or more tags
- Output: all blocks/ranges with all queried tags.
Example tag entries:
[23, 72, 0] // label [23, 72) with tag 0
[34, 53, 1] // label [34, 53) with tag 1
[100, 128, 0]
Query and Output:
0 => [23, 72], [100, 128]
0,1 => [34,53] // [34, 53) matches both tag 0 and 1
Give an efficient algorithm. Please describe your algorithm before posting code.
**Edit**: To add some difficulties, partial overlap is treated the same as full overlap, ONLY the overlapped part matches both tags. E.g. if we have entries:
[23, 72, 0] // label [23, 72) with tag 0
[10, 53, 1] // label [34, 53) with tag 1
Query and Output:
0,1 => [23,53] // [23, 53) matches both tag 0 and 1
Minor detials: Note in the comments we used open range on the right, i.e. if the string named "str", [23, 72, 0] includes str[23] but NOT str[72]; and there's no overlap between the following entries:
[23, 72, 0]
[10, 23, 0]| Report Duplicate | Flag | PURGE
Google Senior Software Development Engineer Algorithm - 2of 4 votes
AnswersYou are given a matrix n rows, m columns where each row is sorted in increasing order. Find median of the overall elements. What is the time complexity?
- emb September 07, 2015 in United States| Report Duplicate | Flag | PURGE
Google Software Engineer - 2of 4 votes
AnswersGiven an Array, replace each element in the Array with its Next Element(To its RHS) which is Larger than it. If no such element exists, then no need to replace.
- R@M3$H.N March 03, 2014 in United States
Ex:
i/p: {2,12,8,6,5,1,2,10,3,2}
o/p:{12,12,10,10,10,2,10,10,3,2}| Report Duplicate | Flag | PURGE
Amazon SDE-2 Algorithm - 2of 4 votes
AnswersImagine x is an operand and * is a binary operator. We say a string of x and * follows Reverse Polish notation if it is a postfix notation.
- mahdi.oraei March 03, 2014 in United States
For example strings xx*, x, and xx*xx** follow Reverse Polish notation.
Given a string of x and *, how many insert, delete, and replace operations are needed to make the string follow the RPN.
For example, xx* need 0 operation to follow RPN since it already follows RPN.
x*x needs two operations to become xx* which follows RPN.
*xx* needs one operation to become xx* which follows RPN.
Your algorithm should work for a string of size up to 100.| Report Duplicate | Flag | PURGE
Facebook Developer Program Engineer