Software Engineer Intern Interview Questions
- 1of 1 vote
AnswersInterview Question: essentially given a bunch of sets in an array, print out the cross product of all of those sets
- ul December 22, 2016 in United States| Report Duplicate | Flag | PURGE
Facebook Software Engineer Intern - 1of 1 vote
AnswersYou are given two version numbers of a software, like Version 10.3.4 and Version 10.3.41. Write a program in Java to find out which of the version numbers are the latest. If version 1 is latest output -1, if version number 2 is latest output +1 else output 0 if same version. Both the version numbers are taken as string.
- dke.ade January 15, 2014 in United States| Report Duplicate | Flag | PURGE
Amazon Software Engineer Intern Android - 1of 1 vote
AnswersYou have a matrix that is sorted as such: For each value, every index to its right and below it must be larger than the current space's value. Likewise, all entries to its left and above it must be smaller than the current value. How would you go about searching this matrix for a specific number, given its sorted nature?
- oxymoronic2012 November 02, 2016 in United States for Bing| Report Duplicate | Flag | PURGE
Microsoft Software Engineer Intern Matrix - 1of 1 vote
AnswersMaximize the expression value which consists of numbers and +,- operators. Write a program using Greedy approach in linear complexity and Dynamic approach with O(n3) complexity.
- rahul123jadhaav March 26, 2016 in India| Report Duplicate | Flag | PURGE
Morgan Stanley Software Engineer Intern Coding - 1of 1 vote
AnswersFind the two elements that have the smallest difference in a given array.
- si October 23, 2019 in United States| Report Duplicate | Flag | PURGE
Bloomberg LP Software Engineer Intern Arrays - 1of 1 vote
AnswersYou are a game developer working on a game that randomly generates levels. A level is an undirected graph of rooms, each connected by doors. The player starts in one room, and there is a treasure in another room. Some doors are locked, and each lock is opened by a unique key. A room may contain one of those unique keys, or the treasure, or nothing.
- robert October 24, 2017 in United States
Implement a representation for a level and write code that, given a level and starting room, returns true if the treasure can be reached by the player—likely requiring them to find certain other keys first—or false if there is no solution.| Report Duplicate | Flag | PURGE
Google Software Engineer Intern Algorithm - 0of 4 votes
AnswersYou visit yelp.com (or any other website).
- Aasen October 23, 2013 in United States
What happens? Describe as much of the web stack as you possibly can. (This question is meant to last 45 mins).| Report Duplicate | Flag | PURGE
Yelp Software Engineer Intern - 0of 2 votes
Answerswrite a code to print the second largest element in a list
- Anonymous May 04, 2013 in United States
Shortest possible complexity.| Report Duplicate | Flag | PURGE
Amazon Software Engineer Intern Algorithm Data Structures - 0of 2 votes
AnswersYou have n - 1 numbers from 1 to n. Your task is to find the missing number.
- Alexandru Mihai December 11, 2013 in United States
I.e.
n = 5
v = [4, 2, 5, 1]
The result is 3.| Report Duplicate | Flag | PURGE
Twitter Software Engineer Intern - 0of 2 votes
AnswersGiven an array, print all the pairs that sum to a particular value. You are not given the value, find all possible values and print pairs for them
- amazing February 22, 2014 in United States| Report Duplicate | Flag | PURGE
Yahoo Software Engineer Intern Algorithm - 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 - 0of 2 votes
AnswerAssume (n+1) points on a 2D space. You observe the points from (0,0) with viewing direction and viewing angle.
- Casper November 14, 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 Intern C++ - 0of 2 votes
AnswerGiven a N*M grid I want to find biggest submatrix not necessarily a square one that has all the value in it same.
- justhack4fun688 February 10, 2014 in United States
Like
If N=4 and M=5 and matrix is
1 2 3 4 5
1 2 2 2 3
4 2 2 2 6
3 4 5 6 7
Then here answer will be matrix will be
2 2 2
2 2 2
So I need to find upper leftmost coordinate of this submatrix that is [2,2] and bottommost right coordinate that is [3,4].
I was to write a code for it in c++ in my interview| Report Duplicate | Flag | PURGE
Accenture Software Engineer Intern Algorithm - 0of 0 votes
AnswersWrite a function that would print all positive numbers smaller than n that can be expressed as the sum of two cubes in two different ways. Bonus: calculate the complexity of that function.
- demonix February 17, 2015 in United States
For example, 1729 is one such number because 1729 = 1^3 + 12^3 = 9^3 + 10^3.| Report Duplicate | Flag | PURGE
Google Software Engineer Intern - 0of 0 votes
AnswersWrite a multi threaded C code with one thread printing all even numbers and the other all odd numbers. The output should always be in sequence
- gjp February 24, 2014 in United States
ie. 0,1,2,3,4....etc| Report Duplicate | Flag | PURGE
NVIDIA Software Engineer Intern C Threads - 0of 0 votes
AnswersWrite a function to validate the integrity of a binary search tree.
- floatingsms November 29, 2013 in United States| Report Duplicate | Flag | PURGE
Microsoft Software Engineer Intern Algorithm - 0of 0 votes
AnswersFind the maximum-sum subarray of an array.
- floatingsms November 29, 2013 in United States| Report Duplicate | Flag | PURGE
Microsoft Software Engineer Intern Arrays - 0of 0 votes
Answersgiven an array (list) of integers return true(boolean function) if two of the numbers add to 12.
- nitz April 15, 2015 in United States| Report Duplicate | Flag | PURGE
Facebook Software Engineer Intern Java - 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
AnswersWrite code that would parse an expression that is similar to BASH brace expansion. Best illustrated with an example: the expression "(a,b,cy)n,m" would be parsed into an array of the following strings:
- demonix February 12, 2015
an
bn
cyn
m
You can assume that the input will always be valid.
Hint: the expression can nest. Therefore, "((a,b)o(m,n)p,b)" parses into:
aomp
aonp
bomp
bonp
b| Report Duplicate | Flag | PURGE
Google Software Engineer Intern String Manipulation - 0of 0 votes
AnswersWrite a function in java to reverse linked list recursively but the function should have void return type?
- <--> February 23, 2013 in United States| Report Duplicate | Flag | PURGE
Lab126 Software Engineer Intern Linked Lists - 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 - 0of 0 votes
Answersgiven a string with only paranthesis - find out if it is balanced or not
- pooja January 31, 2016 in United States
eg {}[]()
followup : scale your solution and specify the right data structure to use if you have a lot of such bracket types| Report Duplicate | Flag | PURGE
Amazon Software Engineer Intern - 0of 0 votes
AnswersGiven a char array {1,234,34,54}
- tom March 20, 2013 in United States
Modify the char array so that there is no comma in the most efficient way. We must get a char array {12343454}| Report Duplicate | Flag | PURGE
Bloomberg LP Software Engineer Intern - 0of 0 votes
AnswersThe latest reality show has hit the TV: “Cat vs. Dog”. In this show, a bunch of cats and dogs compete for the very prestigious Best Pet Ever title. In each episode, the cats and dogs get to show themselves off, after which the viewers vote on which pets should stay and which should be forced to leave the show.
- lxfuhuo December 17, 2014 in United States
Each viewer gets to cast a vote on two things: one pet which should be kept on the show, and one pet which should be thrown out. Also, based on the universal fact that everyone is either a cat lover (i.e. a dog hater) or a dog lover (i.e. a cat hater), it has been decided that each vote must name exactly one cat and exactly one dog.
Ingenious as they are, the producers have decided to use an advancement procedure which guarantees that as many viewers as possible will continue watching the show: the pets that get to stay will be chosen so as to maximize the number of viewers who get both their opinions satisfied. Write a program to calculate this maximum number of viewers.
Input
On the first line one positive number: the number of testcases, at most 100. After that per testcase:
One line with three integers c, d, v (1 ≤ c, d ≤ 100 and 0 ≤ v ≤ 500): the number of cats, dogs, and voters.
v lines with two pet identifiers each. The first is the pet that this voter wants to keep, the second is the pet that this voter wants to throw out. A pet identifier starts with one of the characters ‘C’ or ‘D’, indicating whether the pet is a cat or dog, respectively. The remaining part of the identifier is an integer giving the number of the pet (between 1 and c for cats, and between 1 and d for dogs). So for instance, “D42” indicates dog number 42.
Output
Per testcase:
One line with the maximum possible number of satisfied voters for the show.
Sample Input 1
2
1 1 2
C1 D1
D1 C1
1 2 4
C1 D1
C1 D1
C1 D2
D2 C1
Sample Output 1
1
3| Report Duplicate | Flag | PURGE
Google Software Engineer Intern Algorithm - 0of 0 votes
AnswersGiven a string, compute the number of all possible palindromes of all the possible anagrams of that string.
- gtkesh July 06, 2013 in United States| Report Duplicate | Flag | PURGE
Software Engineer Intern Coding - 0of 0 votes
AnswersYou are given a positive integer number and you have to return the greatest smaller tidy number of this input number. If the input number itself is tidy, then, it become the answer
- sonesh April 20, 2017 in India
Example
Input: 1234
output: 1234
input: 100
output: 99
input 143456
output: 139999.
PS.A tidy number is a number whose digits are in non-decreasing order.| Report Duplicate | Flag | PURGE
FreshoKartz Software Engineer Intern Bit Manipulation - 0of 0 votes
AnswersGiven two sorted LinkedLists, merge them into one sorted LinkedList
- owasserman2012@my.fit.edu March 27, 2015 in United States| Report Duplicate | Flag | PURGE
Amazon Software Engineer Intern - 0of 0 votes
AnswersGiven a 1D array with integers,print vertical bars of # such that if a[i] = n, then print # n times from the bottom.
- bestluck March 10, 2015 in United States
For eg, {1,4,3,2}
o/p : #
# #
# # #
# # # #| Report Duplicate | Flag | PURGE
Amazon Software Engineer Intern Java