Software Engineer / Developer Interview Questions
- 3of 3 votes
AnswersGiven a string and a dictionary. Break the string into meaningful words.
- RXH February 21, 2013 in United States| Report Duplicate | Flag | PURGE
Google Software Engineer / Developer Algorithm - 3of 3 votes
Answersvery large bytestream (PB)
- Yashwanth January 08, 2013 in United States for Youtube
synchronization algorithm
given:
unsigned char read_byte(); ← side effect that it advances a byte pointer in the stream
write:
unsigned char read_sync_byte(); ← may result in >1 calls to read_byte()
remove byte '03' from the stream if the stream is in pattern 00 00 03
Example:
read_byte():
00 0f 42 17 00 00 03 74 00 00 00 00 14 ...
read_sync_byte():
00 0f 42 17 00 00 74 00 00 00 00 14 ...| Report Duplicate | Flag | PURGE
Google Software Engineer / Developer Algorithm - 3of 3 votes
AnswersGiven a board made of 2 x n squares, and boards made of 2 x 1 squares, write a function that will calculate the number of possible ways to arrange the 2 x 1 boards on the 2 x n board, in a way that will fill it completely.
- GeorgyBoy December 30, 2013 in Israel
(Asked to refine the solution to be more efficient)| Report Duplicate | Flag | PURGE
Google Software Engineer / Developer Algorithm Coding Problem Solving - 3of 3 votes
AnswersYou have three jars filled with candies. One jar is filled with banana candies, one jar is filled with lemon candies and one jar has a mix of both. All the jars are mislabelled (i.e. all the jars have wrong labels about what kind of candies they contain).
- rpisid November 14, 2013 in United States
All the candies look very similar in shape, size and color and they even smell the same. The only way to distinguish them is by tasting.
You have to eat one and only one candy to determine the correct jar labels. You can eat that one candy from any jar you want as long as you eat only one in total.| Report Duplicate | Flag | PURGE
Microsoft Software Engineer / Developer Brain Teasers - 3of 3 votes
AnswersGiven pointer to the bytes array on size N that represents big integer "a" and 2-bytes integer "b" implement mod (%) operation for them: a % b
- russ.kovich December 14, 2012 in United States for Bing| Report Duplicate | Flag | PURGE
Microsoft Software Engineer / Developer Bit Manipulation - 3of 3 votes
AnswersWhen is that we we want to use "user virtual address" instead of "kernel virtual address"? List some situations when we cannot go with kernel virtual address.
- chvishu87 April 06, 2013 in United States| Report Duplicate | Flag | PURGE
Qualcomm Software Engineer / Developer Linux Kernel - 3of 3 votes
AnswersAs an input, you have points on a 2D graph. You aim to find a straight line that can fit as my points as possible. Return, the maximum number of points you can fit.
- Bobika December 05, 2016 in United States| Report Duplicate | Flag | PURGE
Google Software Engineer / Developer - 3of 3 votes
AnswersPrint all paths of a binary tree from root to leaf.
- meh March 23, 2014 in United States
Later, extend the solution to work with graphs, careful attention to cycles which you should print as paths as well (without printing visited nodes twice).| Report Duplicate | Flag | PURGE
Facebook Software Engineer / Developer Data Structures - 3of 3 votes
AnswersDesign a Restaurant Reservation system.
- learner January 09, 2013 in United States| Report Duplicate | Flag | PURGE
Amazon Software Engineer / Developer Object Oriented Design System Design - 3of 3 votes
AnswersHow would you design transfer of data packets from NY to Tokio?
- gbabun April 26, 2011
First I thought of traveling salesman problem where weight of connections between nodes is throughput of network. This problem is NP which lead just to interviewers reply that I should care about design of system, recovery of data and acknowledge whether data has been transferred.| Report Duplicate | Flag | PURGE
Google Software Engineer / Developer Computer Architecture & Low Level - 3of 3 votes
AnswersGiven a sorted array. Now following operations may be applied on even position elements:
- NIC October 03, 2014 in India
swap elements on even position. An element may be swap only once.
eg. 1 2 3 4 5 6 7 8 9 10
modified array:
1 2 3 8 5 10 7 4 9 6.
Find any given element in less than o(n) complexity.| Report Duplicate | Flag | PURGE
Josh Software Engineer / Developer Algorithm - 3of 3 votes
Answerswhen we have to override equals and hashcode in java..?
- PRASHANTGAURAV November 12, 2013 in India
what will happened if you dont override .. Explain with program.| Report Duplicate | Flag | PURGE
Amazon Software Engineer / Developer Java - 3of 3 votes
AnswersFirst the interviewer have called me on time, he introduced himself and his project which takes about 10 minutes, then he asked me why do you want to join facebook..
- neal January 05, 2011
Then he started in the technical questions, the first questions was:
he described to me a game called othelo (http://en.wikipedia.org/wiki/Reversi) which is a 2 player board game using for example X and O, if player X placed X in an empty space
_OOOX
the O's between the two X's will be converted to X
XOOOX ==> XXXXX
this will happen on the current row, column, and the two diagonals in every directions
and if the following case happened
__OOX
and the X player placed X in the first space
X_OOX
nothing occured for the two Os
given a certain state of the board, location on the board, a certain piece
to place on the given location
update the board, and make the required validations
Then I started to code the required method, then have revised it and fixed small bugs, then he told me that it seems to be working.
then we turned to the second question:
which is given a Collection<String> words, return a Collection<String> of anagrams found in the given collection for example "The rat fell in the tar" => returned [rat tar]
Then I have discussed him in an algorithm with O(n k lg k) where n is the number of words and k is the average length of the word, then I started to code it and then he said that it seems to be working.
then the interview is finished.
Notes:
* Try to practice a lot before the interview, by solving such problems and try to mimic the interview environment by coding in the collabedit.com text editor
* Don't use Ctrl + S while coding in collabedit as it may lead to some problems.
* Don't be afraid before the interview, just calm down as the interviewers are very friendly.
Good Luck :)| Report Duplicate | Flag | PURGE
Facebook Software Engineer / Developer - 3of 3 votes
AnswersAsked in Google - 2020, Goldman Sachs - 2020
- Gaurav Sohaliya August 22, 2020 in India
Given two Array.
A = [1,3,4,2,5,6] B = [3,4,6,5,7]
we have to remove 3,1,2,6 and Insert 6,7 to make A equal to B.
we can delete and insert any element at anywhere from first array and make that array same as second array. Output is Minimum Number of elements required to be insert in first array.
constraints:
1 <= First Array Size <= 10^5
1<= Second Array SIze <= 10^5
1 <= firstarray[i] <= 10^9
1 <= secondarray <= 10^9
second array consist of distinct element.
Note : it is same as edit distance but here our constraints are 10^5.| Report Duplicate | Flag | PURGE
Goldman Sachs Software Engineer / Developer Arrays - 3of 3 votes
Answersn points on a 2D space. You observe the points from (0,0) with viewing direction and viewing angle.
- Casper November 17, 2016 in United States
Given an array (xn,yn), and a viewing angle v (45 degree), find the direction that can observe max number of points.| Report Duplicate | Flag | PURGE
Google Software Engineer / Developer C++ - 3of 3 votes
AnswersWrite your own regular expression parser for following condition:
- techpanja October 22, 2013 in United States for yammer
az*b can match any string that starts with and ends with b and 0 or more Z's between. for e.g. azb, azzzb etc.
a.b can match anything between a and b e.g. ajsdskjb etc.
Your function will have to parameters: Input String and Regex. Return true/false if the input string satisfies the regex condition. Note: The input string can contain multiple regex. For e.g. az*bc.g| Report Duplicate | Flag | PURGE
Microsoft Software Engineer / Developer - 3of 3 votes
AnswersDesign a system for showing quotes on the web.
- Steve November 09, 2012 in United States
For example, when the user is looking at page A, part of which is reproduced in page B, the system could highlight part of page A present the user with a link to page B.
This is an open-ended system design question.
What constitutes a quote?
How do you find quotes?
How do you make it scale to the web?
How do you handle updates?
How would you arrange the servers?
What data structures would you use?
How much storage would you need?
How would the user agent present information about quotes?| Report Duplicate | Flag | PURGE
Facebook Software Engineer / Developer Application / UI Design - 3of 3 votes
AnswersA soccer league has n matches with A,B,C teams with number of goals scored by each team in each match.If a team wins against another team ,It gets 3 points and lost team gets 0 point.If a tie ,both team gets 1 point.Now how do you frame the ranking of teams.
- sriramMS December 20, 2012 in United States
1) All teams played n matches.
2) A team 1 match,B Team 2 matches, 3 team 3 matches.Like wise it goes.
They looked for coding and data structure techniques.| Report Duplicate | Flag | PURGE
Amazon Software Engineer / Developer Algorithm Data Structures - 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
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
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 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
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
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