Software Engineer / Developer Interview Questions
- 1of 1 vote
AnswersGiven two sorted arrays, mergesort them into 2nd array that has enough space to accommodate both.
- JSDUDE January 21, 2015 in United States| Report Duplicate | Flag | PURGE
Clean Power Research Software Engineer / Developer Algorithm Arrays - 0of 0 votes
AnswerGiven two sorted arrays, merge sort in the 2nd array that has enough space to accommodate both
- JSDUDE January 21, 2015 in United States| Report Duplicate | Flag | PURGE
Clean Power Research Software Engineer / Developer Algorithm Arrays - 0of 0 votes
AnswersGiven a string write a function to return the length of the longest sub string with only unique characters
- JSDUDE January 21, 2015 in United States| Report Duplicate | Flag | PURGE
Clean Power Research Software Engineer / Developer String Manipulation - 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 - 5of 5 votes
AnswersThe closest common ancestor in a tree forest.
class Node { Node* parent; // == null for root of tree Node* left; Node* right; } Node* tree_forest[]; // array of pointers which points to roots of each tree respectively Node* closest_common_ancestor(Node* n1, Node* n2) { // your solution }
Example:
| a | j | / \ | / | b c | h | / / \ | |d e f |
for e and d CCA is a
- Sergey January 17, 2015 in United States
for e and f CCA is c
for e and c CCA is c
for h and d CCA is null
Constrains: O(1) additional memory| Report Duplicate | Flag | PURGE
Facebook Software Engineer / Developer Algorithm - 0of 0 votes
AnswersDesign a URL system.
- JSDUDE January 16, 2015 in United States
He even wanted to know what kind of algorithm to use, improve the speed, availability etc.| Report Duplicate | Flag | PURGE
Facebook Software Engineer / Developer System Design - 2of 2 votes
AnswersGiven a 4 X 4 game slot that has random alphabets in all the slots
- JSDUDE January 16, 2015 in United States
Write a function that takes the keyboard and the word as input and returns true if the word can be formed
False otherwise.
A word can be formed on the board by connecting alphabets adjacent to each other (horizontal, vertical and diagonally)
Same alphabet should not be reused.| Report Duplicate | Flag | PURGE
Facebook Software Engineer / Developer Algorithm - 1of 1 vote
AnswersGiven a set of n people, find the celebrity.
- JSDUDE January 16, 2015 in United States
Celebrity is a person who:
1. Knows only himself and no one else
2. Every one else knows this person
You are given the following helper function:
bool knows(i, j);
Returns:
True: If i knows j
False: otherwise
I proposed the O(n2) algorithm at first but he wanted me to improve on it. He wanted an O(n) algorithm| Report Duplicate | Flag | PURGE
Facebook Software Engineer / Developer - 0of 0 votes
AnswersYou have a list of words with ranking.
- JSDUDE January 16, 2015 in United States
Now you need to create a function that will take this list as input and provide a way so that a T9 keyboard can provide three top results of probable words based on rankings for the numbers punched in.| Report Duplicate | Flag | PURGE
Facebook Software Engineer / Developer Algorithm - 0of 0 votes
AnswersBy tossing a coin we can get either head or tail, i have a function toss() which return head or tail with equal probability.
- rohit January 16, 2015 in India
You have to write a function for dice which will return number from 1-6 with equal probability.
constraints : you can not use random function, you can use only toss function.| Report Duplicate | Flag | PURGE
Practo Software Engineer / Developer Algorithm - -1of 1 vote
AnswersTree to List: convert a binary tree to a circular doubly-linked list
- Kiara January 15, 2015 in United States| Report Duplicate | Flag | PURGE
Facebook Software Engineer / Developer - 0of 0 votes
AnswerGive an architecture diagram with all entities and relationships of a multi user wysiwyg editor . basically a web interface to multiple authors who can edit and store their docs . multiple ppl should be able to save it at once . also ownership should be present for documents
- sh January 12, 2015 in India| Report Duplicate | Flag | PURGE
Amazon Software Engineer / Developer System Design - -1of 1 vote
Answersroll two dice, what is the probability of rolling no sixes?
- Kiara January 12, 2015 in United States| Report Duplicate | Flag | PURGE
Facebook Software Engineer / Developer - 1of 1 vote
AnswersWrite a program to reverse contents of a file in place..for example if file has "abcde" after executing program the contents should be "edcba". The program should be efficient.. You can use fwrite & fread apis...
- sandeep.bvb January 10, 2015 in United States
I wrote using fread and fwrite, by reading 1 char at a time and replacing with one at the other end.. He seemed not happy as the I/O was high...| Report Duplicate | Flag | PURGE
Amazon Software Engineer / Developer C# - 0of 0 votes
Answersin one string array{'Good',''word','good','woRd'...}
- pogiriykirankumar January 10, 2015 in India
how can i print like Good--2
Word-2 times appeared in the array.even Good and good are different in case sensitive.| Report Duplicate | Flag | PURGE
Goldman Sachs Software Engineer / Developer - 0of 2 votes
AnswersIN phone directory,i have like below details
- pogiriykirankumar January 10, 2015 in India
ABc---123
bcd--345
cda--523
abc--678.
So if i want to see Abc person phone numbers we should get the both the numbers,how can we implement this in java| Report Duplicate | Flag | PURGE
Goldman Sachs Software Engineer / Developer - 2of 2 votes
AnswersYou have String array like{'cat','good','tac','act''....} like some 1000 words.
- pogiriykirankumar January 10, 2015 in India
So if i give input tac ,output should be cat and act..
How can we implement with less complexity| Report Duplicate | Flag | PURGE
Goldman Sachs Software Engineer / Developer Algorithm - 0of 0 votes
AnswersWe have rectangular and inside many rectangular were drawn.So if we click on main Rectangular we should get the count of rectangular's ..For this how can we implement in java
- pogiriykirankumar January 10, 2015 in India| Report Duplicate | Flag | PURGE
Goldman Sachs Software Engineer / Developer - 1of 1 vote
AnswersFind the maximum number of non-intersecting events in a calendar.
- Kiara January 09, 2015 in United States for Infrastructure| Report Duplicate | Flag | PURGE
Facebook Software Engineer / Developer - 0of 0 votes
AnswersWrite a function to print the rows of a binary tree, terminating each row with a carriage return
- Kiara January 09, 2015 in United States| Report Duplicate | Flag | PURGE
Facebook Software Engineer / Developer - 0of 0 votes
AnswersImagine a large city like Los Angeles. Suppose someone shows up at location A, then N minutes later at location B. Design a function that approximates the probability they passed a Starbucks.
- NeutrinoPlus January 08, 2015 in United States| Report Duplicate | Flag | PURGE
Amazon Software Engineer / Developer Algorithm - 0of 0 votes
AnswersGiven a table of [Url, Content] pairs produce a new table of [Url, Set of duplicate Urls].
- jali_smith January 07, 2015 in United States
Example Input:
a.com => <html>a</html>
b.com => <html>b</html>
c.com => <html>c</html>
d.com => <html>a</html>
e.com => <html>a</html>
Example Output:
a.com => [d.com, e.com]
b.com => []
c.com => []| Report Duplicate | Flag | PURGE
Google Software Engineer / Developer Algorithm - 1of 1 vote
AnswersGiven a Tree:
A /\ B C /\ /\ D E F G
Write a function that prints:
- santidltp January 05, 2015 in United States
A
BC
DEFG| Report Duplicate | Flag | PURGE
Facebook Software Engineer / Developer Algorithm - 0of 0 votes
AnswersThere are Some team owners who want to communicate with other team owners through some mediators regarding player transfer mechanism.A team owner has to consult more than 1 mediator in order to talk with some other team owner and at least one mediator is required to carry out talk between team owners.Each mediator can have maximum of 2 mediator under it and a mediator which has no mediator under it will have atleast one team owner and at max 2 team owners under it .A mediator which has at least one mediator under it will not have any team owner under it . Your task is to find the maximum number of mediators between talk of any two team owners.
- puranik.saket January 04, 2015 in India| Report Duplicate | Flag | PURGE
Symantec Software Engineer / Developer Algorithm - 1of 1 vote
Answersboolean checkPattern(String str)
- NIC January 03, 2015 in India
{
// Implementation
}
Implement the method checkPattern. str is a string argument.
Return true: if the string is following any pattern
example: xyzxyzxyz
Here "xyz" is the pattern
return false: String is not following pattern
example: xyzxyzA
A is not in part of pattern.| Report Duplicate | Flag | PURGE
Interra System Software Engineer / Developer Algorithm - 1of 1 vote
Answers1) You have a folder full of .bin files that are proprietary.
- haroldtreen January 03, 2015 in United States
2) You have a class called converter with a "binToTSV" method which you can pass the name of a .bin file and will generate a .tsv file.
3) The TSV file is a tab separated value file with a key on each line, and a value next to it spaced with a tab as such.
-------
num_connections 65
latency_ms 70
bandwidth 20
.... //etc.
-------
Q: Write a method to calculate the average latency and total bandwidth.| Report Duplicate | Flag | PURGE
Twitter Software Engineer / Developer Coding - 6of 6 votes
AnswersGiven an array of ages (integers) sorted lowest to highest, output the number of occurrences for each age.
- streamer December 31, 2014 in United States
For instance:
[8,8,8,9,9,11,15,16,16,16]
should output something like:
8: 3
9: 2
11: 1
15: 1
16: 3
This should be done in less than O(n).| Report Duplicate | Flag | PURGE
Facebook Software Engineer / Developer Algorithm - -5of 5 votes
AnswersHaving A List of int [1,1,1,3,1,2,1,1,4,1]
- NullVoid December 31, 2014 in India for ERP
Output needed [1,5,6,3,7,2,8,9,4,10]
Note: Need not to change value of 3,2,4| Report Duplicate | Flag | PURGE
N/A Software Engineer / Developer Arrays Java Linked Lists - 0of 0 votes
AnswersDesign an algo to decide if the GO game is over. i.e.
- thefunnyclick1990 December 23, 2014 in United States
Given a boolean matrix, write a code to find if an island of 0's is completely surrounded by 1's.| Report Duplicate | Flag | PURGE
Google Software Engineer / Developer