Software Engineer Intern Interview Questions
- 2of 2 votes
AnswersThere's a new language which uses the latin alphabet. However, you don't know the order among letters.
- Victor November 27, 2014 in United States
It could be:
a b c d ...
as it could also be:
b e z a m i ...
You receive a list of words lexicographically sorted by the rules of this new language. From this list, derive one valid particular ordering of letters in this language.| Report Duplicate | Flag | PURGE
Facebook Software Engineer Intern Algorithm - 7of 7 votes
AnswersWhat is the maximum number of edges you could add to n vertexes to make a acyclic undirected graph?
- wwu November 21, 2014 in United States
Follow up:
What is the maximum number of edges you could add to n vertexes to make a acyclic directed graph?| Report Duplicate | Flag | PURGE
Google Software Engineer Intern - 1of 3 votes
AnswersImplement a vector-like data structure from scratch.
- Victor November 21, 2014 in Brazil
This question was to be done in C or C++.
Discussion topics:
1. Dealing with out of bounds accesses.
2. What happens when you need to increase the vector's size?
3. How many copies does the structure perform to insert n elements? That is, n calls to vector.push_back| Report Duplicate | Flag | PURGE
Google Software Engineer Intern Data Structures - -6of 8 votes
Answers2.
- mapan0817 October 30, 2014 in United States
String encode(List<String> input);
List<String> decode(String input);| Report Duplicate | Flag | PURGE
Google Software Engineer Intern - -5of 7 votes
AnswersThis is two questions I got from a google interview. Not very sure how to solve it. Any comments would be appreciated.
- mapan0817 October 30, 2014 in United States
1.
interface RateLimit {
/** Sets the rate, from 1 to 1000000 queries per second */
void setQPS(int qps);
/** accept or reject a request, called when request is received */
boolean allowThisRequest();
}
brief example:
server instantiates your object, calls setQPS(1)
at at time t, user1 makes a request, allowThisRequest() returns true
at time t+0.01 sec, user2 makes a request, allowThisRequest() returns false
at at time t+1, user4 makes a request, allowThisRequest() returns true
at time t+5 sec, user3 makes a request, allowThisRequest() returns true| Report Duplicate | Flag | PURGE
Google Software Engineer Intern Algorithm - 3of 3 votes
AnswersYou're given a dictionary of strings, and a key. Check if the key is composed of an arbitrary number of concatenations of strings from the dictionary. For example:
- davelee71047 October 25, 2014 in United States
dictionary: "world", "hello", "super", "hell"
key: "helloworld" --> return true
key: "superman" --> return false
key: "hellohello" --> return true| Report Duplicate | Flag | PURGE
Facebook Software Engineer Intern Algorithm - 1of 1 vote
AnswersJava: You're given a very large array of char's. Write a method to remove duplicates in the array, in place. Optimize for space complexity, not time complexity.
- davelee71047 October 24, 2014 in United States| Report Duplicate | Flag | PURGE
Microsoft Software Engineer Intern Arrays - 0of 0 votes
AnswersSay you're the development lead for a mobile application. A user submits a bug report saying that something isn't working right even though internal tests show that it should. What do you do?
- davelee71047 October 24, 2014 in United States| Report Duplicate | Flag | PURGE
Microsoft Software Engineer Intern Application / UI Design - 0of 2 votes
AnswersYou are driving a bus along a highway, full of rowdy, hyper, thirsty students and a soda fountain
- polo October 24, 2014 in United States
machine. Each minute that a student is on your bus, that student drinks one ounce of soda. Your
goal is to drop the students off quickly, so that the total amount of soda consumed by all students
is as small as possible.
You know how many students will get off of the bus at each exit. Your bus begins somewhere
along the highway (probably not at either end) and move s at a constant speed of 37.4 miles per
hour. You must drive the bus along the highway; however, you may drive forward to one exit then
backward to an exit in the opposite direction, switching as often as you like. (You can stop the
bus, drop off students, and turn around instantaneously.)
Describe an efficient algorithm to drop the students off so that they drink as little soda as
possible. Your input consists of the bus route (a list of the exits, together with the travel time
between successive exits), the number of students you will drop off at each exit, and the current
location of your bus (which you may assume is an exit).
I gave a recursive solution but he insisted on dynamic programming which i couldn't give| Report Duplicate | Flag | PURGE
A9 Software Engineer Intern Algorithm - 9of 9 votes
AnswersGiven a string (1-d array) , find if there is any sub-sequence that repeats itself.
- for.anonymous.usa October 22, 2014 in United States
Here, sub-sequence can be a non-contiguous pattern, with the same relative order.
Eg:
1. abab <------yes, ab is repeated
2. abba <---- No, a and b follow different order
3. acbdaghfb <-------- yes there is a followed by b at two places
4. abcdacb <----- yes a followed by b twice
The above should be applicable to ANY TWO (or every two) characters in the string and optimum over time.
In the sense, it should be checked for every pair of characters in the string.| Report Duplicate | Flag | PURGE
Google Software Engineer Intern Algorithm Brain Teasers C C++ Coding Data Structures Dynamic Programming Problem Solving String Manipulation - 4of 6 votes
AnswersWrite a program to implement Double Linked List from Stack with min. complexity.
- Purushotham Kumar October 20, 2014 in United States| Report Duplicate | Flag | PURGE
Google Software Engineer Intern Data Structures Java Linked Lists Stacks - 0of 0 votes
AnswersWhat are your strengths?
- cedric.foucault September 27, 2014 in United States for User Experience| Report Duplicate | Flag | PURGE
Siemens Software Engineer Intern General Questions and Comments - 0of 0 votes
AnswersDescribe your two best projects
- cedric.foucault September 27, 2014 in United States for User Experience| Report Duplicate | Flag | PURGE
Siemens Software Engineer Intern General Questions and Comments - 1of 1 vote
AnswersGiven a start position and an target position on the grid. You can move up,down,left,right from one node to another adjacent one on the grid. However there are some walls on the grid that you cannot pass. Now find the shortest path from the start to the target.
- fmars September 07, 2014 in United States
(This is easy done by BFS)
Extend. If you can remove three walls, then what is the shortest path from start to the target. (I have no ideal except for enumerate all the possibility of three walls. It must be the silly solution.) Does anyone have any idea?| Report Duplicate | Flag | PURGE
Google Software Engineer Intern Algorithm - 1of 3 votes
AnswersJAVA:
- abcabc August 29, 2014 in United States
Given an array say of length 1000; Pick up every value from every 20th index and store it in a separate array. Make sure to loop through all the elements in the array. Example: newArray1 = {0, 20, 40, 60, ..};
newArray2 = {1, 21,41, 61, ..};| Report Duplicate | Flag | PURGE
Amazon Software Engineer Intern Data Structures - 0of 0 votes
AnswersGiven an array say of length 1000; Pick up every value from every 20th index and store it in a separate array. Make sure to loop through all the elements in the array. Example: newArray1 = {0, 20, 40, 60, ..};
- abcabc August 29, 2014 in United States
newArray2 = {1, 21,41, 61, ..};| Report Duplicate | Flag | PURGE
Software Engineer Intern Data Structures - -1of 3 votes
AnswersThere are three files
- rajat sadh July 21, 2014 in United States
original.txt,encryption.txt and decryption.txt
original file contains "ABCEZYAR"
it should be encrypt like "12352625118"
and when we decrypt code then original massage should be return "ABCEZYAR".| Report Duplicate | Flag | PURGE
Amazon Software Engineer Intern Algorithm - 0of 0 votes
AnswersWrite a function to convert a string (char* that contains a number, e.g. "586") to int.
- Jason June 19, 2014 in United States| Report Duplicate | Flag | PURGE
Amazon Software Engineer Intern Algorithm - 0of 0 votes
Answers2*45min interviews back-to-back. First interviewer asked two questions.
- Jason June 19, 2014 in United States
Given n*m fields of O's and X's, where O=white, X=black, for example
OOOXOOO
OOXXOXO
OXOOOXO
Return the number of black shapes. A black shape consists of one or more adjacent X's (diagonals not included). In the example, the answer is 3.
Write code (I chose C++). What data structures would you use to store the input, and what to use for the shapes? What is the runtime complexity?| Report Duplicate | Flag | PURGE
Amazon Software Engineer Intern Algorithm - 1of 1 vote
AnswersGiven an unsorted list with each node having a random pointer to another node, sort the list such that each node points to the next node in the list (n1->n2->n3).
- unordered_map June 17, 2014 in United States| Report Duplicate | Flag | PURGE
Microsoft Software Engineer Intern Algorithm - 4of 4 votes
AnswersYou are given a string S and a set of n substrings. You are supposed to remove every instance of those n substrings from S so that S is of the minimum length and output this minimum length.
- pnkapadia6 June 08, 2014 in India
Eg:
S- ccdaabcdbb
n=2 - substrings-- ab, cd
Output: 2
Explanation:
ccdaabcdbb -> ccdacdbb -> cabb -> cb (length=2)
Can someone help me with the algo?| Report Duplicate | Flag | PURGE
Hackerrank Software Engineer Intern String Manipulation - 0of 0 votes
AnswersLeetcode: Jump Game.
- wwu April 21, 2014 in United States
Given an array of non-negative integers, you are initially positioned at the first index of the array.
Each element in the array represents your maximum jump length at that position.
Determine if you are able to reach the last index.| Report Duplicate | Flag | PURGE
Ebay Software Engineer Intern Algorithm - 0of 0 votes
AnswersGiven a string, reverse the word, but keep the comma, number and space.
- wwu April 21, 2014 in United States| Report Duplicate | Flag | PURGE
Ebay Software Engineer Intern Algorithm - 0of 0 votes
AnswerGiven a matrix, there are two 1s and many 0s. Find a path from the first 1 to the second 1.
- wwu April 21, 2014 in United States| Report Duplicate | Flag | PURGE
Ebay Software Engineer Intern Algorithm - 0of 0 votes
AnswersFind Top k most frequent elements
- wwu April 21, 2014 in United States| Report Duplicate | Flag | PURGE
Ebay Software Engineer Intern Algorithm - 0of 0 votes
AnswersFind Top k biggest numbers
- wwu April 21, 2014 in United States| Report Duplicate | Flag | PURGE
Ebay Software Engineer Intern Algorithm - -10of 10 votes
AnswersGiven n array return true if there exist a element from each array whose sum is zero
- karans199228 March 19, 2014 in United States| Report Duplicate | Flag | PURGE
Amazon Software Engineer Intern Algorithm - 0of 0 votes
AnswersCompare time complexity of insert and search functions in HashMap, Array, Linked List and Queue
- naveenm.025 March 17, 2014 in United States| Report Duplicate | Flag | PURGE
Amazon Software Engineer Intern Data Structures