Software Engineer / Developer Interview Questions
- -1of 5 votes
AnswersWhat happens during and after a query is being typed (autocomplete) in a search box whether the user is trying to go to a website or asking a question etc, and how do servers complete the request and what is the best (parallel) structure for the request to go through. DFS and how servers are located for proximity
- Guy January 30, 2014 in United States| Report Duplicate | Flag | PURGE
Google Software Engineer / Developer System Design - -1of 5 votes
AnswersWrite code to return a random line from a file of unknown size and variable length rows
- Guy January 30, 2014 in United States| Report Duplicate | Flag | PURGE
Google Software Engineer / Developer Algorithm - -2of 8 votes
AnswersHow to remove duplicate lines in a large text file? I think it's easy to find duplicate lines, but how do we efficiently remove them from the file?
- Guy January 30, 2014 in United States| Report Duplicate | Flag | PURGE
Google Software Engineer / Developer Large Scale Computing - 0of 2 votes
AnswersSearch in a rotated array for a given integer, it can be rotated clockwise or anticlockwise. Handle both
- juny January 30, 2014 in United States for AFT| Report Duplicate | Flag | PURGE
Amazon Software Engineer / Developer Algorithm - 0of 0 votes
AnswersDesign the system for Amazon website where if you purchase an item X , it shows "Customers who bought X also bought A,B,C items".
- juny January 30, 2014 in United States for AFT
Assume: if a customer buys A,B,C items in his history then they are all related and each one should appear in others| Report Duplicate | Flag | PURGE
Amazon Software Engineer / Developer Large Scale Computing - 0of 0 votes
AnswersDesign Coffee Shop? Follow up: Extend this to handle multiple coffee shops (Ex like starbucks and across countries)
- juny January 30, 2014 in United States for AFT| Report Duplicate | Flag | PURGE
Amazon Software Engineer / Developer Object Oriented Design - -3of 5 votes
AnswersHow would you design a chess game in OOP?
- Guy January 30, 2014 in United States| Report Duplicate | Flag | PURGE
Google Software Engineer / Developer Object Oriented Design - -3of 5 votes
AnswersGiven inputs from Google Search, you have K chunks. Each chunk is individually alphabetically ordered (apple, banana, cat) ... (*apple, *banan, *cat). You want to merge all chunks into a single list. How would you do it?
- Guy January 30, 2014 in United States| Report Duplicate | Flag | PURGE
Google Software Engineer / Developer Algorithm - 0of 0 votes
AnswersHow do you implement stack in stl? What is the complexity?
- sasivara January 30, 2014 in United States| Report Duplicate | Flag | PURGE
Bloomberg LP Software Engineer / Developer C++ - 1of 1 vote
AnswersI have 5 arrays with integer elements. I want to find the common elements in all 5 arrays. What is the logic?c
- sasivara January 30, 2014 in United States| Report Duplicate | Flag | PURGE
Bloomberg LP Software Engineer / Developer Algorithm - 0of 0 votes
AnswersWhat is smart pointer? How do you implement? What happens with the following: p2 = p1;
- sasivara January 30, 2014 in United States
What happens P3(p1) (copy const)?| Report Duplicate | Flag | PURGE
Bloomberg LP Software Engineer / Developer C++ - -3of 7 votes
AnswersCount the number of positive integers less than N that does not contains digit 4.
- Guy January 30, 2014 in United States| Report Duplicate | Flag | PURGE
Google Software Engineer / Developer Algorithm - -11of 13 votes
AnswersIf you had a savings account with $1, at a 100% interest rate, at what year would you have 15 billion dollars? I know it's Log base 2 of 15 billion. But how did it get to log base 2? What's the formula here?
- Guy January 29, 2014 in United States| Report Duplicate | Flag | PURGE
Google Software Engineer / Developer Math & Computation - -3of 5 votes
AnswersThe setup is that we are given a series of text files which contain information regarding a code repository's commits. Each file represents a single commit and they are formatted as follows:
- Guy January 29, 2014 in United States
"
Commit #: XXX
Author: XXX
Reviewer(s): XXX, XXX, ...
File: XXX
File: XXX
...
Date: XX:XX:XX XX/XX/XXXX
"
The commit number is unique and is generated in synchronous order. There is exactly 1 unique author. There are a variable number of reviewers, delimited by commas; if there are no reviewers, that line is absent from the file. There are a variable number of edited files in the commit, each receiving its own line. The time/date is when the commit was submitted.
First design a graphical model for all of the commit data. Then describe how this model is updated when a new commit is generated. Finally, write the code segment called when a new commit is generated which edits a system that has implemented your model of the data - its input is a file name and whatever necessary data structures that are maintained by your system.| Report Duplicate | Flag | PURGE
Google Software Engineer / Developer System Design - -1of 1 vote
AnswersHow to design a file system in OOP. I believe we can use composite pattern to model in which we create an abstract class say Entry, and have directories and files extend from it. In Directories, it has a List<Entry>. How should we write the remove method so that it will recursively remove all of its sub-directories and sub-files then do parent.remove(this)? Also, how should we take read/write permission into account?
- Guy January 29, 2014 in United States| Report Duplicate | Flag | PURGE
Amazon Software Engineer / Developer Object Oriented Design - 1of 1 vote
AnswersFind minimum distance between two words (order preserved) in a big string.
- techpanja January 29, 2014 in United States
For e.g 1. "hello how are you" - distance between "hello" and "you" is 3.
e.g 2. "hello how are hello you" - distance is 1
e.g 3. "you are hello" - distance is -1. Order of "hello" and "you" should be preserved.
e.g 4. "hello how are hello" - distance is -1 since "you" didnt occur even once.| Report Duplicate | Flag | PURGE
Linkedin Software Engineer / Developer - 9of 9 votes
AnswersGiven a timer time() with nanosecond accuracy and given the interface
interface RealTimeCounter: void increment() int getCountInLastSecond() int getCountInLastMinute() int getCountInLastHour() int getCountInLastDay()
implement the interface. The getCountInLastX functions should return the number of times increment was called in the last X.
- peachandpotato January 29, 2014 in United States
(My note: an ideal solution will have space usage which does *not* grow unbounded with the number of calls to increment(). It seems to me that a solution involving a round-robin database could be good, but it sacrifices accuracy.)| Report Duplicate | Flag | PURGE
Google Software Engineer / Developer Algorithm - 0of 2 votes
AnswersWrite a routine that does secret santa in O(N) time. I don't really understand what it means by 'does secret santa' actually.
- Guy January 29, 2014 in United States| Report Duplicate | Flag | PURGE
Google Software Engineer / Developer Algorithm - -1of 3 votes
AnswersHow would you design a social network and find or keep track of someone's oldest friend in a social network? Oldest friend means the friend that you have added for the longest time period. My solution to the first question is to represent friendship in a graph , storing a list of friends in each User object, and use breadth-first-search to find connection. Not sure about the second question though. My idea is either keep a reference to the oldest friend as a member field, or have a double linked list of users sorted by the start date of friendship.
- Guy January 29, 2014 in United States| Report Duplicate | Flag | PURGE
Amazon Software Engineer / Developer System Design - 2of 2 votes
AnswersGenerate MAX_INT (Max signed int value) using bitwise operators. Should work in 32 and 64 bit processors
- bartcois January 28, 2014 in United States| Report Duplicate | Flag | PURGE
Google Software Engineer / Developer Bit Manipulation - 0of 0 votes
AnswersI have declared one double pointer character array as given below:
- ermksharma2009 January 28, 2014 in India
char **errorcode;
so how to initialize this array with NULL.
and pass to other function?????| Report Duplicate | Flag | PURGE
Siemens Software Engineer / Developer C++ - 0of 0 votes
AnswersImagine you're designing a Web Service for a phone application that returns a list of suggested Words that may complete a given string the user types.
- meh January 28, 2014 in United States
For example, if the user writes "ap", a list of suggested words may contain ["apple", "application", "aptitude", ...].
Assume English only words and no misspelling.
I gave a solution with tries and interviewer asked for an alternative solution (I was thinking something along the lines of hashing but time ran out and I couldn't put together anything concrete). I mentioned a couple ways I could optimize my idea, but felt short on that area. For example, ways to return smaller lists, ranking, caching, etc.| Report Duplicate | Flag | PURGE
Amazon Software Engineer / Developer Application / UI Design - 0of 0 votes
AnswersDetermine if a tree is a valid BST with no duplicated values. (This means that if the binary tree has a duplicated number it should return "invalid" even if it's an actual BST)
- meh January 28, 2014 in United States
I gave an O(n) solution and interviewer seemed happy with it.| Report Duplicate | Flag | PURGE
Amazon Software Engineer / Developer Trees and Graphs - 0of 2 votes
AnswersImplement an algorithm to delete a node in the middle of a single linked list, given
- .·´¯`·.´¯`·.¸¸.·´¯`·.¸><(((º> January 28, 2014 in -| Report Duplicate | Flag | PURGE
Oracle Software Engineer / Developer Algorithm - -1of 1 vote
AnswersImplement an algorithm to find the nth to last element of a singly linked list.
- .·´¯`·.´¯`·.¸¸.·´¯`·.¸><(((º> January 28, 2014 in -| Report Duplicate | Flag | PURGE
Oracle Software Engineer / Developer Algorithm - -1of 1 vote
AnswersReverse of a LinkedList
- .·´¯`·.´¯`·.¸¸.·´¯`·.¸><(((º> January 28, 2014 in -
follow up
Can you do it recursively?| Report Duplicate | Flag | PURGE
Oracle Software Engineer / Developer Algorithm - 0of 0 votes
AnswersStruct node{
- renjumc January 28, 2014 in India
node *pNext;
node *pRandom;
};
You have a link list of the above node structure. pRandom has connection to any random nodes.
Write a program to clone this list.
note:You should not add any new items to node| Report Duplicate | Flag | PURGE
NetApp Software Engineer / Developer C C# C++ - -2of 2 votes
AnswersWrite a program to find the GCD of two numbers
- renjumc January 28, 2014 in India| Report Duplicate | Flag | PURGE
NetApp Software Engineer / Developer C C# C++