Software Engineer / Developer Interview Questions
- 0of 0 votes
AnswersSuppose you are a software vendor and you need to provide your API to a customer, but you don't want to give your source code. How would you do it?
- neerajlakhotia08 August 20, 2014 in India| Report Duplicate | Flag | PURGE
Adobe Software Engineer / Developer Application / UI Design - 1of 1 vote
AnswersThere is a file contains the digital number characters:
_ _ _ |_| |_ | | |_| |_| |_|
Each digital number contains 3x3 characters, read this file and output the int type number: 8 6 0
- jstw August 18, 2014 in United States| Report Duplicate | Flag | PURGE
D2L Software Engineer / Developer Algorithm - 1of 1 vote
AnswersHere is the structure of a tree:
Node {
int value;
Node *parent;
}
All nodes are stored in a list right now
List {
Node n;
List *next;
}
print out each layer from left to right in a vertical position:
- jstw August 18, 2014 in United Statesroot layer1Child1 layer2Child1 layer4Child1 layer1Child2 layer2Child2 layer2Child3
| Report Duplicate | Flag | PURGE
Amazon Software Engineer / Developer Algorithm - 0of 0 votes
AnswersDesign a system that processes an infinite stream of data:
- takpez August 18, 2014 in United States for AWS
- each record comes as a tuple(url, html content)
- extract and store the occurences of:
urls, hosts, top-level-domains, in/out links of the page
We have one machine that has enough disk space but limited memory.
What data structures as building blocks would you use?| Report Duplicate | Flag | PURGE
Amazon Software Engineer / Developer System Design - 2of 2 votes
AnswersYou are given a text file that has list of dependencies between (any) two projects in the soure code repository. Write an algorithm to determine the build order ie. which project needs to be build first, followed by which project..based on the dependencies.
- enok August 18, 2014 in United States
Bonus point: If you can detect any circular dependencies and throw an exception if found.
EX: ProjectDependencies.txt
a -> b (means 'a' depends on 'b'..so 'b' needs to be built first and then 'a')
b -> c
b -> d
c -> d
Then the build order can be
d , c, b, a in that order| Report Duplicate | Flag | PURGE
Google Software Engineer / Developer Algorithm - 1of 5 votes
AnswersGiven an array of positive integers that represents possible points a team could score in an individual play. Now there are two teams play against each other. Their final scores are S and S'. How would you compute the maximum number of times the team that leads could have changed?
- maomaofixer August 17, 2014 in United States
For example, if S=10 and S'=6. The lead could have changed 4 times:
Team 1 scores 2, then Team 2 scores 3 (lead change);
Team 1 scores 2 (lead change), Team 2 score 0 (no lead change);
Team 1 scores 0, Team 2 scores 3 (lead change);
Team 1 scores 3, Team 2 scores 0 (lead change);
Team 1 scores 3, Team 2 scores 0 (no lead change).| Report Duplicate | Flag | PURGE
Facebook Software Engineer / Developer Algorithm - 0of 0 votes
Answers[Phone screen]
- utopia August 12, 2014 in United States
Let's say I gave you a long String and I wanted you to tell me the most common word in that String. How would you do that?
follow-up: OK, how would you estimate the size and time complexity of this solution? How would you estimate the ACTUAL size usage? (Hint: how many words are in the English language? Would having a dictionary in front of you help?)
follow-up #2: OK, how about if I gave you the entire works of Alexandre Dumas, one of the most prolific authors in history. How would your solution work? How could you change it to solve this more specific problem?
follow-up #3: Now, what if we wanted to find the most common PHRASE in his writings. (Upon clarification, the interviewer wouldn't give a specific length, so I clarified to finding as long as a common 10 word phrase, because anything longer is unlikely.)| Report Duplicate | Flag | PURGE
Goldman Sachs Software Engineer / Developer Algorithm Hash Table - 0of 0 votes
Answers[Phone screen]
- utopia August 12, 2014 in United States
Tell me about the Java Collections framework, what are its main interfaces. OK, what are the main differences between the Set and List interfaces? What do you give up if you go from a List to a Set, and what do you get in exchange for this if you go from a List to a Set? How would you go about guessing the order of an iteration() of HashSet if I told you I was going to insert the strings "first", "second", "third", "forth", and "fifth"?| Report Duplicate | Flag | PURGE
Goldman Sachs Software Engineer / Developer Java - 2of 2 votes
AnswerLet's say I gave you a long String and I wanted you to tell me the most common word in that String. How would you do that?
- utopia August 12, 2014 in United States
follow-up: OK, how would you estimate the size and time complexity of this solution? How would you estimate the ACTUAL size usage? (Hint: how many words are in the English language? Would having a dictionary in front of you help?)
follow-up #2: OK, how about if I gave you the entire works of Alexandre Dumas, one of the most prolific authors in history. How would your solution work? How could you change it to solve this more specific problem?
follow-up #3: Now, what if we wanted to find the most common PHRASE in his writings. (Upon clarification, the interviewer wouldn't give a specific length, so I clarified to finding as long as a common 10 word phrase, because anything longer is unlikely.)| Report Duplicate | Flag | PURGE
Goldman Sachs Software Engineer / Developer Algorithm Hash Table - 0of 0 votes
AnswersTell me about the Java Collections framework, what are its main interfaces. OK, what are the main differences between the Set and List interfaces? What do you give up if you go from a List to a Set, and what do you get in exchange for this if you go from a List to a Set? How would you go about guessing the order of an iteration() of HashSet if I told you I was going to insert the strings "first", "second", "third", "forth", and "fifth"?
- utopia August 12, 2014 in United States| Report Duplicate | Flag | PURGE
Goldman Sachs Software Engineer / Developer Java - 0of 0 votes
Answers[Phone screen]
- utopia August 12, 2014 in United States
Tell me what you know about the java.lang.Object class. OK, what are best practices for the equals method? How would you implement an equals method for a class with 100s of data fields?| Report Duplicate | Flag | PURGE
Goldman Sachs Software Engineer / Developer Java - 1of 1 vote
AnswersIf you run the same program twice, what section would be shared in the memory?
- farzanmoofty August 12, 2014 in United States for Price history
Follow up, is the text portion of memory share? Why not?| Report Duplicate | Flag | PURGE
Bloomberg LP Software Engineer / Developer C++ Coding Operating System - 1of 1 vote
AnswersWhat do you do if your program does a core dump?
- farzanmoofty August 12, 2014 in United States for Price history
(Analyze code dump)
Name all the possible ways a program would do core dump.| Report Duplicate | Flag | PURGE
Bloomberg LP Software Engineer / Developer C C++ Compiler - 0of 0 votes
AnswersWrite a function that accepts an n-dimension array and prints its values--For array of any dimension.
- farzanmoofty August 12, 2014 in United States for Price history
What is the layout of multi-dimensional array in the memory?| Report Duplicate | Flag | PURGE
Bloomberg LP Software Engineer / Developer Arrays C++ Coding - 1of 1 vote
AnswersGiven a number n, write a function that writes a Fibonacci sequence to number n.
- farzanmoofty August 12, 2014 in United States for Price history| Report Duplicate | Flag | PURGE
Bloomberg LP Software Engineer / Developer C++ Coding - 0of 0 votes
AnswersIt was part of a bigger question --a large piece of code.
- farzanmoofty August 12, 2014 in United States for Price history
Implement << operator. What are the differences of implementation as a member function and a non-member function| Report Duplicate | Flag | PURGE
Bloomberg LP Software Engineer / Developer C++ Coding Object Oriented Design - 0of 0 votes
AnswersWhat does an iterator in C++ point to in case of a vector vs. list. Where would it point to if the prior links are deleted in the list? In case of a vector if it points to a specific index, where would it point to if the prior indexes are deleted?
- farzanmoofty August 12, 2014 in United States for Price history| Report Duplicate | Flag | PURGE
Bloomberg LP Software Engineer / Developer Arrays C++ Coding Linked Lists - 0of 0 votes
AnswersWhat C++ data structures would you use to implement LRU cache? Show implementation.
- farzanmoofty August 12, 2014 in United States for Price history| Report Duplicate | Flag | PURGE
Bloomberg LP Software Engineer / Developer C++ Coding - 0of 0 votes
AnswersHow would you implement this:
- farzanmoofty August 12, 2014 in United States for Price historyobject["String for a security name"]["another string"] = another_object
| Report Duplicate | Flag | PURGE
Bloomberg LP Software Engineer / Developer C++ Coding - 0of 0 votes
AnswerWhat are the various ways of doing IPC in Unix/Linux? How do you implement it?
- farzanmoofty August 12, 2014 in United States for Price history| Report Duplicate | Flag | PURGE
Bloomberg LP Software Engineer / Developer C++ Coding Operating System unix system programmin - 0of 0 votes
AnswersWrite a Program to find out Whether a given String can be a Palindrome i.e. we need to see for the palindrome after rearranging the words in that string.
- kuldeep2609singh August 12, 2014 in India
example: lets say we have a string "aabbccd" so it can be a palindrome after rearranging the words "abcdcba".
For this I need to find out the optimal solution.| Report Duplicate | Flag | PURGE
CGI-AMS Software Engineer / Developer Java - 0of 0 votes
AnswersGiven a 20 GB file and 2GB RAM, how to parse it and detect where to break it, concepts of memory management.
- Saurabh2816 August 10, 2014 in India| Report Duplicate | Flag | PURGE
Amazon Software Engineer / Developer Operating System - 0of 0 votes
AnswersWrite a shell script to reverse a string without using inbuilt function.
- gaurav.2897 August 07, 2014 in India| Report Duplicate | Flag | PURGE
Software Engineer / Developer Unix - 11of 11 votes
AnswersThere are at most eight servers in a data center. Each server has got a capacity/memory limit. There can be at most 8 tasks that need to be scheduled on those servers. Each task requires certain capacity/memory to run, and each server can handle multiple tasks as long as the capacity limit is not hit. Write a program to see if all of the given tasks can be scheduled or not on the servers?
- CodeKaur August 04, 2014 in United States
Ex:
Servers capacity limits: 8, 16, 8, 32
Tasks capacity needs: 18, 4, 8, 4, 6, 6, 8, 8
For this example, the program should say 'true'.
Ex2:
Server capacity limits: 1, 3
Task capacity needs: 4
For this example, program should return false.
Got some idea that this needs to be solved using dynamic programming concept, but could not figure out exact solution.| Report Duplicate | Flag | PURGE
Google Software Engineer / Developer Algorithm - 1of 1 vote
AnswersYou are given an array, that is sorted, however was rotated to the right by a certain distance. The array may contain duplicated values. Find the index of a given element in the array.
- joe kidd August 03, 2014 in India
Example: {3, 9, 9, 9, 8, 10, 12, 13, 1, 2, 3}, element = 3, returns, any of indexes that 3 is present.| Report Duplicate | Flag | PURGE
Amazon Software Engineer / Developer Algorithm - 0of 0 votes
AnswersGiven an array containing only stars '*' and hashes '#' . Find longest contiguous sub array that will contain equal no. of stars '*' and hashes '#'.
- Peter August 03, 2014 in India
Order (n) solution required| Report Duplicate | Flag | PURGE
Amazon Software Engineer / Developer Algorithm - 3of 3 votes
AnswersFind the longest words in a given list of words that can be constructed from a given list of letters.
- Rohitraman2006 August 01, 2014 in United States
Your solution should take as its first argument the name of a plain text file that contains one word per line.
The remaining arguments define the list of legal letters. A letter may not appear in any single word more times than it appears in the list of letters (e.g., the input letters ‘a a b c k’ can make ‘back’ and ‘cab’ but not ‘abba’).
Here's an example of how it should work:
prompt> word-maker WORD.LST w g d a s x z c y t e i o b
['azotised', 'bawdiest', 'dystocia', 'geotaxis', 'iceboats', 'oxidates', 'oxyacids', 'sweatbox', 'tideways']
Tip: Just return the longest words which match, not all.| Report Duplicate | Flag | PURGE
Google Software Engineer / Developer Coding - 1of 1 vote
AnswersWhat is the following program trying to do?
#define SIZE (1<<31) // 2 Gb int main() { char *p=malloc(SIZE); memset(p, 0, SIZE); }
a. Trying to crash OS by allocating lot of memory
- anil.auece July 31, 2014 in United States
b. Trying to calculate amount of system memory
c. Trying to allocate virtual memory and makesure memory is in physical memory
d. It is a useless program because the system will not satisfy memory request| Report Duplicate | Flag | PURGE
Cavium Networks Software Engineer / Developer Operating System