Software Engineer / Developer Interview Questions
- 0of 0 votes
Answers
- shoudaw April 02, 2014 in United States/* * Returns true if the input string is a number and false otherwise */ public boolean isNumber(String toTest) { // implementation here }
| Report Duplicate | Flag | PURGE
Linkedin Software Engineer / Developer Algorithm - 0of 0 votes
Answers
- shoudaw April 02, 2014 in United States/** * Implement a method which takes an integer array and returns an integer array (of equal size) in * which each element is the product of every number in the input array with the exception of the * number at that index. * * Example: * [3, 1, 4, 2] => [8, 24, 6, 12] */ public int[] selfExcludingProduct(int[] input) { // implementation... }
| Report Duplicate | Flag | PURGE
Linkedin Software Engineer / Developer Algorithm - 0of 0 votes
AnswersWrite a function to convert an Integer representing a number of bytes (less than or equal to 1 Gigabyte) into an easy to read format, defined as follows: • Maximum of 3 digits (not counting a decimal point), and a single letter to signify the unit of measure. • No leading zeroes, or trailing zeroes after a decimal point. • Be as accurate as possible.
- MM April 01, 2014 in United States
Maximum of 3 digits (not counting a decimal point), and a single letter to signify the unit of measure. • Round to the nearest valid values. Examples: o 341 = 341B o 34200 = 34.2K o 5910000 = 5.91M o 1000000000 = 1G • No leading zeroes, or trailing zeroes after a decimal point. Examples: o 34K, not 034K o 7.2M, not 7.20M • Be as accurate as possible. Example: o 54123B = 54.1K, not 54K • Note: For this problem, 1000 bytes = 1 KB, and so on| Report Duplicate | Flag | PURGE
Amazon Software Engineer / Developer - 0of 0 votes
AnswersPrint the diameter of binary tree i.e. set of nodes comprising diameter of binary tree.
- nishu April 01, 2014 in India| Report Duplicate | Flag | PURGE
Amazon Software Engineer / Developer Algorithm - 1of 7 votes
AnswersGiven an excel column number convert it to excel column alphabet and reverse.
- codechamp March 30, 2014 in India for AWS
Example : If column number(starts from 0) = 26 : Column alpha = AA.| Report Duplicate | Flag | PURGE
Amazon Software Engineer / Developer Algorithm Brain Teasers Data Structures - 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 - 4of 8 votes
AnswersGiven a matrix with only 1s and 0s now find and PRINT SUB MATRIX WITH EQUAL NUMBER OF 0s AND 1s.
- codechamp March 29, 2014 in United States for Search| Report Duplicate | Flag | PURGE
A9 Software Engineer / Developer - 2of 2 votes
AnswersGiven a list of stock quotes over a month of time,
- codechamp March 29, 2014 in United States for Search
Return the buy day and sell day which gives the max
profit.| Report Duplicate | Flag | PURGE
A9 Software Engineer / Developer - 1of 1 vote
Answersyou have an array which has a set of positive and negative numbers, print all the subset sum which is equal to 0.
- AlgoBaba March 29, 2014 in United States
eg 2, 1, -1, 0, 2, -1, -1
o/p: 1, -1
1, -1, 0
0
2, -1, -1| Report Duplicate | Flag | PURGE
Amazon Software Engineer / Developer - 0of 0 votes
AnswerFurther on, the design tables and more SQL queries given some business requirements. And how would I do the same using MapReduce.
- unreal March 28, 2014 in United States| Report Duplicate | Flag | PURGE
FactSet Research Systems, Inc Software Engineer / Developer SQL - 0of 0 votes
AnswersThe question was I have a table containing millions of records and I have to calculate sum, avg, mean, median and SD without using inbuilt methods of SQL ( I can use count though).
- unreal March 28, 2014 in United States
And that has to done by writing only SQL queries.`| Report Duplicate | Flag | PURGE
FactSet Research Systems, Inc Software Engineer / Developer SQL - -1of 1 vote
AnswersSUM OF PREVIOUS SMALLER NUMBERS IN ARRAY efficiently. For every given element in the array you should return the sum of previous smaller values you encountered in the array . example : arr = {2, 5,1,9, 3}
- codechamp March 27, 2014 in United States
for a[0] i.e. 2 , sum = 0, a[1] i.e. 5, sum = 2, similarly for a[4], i.e. 3 , sum = 2+1 = 3.| Report Duplicate | Flag | PURGE
Zynga Software Engineer / Developer Coding - 1of 3 votes
AnswersGiven an array, you should start at index 0, and you can jump
- codechamp March 27, 2014 in United States
from the current index to a max of " current index + arr[current index]
and make it out of the array at the other end in minimum number of hops.| Report Duplicate | Flag | PURGE
Zynga Software Engineer / Developer Algorithm - 4of 4 votes
AnswersWrite code to generate all possible case combinations of a given lower-cased string. (e.g.
- An Enthusiast March 25, 2014 in United States"0ab" -> ["0ab", "0aB", "0Ab", "0AB"])
| Report Duplicate | Flag | PURGE
Yelp Software Engineer / Developer Algorithm - 21of 23 votes
AnswersGiven a undirected graph with corresponding edges. Find the number of possible triangles?
- redsanket March 25, 2014 in United States
Example:
0 1
2 1
0 2
4 1
Answer:
1| Report Duplicate | Flag | PURGE
Google Software Engineer / Developer Algorithm - 17of 21 votes
AnswersYou have the file with word at a single line.
- madeinindia March 24, 2014 in neitherland for perl backend
#input sample file
abactor
abaculus
abacus
Abadite
.
.
Zyrenian
#Output
******************************************************************a
*************b
**********************************c
**********************d
*******************************************************************************e
a) you have to count the character and create a histogram in alphabetical order.
b) now you have to produce a histogram with max 80 character in line in reference to max count
c) now same out based histrogram based on the character count| Report Duplicate | Flag | PURGE
Booking.com Software Engineer / Developer Perl - 4of 4 votes
AnswersGiven a current absolute path, e.g., "/usr/bin/mail", and a relative one, e.g, "../../../etc/xyz/../abc" return the absolute path created from the combination of the first two paths. In the example strings, the answer should be "/etc/abc".
- meh March 24, 2014 in United States| Report Duplicate | Flag | PURGE
Facebook Software Engineer / Developer Algorithm - 19of 19 votes
AnswersGiven two strings a and b, find whether any anagram of string a is a sub-string of string b. For eg:
- Masterchief117 March 23, 2014 in United States
if a = xyz and b = afdgzyxksldfm then the program should return true.| Report Duplicate | Flag | PURGE
Google Software Engineer / Developer String Manipulation - -1of 1 vote
AnswersImplement a sorting algorithm for a single linked list.
- meh March 23, 2014 in United States| Report Duplicate | Flag | PURGE
Software Engineer / Developer Sorting - 2of 2 votes
AnswersGiven a mapping configuration such as:
- meh March 23, 2014 in United States
1:a
2:b
...
26:z
And a string like "12632", print the number of different ways you can map such string to alphabet characters.
For example, given "111" the answer is 3 because you can make "aaa", "ak" and "ka" different mappings. However, given "101" the answer is 1 because you can only make "ja" as a possible mapping (01 is not valid).| Report Duplicate | Flag | PURGE
Software Engineer / Developer Dynamic Programming - 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 - -6of 8 votes
Answersgiven a board with black (1) and white (0), black are all connected. find the min rectangle that contains all black.
- Obiwana March 21, 2014 in United States
example:
0 0 0 0 0
0 1 1 1 0
0 1 1 0 0
0 1 0 0 0
0 0 0 0 0
the min rectangle contains all black (1) is the rectangle from (1,1) - (3, 3)| Report Duplicate | Flag | PURGE
Google Software Engineer / Developer - -3of 11 votes
AnswersGiven an array of Integers, and a range (low, high), find all continuous subsequences in the array which have sum in the range. Is there a solution better than O(n^2)?
- Obiwana March 21, 2014 in United States| Report Duplicate | Flag | PURGE
Google Software Engineer / Developer - 0of 2 votes
AnswersWrite a class that displays average of stock prices for a given stock symbol for the last 10 minutes. We have a service that sends stock updates about 5000 times per second. The structure of the message is :
- budsiya March 21, 2014 in United StatesMessage { long timestamp; String symbol; // E.g. AAPL double price; }
| Report Duplicate | Flag | PURGE
Yahoo Software Engineer / Developer Large Scale Computing System Design - -7of 7 votes
AnswersGiven k integers i_0, i_1, i_2, i_3,...i_k, find all possible expressions which uses + - * / and () to generate a result equals to target X.
- Obiwana March 21, 2014 in United States
() has the highest priority.| Report Duplicate | Flag | PURGE
Google Software Engineer / Developer - 2of 2 votes
AnswersYou are trying to control an on-screen keyboard (e.g. on a television) that looks like this:
- msamarch1980 March 20, 2014 in United States
a b c d e
f g h i j
...
You can issue the following commands to move the cursor and select letters:
‘u’ - up
‘d’ - down
‘l’ - left
‘r’ - right
‘!’ - select letter
You are given an input string and the length of the rows in the on-screen keyboard. You must produce the sequence of commands needed to type out the input string on the specified keyboard, e.g.:
“aci”, 5 -> “!rr!dr!”| Report Duplicate | Flag | PURGE
Software Engineer / Developer Coding - -2of 6 votes
AnswersGiven a dictionary of words, and a set of characters, judge if all the characters can form the words from the dictionary, without any characters left.
- DoZerg March 20, 2014 in United States
For example, given the dictionary {hello, world, is, my, first, program},
if the characters set is "iiifrssst", you should return 'true' because you can form {is, is, first} from the set;
if the character set is "eiifrsst", you should return 'false' because you cannot use all the characters from the set.
P.S. there may be tens of thousands of words in the dictionary, and the chars set length could be up to hundreds, so I really need some efficient algorithm.| Report Duplicate | Flag | PURGE
Google Software Engineer / Developer Algorithm - -2of 2 votes
AnswersRearrange an array so that arr[i] becomes arr[arr[i]] with O(1) extra space
- RG March 20, 2014 in United States| Report Duplicate | Flag | PURGE
Software Engineer / Developer Algorithm - 1of 1 vote
AnswersQueue implementation in Java.
- duskan March 20, 2014 in United States for Ad| Report Duplicate | Flag | PURGE
Yahoo Software Engineer / Developer Algorithm