Software Engineer Interview Questions
- 1of 1 vote
AnswersGiven an array consisting of N Numbers.
- smarthbehl August 25, 2015 in United States
Divide it into two Equal(it is important) partitions (in size both contains N/2 elements) such that difference between sum of both partitions is minimum.
If number of elements are odd difference in partition size can be at most 1.| Report Duplicate | Flag | PURGE
Google Software Engineer - 1of 1 vote
AnswersWrite all solutions for a^3+b^3 = c^3 + d^3, where a, b, c, d lie between [0, 10^5] in at least O(n^2) complexity
- dev123 August 24, 2015 in United States| Report Duplicate | Flag | PURGE
Google Software Engineer Algorithm - -2of 2 votes
AnswersA lovely place where ohm law is checked every day + you can feel the grapes (without the first letter).
- Pointer August 23, 2015 in United States for CMS
Clue:
** You can also find there gold… (The golden state)| Report Duplicate | Flag | PURGE
Micron Software Engineer Puzzle - 0of 0 votes
AnswersCan you think of a problem with the following singleton? If so, can you make it better and in the most efficient way?
- Pointer August 23, 2015 in United States for CMS
public class MySingelton {
private static volatile MySingelton mySingelton;
public static MySingelton getInstance() {
if (mySingelton == null) {
mySingelton = new MySingelton();
}
return mySingelton;
}
public static void main(String[] args) {
MySingelton s = MySingelton.getInstance();
...
}| Report Duplicate | Flag | PURGE
Micron Software Engineer Puzzle - 0of 0 votes
AnswersThe question inside the link.
- Pointer August 23, 2015 in United States for CMS
The pictures below contain a message in a secret code.
You will need to program to decode this message and to discover the password.
http://tsofen2015ms.azurewebsites.net/| Report Duplicate | Flag | PURGE
Micron Software Engineer Puzzle - 0of 0 votes
AnswersCompany will start a new marketing campaign targeting the users according
- JavaBuddy August 22, 2015 in United States
to their purchasing profiles.
This campaign has 3 kinds of messages each one targeting one group of customers:
Message 1 - targets the 25% of customers that spend most at the site
Message 2 - targets the 25% of customers that spend least at the site
Message 3 - targets the rest of the customers.
Given the list of purchases made during the week, write a program that lists
what kind of message each customer will receive.
Each purchase in this list features the customer id, the purchase amount among other information.| Report Duplicate | Flag | PURGE
Amazon Software Engineer Algorithm Java - 0of 0 votes
AnswerWrite a program to get out of the Maze. Maze can be represented in the form of Matrix where x can be represented as wall. and _ can be represented as a path.
- hm August 21, 2015 in United States| Report Duplicate | Flag | PURGE
EMC Software Engineer Algorithm - 1of 1 vote
AnswersDesign a data structure which should have following operation. Insert, Delete, Random access
- hm August 21, 2015 in United States| Report Duplicate | Flag | PURGE
Google Software Engineer Data Structures - 1of 1 vote
AnswersGiven 2 large number A and B, create a new number C using the digits from A which needs to be grater than B.
- hm August 21, 2015 in United States
e.g. A = 5281, B = 7443
C = 8125.| Report Duplicate | Flag | PURGE
Google Software Engineer Math & Computation - 0of 0 votes
AnswersDesign Twitter.
- AlgoBaba August 13, 2015 in United States| Report Duplicate | Flag | PURGE
Twitter Software Engineer design - 2of 2 votes
Answers
- chaos August 13, 2015 in United States for WindowsJohn observers the following while driving to work. • 4 were driving a red car. • 3 were driving a blue car. • 3 were driving a black car. He also notices that • 3 of them were listining to Hip Hop • 4 of them were listining to pop music. • 3 of them were listining to Rock. Additionally he notices that, • 3 of them reached office before time on Friday. • 3 of them reached office before time on Tuesday. • 2 of them reached office before time on Wednesday. • 2 of them reached office before time on Thursday. Which of the following practice maximises his chance of getting to office before time. a) He should drive a red car to work listining to pop music on a friday? b) He should drive a blue car to work listining to rock music on a Tuesday. State how did you calculate the probabiltiy for both in your answer.
| Report Duplicate | Flag | PURGE
Microsoft Software Engineer Brain Teasers - 0of 0 votes
AnswersWrite a function called deepCopy that takes an object and creates a deep copy of it.
- shabgard August 13, 2015 in United States
var newObj = deepCopy(obj);
(can't use JSON, can't use prototype)| Report Duplicate | Flag | PURGE
Google Software Engineer JavaScript - 0of 0 votes
AnswerA pole of infinite length is planted vertically on the ground. A stone is placed at a distance of 'd1' meters from the pole towards the right. A bird is sitting on the ground exactly in the middle of the pole and stone. The bird flies away towards the right in such a manner that its distance from the pole and the distance between the bird and the stone at any point of time is always equal. Calculate the distance between the bird and it's starting point after n seconds if the bird is covering 'd2'metres horizontally every second.
- miracles.asa August 08, 2015 in India
Input Format:
First line contains the distance between pole and stone, denoted by d1
Second line contains the flying velocity of bird per second, denoted by d2 meters/ sec
Third line contains time since the bird started flying, denoted n
Output Format:
Print the distance between the bird's position after n seconds and its initial position in meters
OR
Print "Invalid Input" if any constraints are violated
Constraints:
d1 >0
d2 > 0
n > 0
Calculation and printing of output should be upto 11 precision| Report Duplicate | Flag | PURGE
TATA Consultancy Services Software Engineer test - 1of 3 votes
AnswersWrite a function to check if a string matches a regex patter. Note that you only have to deal with patterns containing "*". Also, note that the pattern can't start with "*".
- diwash.timilsina August 04, 2015 in United States
Some examples:
isMatch(“aa”,”a”) → false
isMatch(“aa”,”aa”) → true
isMatch(“aaa”,”aa”) → false
isMatch(“aa”, “a*”) → true
isMatch(“aa”, “*”) → true
isMatch(“ab”, “*”) → true
isMatch(“ab”, “*”) → true
isMatch(“b*a”, “a”) → true
isMatch(“a*a”, “a”) → true
isMatch(“aab”, “c*a*b”) → true| Report Duplicate | Flag | PURGE
Facebook Software Engineer - 3of 3 votes
AnswersGiven an array of integer, find the maximum drop between two array elements, given that second element comes after the first one.
- diwash.timilsina August 04, 2015 in United States| Report Duplicate | Flag | PURGE
Facebook Software Engineer - 0of 0 votes
AnswersYou should transform an structure of multiple tree from machine A to machine B. It is a serialization and deserialization problem, but i failed to solve it well.
You could assume the struct is like this:struct Node{ string val; vector<Node*> sons; }
and in machine A, you will given the point to root Node, and in machine B,you should return a pointer to root Node.
- lxfuhuo July 30, 2015 in China| Report Duplicate | Flag | PURGE
Google Software Engineer Algorithm - 3of 5 votes
AnswersGenerate all possible sorted arrays from alternate elements of two given sorted arrays.
- vishgupta92 July 28, 2015 in United States
Given two sorted arrays A and B, generate all possible arrays such that once first element is taken from A then from B then from A and so on in increasing order till the arrays exhausted. Then first element is taken from B then From A, and do same as above.| Report Duplicate | Flag | PURGE
Microsoft Software Engineer Algorithm - 0of 0 votes
Answers2. There is a maze of size n*n. Tom is sitting at (0,0). Jerry is sitting in another cell (the position of Jerry is input). Then there are k pieces of cheese placed in k different cells (k <= 10). Some cells are blocked while some are not. Tom can move to 4 cells at any point of time (left, right, up, down one position). Tom has to collect all the pieces of cheese and then reach to Jerry’s cell. You need to print the minimum no. of steps required to do so.
- lucklypriyansh July 24, 2015 in India
I know it is possible throgh dp but please provide me solution with approoch i am unable to solve it please| Report Duplicate | Flag | PURGE
Flipkart Software Engineer Algorithm - -1of 3 votes
AnswersDesign a game like angry birds
- sg July 22, 2015 in United States| Report Duplicate | Flag | PURGE
Microsoft Software Engineer - -1of 1 vote
AnswerCheck if the given cordinates on a map correspond to the correct address (where address or cordinates are provided in a tab separated file)
- sg July 22, 2015 in United States| Report Duplicate | Flag | PURGE
Microsoft Software Engineer - 1of 1 vote
AnswersReverse string except spaces. A string has mix of alphabets and spaces. Your task is to reverse the string, but preserve the positions of spaces. For example, reverse of " a if" is " f ia".
- sg July 22, 2015 in United States| Report Duplicate | Flag | PURGE
Microsoft Software Engineer Algorithm - 1of 1 vote
AnswersFind the in-order successor of a node in BST
- Kiara July 20, 2015 in United States| Report Duplicate | Flag | PURGE
Facebook Software Engineer - 0of 0 votes
AnswersDesign a system to:
- um01 July 17, 2015 in United States
- System will consume data points streamed in from multiple streams.
- There can be multiple stream (~100)
- Each stream can have multiple data point per second making it a big data use case. (scalability required)
- The data points should be stored in database for data analysis and searching.(storage db consideration)
- What indexing technique would you use for supporting searching and analysis.
- All data points have timestamps and interesting fields.
Design a system to digest the incoming data in stream in realtime and also making it available for searching/analysis after storage.| Report Duplicate | Flag | PURGE
Software Engineer System Design - 1of 1 vote
AnswersWrite a function which does zig-zag traverse of binary tree and prints out nodes.
- Eugene July 16, 2015 in United States
Example:
1
2 3
4 5 6 7
Output: 1, 2, 3, 7, 6, 5, 4| Report Duplicate | Flag | PURGE
Amazon Software Engineer - 0of 0 votes
AnswersGiven a string representing relative path write a function which normalizes this path (i.e. replaces "..").
- Eugene July 16, 2015 in United States
Example:
input: \a\b\..\foo.txt
output: \a\foo.txt| Report Duplicate | Flag | PURGE
Google Software Engineer - 0of 0 votes
AnswersSuppose you have a 2 stream of integers. How would you randomly select a sample of size N, with equal probability?
- Yev July 15, 2015 in United States| Report Duplicate | Flag | PURGE
Spins Software Engineer Algorithm - 4of 4 votes
AnswersGiven an unbalanced binary tree, write code to select a node at random (each node has an equal probability of being selected).
- tested.candidate July 14, 2015 in Switzerland| Report Duplicate | Flag | PURGE
Google Software Engineer Algorithm - 1of 1 vote
AnswersFind a duplicates in an array of length n. The values are positive integers in the range between 1 .. n-1
- tested.candidate July 14, 2015 in Switzerland| Report Duplicate | Flag | PURGE
Google Software Engineer Algorithm