Software Engineer / Developer Interview Questions
- 0of 6 votes
AnswersGiven a set of intervals (time in seconds) find the set of intervals that overlap. Follow-up: what if we were to find the interval with maximum overlap.
- Guy January 18, 2014 in United States| Report Duplicate | Flag | PURGE
Google Software Engineer / Developer Algorithm - 4of 8 votes
AnswersGiven a set top box:
- Guy January 18, 2014 in United States
a, b, c, d, e,
f, g, h, i, j,
k, l, m, n, o
p, q, r, s, t
u, v, w, x, y
z
Write code to give the character sequence given a word, For example, if the word is "CON", the function will print this:
Right//now we're at B
Right//now we're at C
OK//to select C
Down
DOwn
Right
Right
OK//to select O
Left//now at N
OK//to select N
note: Be careful when you're at Z. if you go to the right, you will get stuck.
Afterwards, the interviewer adds a space to the right of 'Z' to test the code.| Report Duplicate | Flag | PURGE
Google Software Engineer / Developer Algorithm - 0of 2 votes
AnswersHow do you design a Maze and what kind of data structures you use for Maze. In addition, write a method to print the shorted path from start to end point.
- Guy January 18, 2014 in United States| Report Duplicate | Flag | PURGE
Google Software Engineer / Developer Data Structures - 0of 4 votes
AnswersDesign Short URL. (I am not sure what it even means)
- Guy January 18, 2014 in United States| Report Duplicate | Flag | PURGE
Google Software Engineer / Developer System Design - -1of 1 vote
AnswersGiven two Binary trees. these trees "may" have right and left branches swapped. Now compare it.
- Guy January 18, 2014 in United States| Report Duplicate | Flag | PURGE
Google Software Engineer / Developer - -1of 1 vote
AnswersGiven a undirected graph, clone it. Now if the undirected graph has the neighbors with the nodes as same data - how do you make sure you create the exact same branches and also how do you make sure you don't run into loops for the exact node. He gave a empty directed graph and asked me write code after that.
- Guy January 18, 2014 in United States| Report Duplicate | Flag | PURGE
Google Software Engineer / Developer Algorithm - 1of 1 vote
Answersthere are a million nodes, it is a DAG, a startpoint is a node with no edges into it and an endpoint is a node with no edges out of it. Each query asks the question - is there a path between a specified pair of start and endpoint nodes. To perform a thousand such queries on a graph that has million nodes, using DFS/BFS is order (1000 * 1000000). I was asked for a solution with better runtime than that.
- ur2cdanger January 18, 2014 in United States| Report Duplicate | Flag | PURGE
Software Engineer / Developer Algorithm - 2of 2 votes
AnswersSink Zero in Binary Tree. Swap zero value of a node with non-zero value of one of its descendants
- yuanbing January 18, 2014 in United States
so that no node with value zero could be parent of node with non-zero.| Report Duplicate | Flag | PURGE
Facebook Software Engineer / Developer - -5of 7 votes
AnswersThere's a matrix. Each element in the matirx is a bit (0 or 1). Write a method to reverse this matrix. The matrix is stored in a one dimensional char array. The length of each row is given.
- Guy January 17, 2014 in United States
How do you improve your solution when handling large amount of data?| Report Duplicate | Flag | PURGE
Google Software Engineer / Developer Algorithm - -1of 1 vote
AnswersDesign a object oriented class for a vending machine. My idea is that it should have the ability to take in money, item selection, serving item. But I am not sure how to put everything together using good object-oriented principles.
- Guy January 16, 2014 in United States| Report Duplicate | Flag | PURGE
Amazon Software Engineer / Developer Object Oriented Design - -2of 2 votes
AnswersDesign question to find the most frequent sequence of web page views from a log file of all the web pages viewed. Say the sequence is 4.
- Guy January 16, 2014 in United States| Report Duplicate | Flag | PURGE
Amazon Software Engineer / Developer Data Structures - -2of 2 votes
AnswersArranging file system in the form of a binary tree. I think the interviewer meant B-Tree. She had a huge accent.
- Guy January 16, 2014 in United States| Report Duplicate | Flag | PURGE
Amazon Software Engineer / Developer Data Structures - -1of 1 vote
AnswersImplement a method that flattens an iterator of iterators. I believe we will need a class to do it? Java preferred. Thanks.
- Guy January 16, 2014 in United States| Report Duplicate | Flag | PURGE
Amazon Software Engineer / Developer Algorithm - -2of 6 votes
AnswersGiven a list of integers that fall within a known short but unknown range of values, how to find the median value?
- Guy January 16, 2014 in United States
Some say we could use selection algorithm. But that will take O(n/2 * n), which results in O(n^2). I don't know how it is a good solution.| Report Duplicate | Flag | PURGE
Google Software Engineer / Developer Algorithm - 2of 2 votes
AnswersA graph contains one start node with no out-edges and a ending node with no in-edges. Such graph contains, say 10 million nodes. Question is how to find out effectively if two nodes are connected. The graph is a directed, unweighted and acyclic graph.
- ur2cdanger January 15, 2014 in United States
Additional Information : the graph will be queried for such connectivity queries at least a million times.
I was able to come up with building a transitive closure. But the space requirements ( O(10million * 10 million ) is huge.
2) I suggested BFS but it would be O( million * 10 million ), so that also was rejected.
Is there any other effective way ?. Practically I couldn't think of any other way.| Report Duplicate | Flag | PURGE
Software Engineer / Developer Algorithm - -1of 3 votes
AnswersWrite a method which takes an array input and returns true if the sum of any two elements is equal to the sum of the corresponding indices. Like if for an array the sum of values at any two indices i and j is equal to the sum of i and j.
- Guy January 15, 2014 in United States
I can't think of any other way to do it except brute force.| Report Duplicate | Flag | PURGE
Amazon Software Engineer / Developer Algorithm - -1of 1 vote
AnswersImplement classes for a website that can be used for building your own computer in object-oriented design manner. Eg: If a user selects a motherboard, it should filter out all the incompatible CPUs etc. You have to implement various classes that can be used for implementing this functionality. Java preferred.
- Guy January 15, 2014 in United States
Thanks a lot.| Report Duplicate | Flag | PURGE
Amazon Software Engineer / Developer System Design - 1of 1 vote
AnswersHow do you write a custom error handler in Java?
- A.K. January 15, 2014 in United States for Shared file| Report Duplicate | Flag | PURGE
Citrix System Inc Software Engineer / Developer Java - 0of 0 votes
Answerswhat happens when you re-throw an exception in Java?
- A.K. January 15, 2014 in United States for Shared file| Report Duplicate | Flag | PURGE
Citrix System Inc Software Engineer / Developer Java - 0of 0 votes
AnswersHow would you design a database to store directory type data structure (e.g. windows folder containing subfolders)?
- A.K. January 15, 2014 in United States for Shared file| Report Duplicate | Flag | PURGE
Citrix System Inc Software Engineer / Developer Database - 1of 1 vote
AnswersWhat is SOAP? What is REST? What are the major differences between SOAP & REST?
- A.K. January 15, 2014 in United States for Shared file| Report Duplicate | Flag | PURGE
Citrix System Inc Software Engineer / Developer Java - 0of 0 votes
AnswersWhat is a process? what is a service? what are the differences between a process and a service (e.g. in windows)?
- A.K. January 15, 2014 in United States for Shared file| Report Duplicate | Flag | PURGE
Citrix System Inc Software Engineer / Developer System Design - 0of 0 votes
AnswersWhat is a static method? What is the difference between instance method and static method?
- A.K. January 15, 2014 in United States for Shared file| Report Duplicate | Flag | PURGE
Citrix System Inc Software Engineer / Developer Object Oriented Design - 1of 1 vote
AnswersWhat is an interface? How is an interface different than inheritance? Why multiple inheritance not allowed?
- A.K. January 15, 2014 in United States for Shared file| Report Duplicate | Flag | PURGE
Citrix System Inc Software Engineer / Developer Object Oriented Design - 0of 0 votes
AnswersWhat is generics? How do you call a generic method in C++/C#? What are the disadvantages of generics?
- A.K. January 15, 2014 in United States for Shared file| Report Duplicate | Flag | PURGE
Citrix System Inc Software Engineer / Developer C++ - 0of 0 votes
Answersfind a cycle in the given array and return the length of a cycle
- peter January 14, 2014 in United States
for example, a[0] = 2, a[1] = 0, a[2] = 3, a[3] = 1, a[4] = 2, a[5] =4;
a[0]=2 -> a[2]=3 -> a[3]=1 -> a[1] =0 -> a[0]=2 ....
2->3-1>0->2->3->1->0->...
so return value should be 3.| Report Duplicate | Flag | PURGE
Samsung Software Engineer / Developer Algorithm - -2of 2 votes
AnswersGiven a line length insert white space so text is uniformly displayed within the given length
- Madan January 13, 2014 in United States| Report Duplicate | Flag | PURGE
Google Software Engineer / Developer - 1of 3 votes
AnswersWhat is mean by non blocking thread safe? Is it different from thread safe blokcing? Code a non blocking thread safe queue in Java
- Madan January 13, 2014 in United States| Report Duplicate | Flag | PURGE
Google Software Engineer / Developer - 2of 2 votes
AnswersMapping
- Thiago January 13, 2014 in United States
'1' = 'A','B','C'
'2' = 'D','E','F'
...
'9' =
input: 112
output :ouput = [AAD, BBD, CCD, AAE, AAF, BBE, BBF, CCE, CCF]| Report Duplicate | Flag | PURGE
Facebook Software Engineer / Developer Algorithm