Coding Interview Questions
- 0of 0 votes
AnswersCoding: Write program to take the union of two rectangles
- Gayle L McDowell April 04, 2005| Report Duplicate | Flag | PURGE
Microsoft Software Engineer / Developer Coding - 0of 0 votes
AnswersCode: You have an array of integers (both positive and negative). Find the continuous sequence with the largest sum. (ie, if the array was {6,-8, 3, -2, 4} then you'd want to return {3,-2, 4})
- Chao Cai April 04, 2005| Report Duplicate | Flag | PURGE
Microsoft Software Engineer / Developer Financial Software Developer Coding Algorithm - 0of 0 votes
AnswersCode: print a linked list in reverse order
- Chao Cai April 04, 2005
- Can you do this in O(n) time, O(1) memory? [O(1) memory = no recursion]| Report Duplicate | Flag | PURGE
Microsoft Software Engineer / Developer Coding - 0of 0 votes
AnswersCode: Find the first occurence of a string in a multi-string. (multi-string means that you could have a string like "cat\0dog\0monkey\0\0". The true end of the series of strings occurs when you hit two null chars in a row)
- Chao Cai April 04, 2005| Report Duplicate | Flag | PURGE
Microsoft Software Engineer / Developer Coding - 0of 0 votes
AnswersCode: Reverse C-Style String. (C-String means that "abcd\n" is actually represented as six characters")
- Chao Cai April 04, 2005| Report Duplicate | Flag | PURGE
Microsoft Software Engineer / Developer Coding - 0of 0 votes
AnswersCoding: binary search tree:
- Steven Saviano April 04, 2005
- find element with given key and return
- node deletion| Report Duplicate | Flag | PURGE
Microsoft Software Engineer / Developer Object Oriented Design Coding - 0of 0 votes
AnswersCoding/Algorithm: You know how web adresses convert spaces and such into special characters
- Steven Saviano April 04, 2005
i.e., space == %20
- given a string, convert the string to a string where all spaces are %20
- what are the different ways to do it
- what if unlimited memeory, what if you cant have any memory and the string has extra space at the end that isnt used (buffer)
- what if you want to say if the string will cutoff and only convert if cut off| Report Duplicate | Flag | PURGE
Microsoft Software Engineer / Developer Coding Algorithm - 0of 0 votes
AnswersCoding: You have a linked list
- Steven Saviano April 04, 2005
struct node
{
int selected;
struct node *next;
struct node *child;
}
intitially all childs are null and it is just a linked list
given a list with some marked and some not, make a linked list such that:
there is a linked list of just the not_selected, then the last element in that list is an element without any data but its child is pointing to a linked list that has all the selected nodes (the last element of which points back to the one with the child node)
- how would you traverse this new structure (even if there was a child that had other childs
- what if that circular connection was cut, then how would you traverse it?
- what if you can add a boolean value to the structure (that you can only set as you traverse). then how would you do it| Report Duplicate | Flag | PURGE
Microsoft Software Engineer / Developer Coding Algorithm - 0of 0 votes
AnswersCoding: 2 arrays, a and b, both are sorted ascendingly
- Steven Saviano April 04, 2005
you know the size of b
you dont know the size of a but you know a can at a minimum hold the size of the current valid values of a (all valid values are at beginning of array) plus the size of b
- How do you combine the two arrays into a while keeping a sorted when returned (no extra array to use)| Report Duplicate | Flag | PURGE
Microsoft Software Engineer / Developer Coding - 0of 0 votes
AnswersCoding: Write code to compute the intersection of 2 rectangles
- Feng Zhao April 04, 2005| Report Duplicate | Flag | PURGE
Microsoft Software Engineer / Developer Coding - 0of 0 votes
AnswersCoding: function generate nth fibonnaci number
- Feng Zhao April 04, 2005
- what's the largest n could be?| Report Duplicate | Flag | PURGE
Microsoft Software Engineer / Developer Coding - 0of 0 votes
AnswersCoding: Reverse linked list
- Feng Zhao April 04, 2005| Report Duplicate | Flag | PURGE
Yahoo Microsoft Software Engineer / Developer Coding - 0of 0 votes
AnswersCoding: You have an n pointed star with points labeled 0, 1, ..., n-1 (assume points are numbered in order). You want to draw this star (imagine a kid's scribble for a 5-pointed star... That kind of star). Assume you have a function drawLine(int indexOne, int indexTwo) which can draw a line from one point of a star to another. Write a program to draw the star.
- Gayle L McDowell April 04, 2005| Report Duplicate | Flag | PURGE
Microsoft Software Engineer / Developer Coding - 0of 0 votes
AnswersCoding/Algorithm: Since XML is very verbose, you are given a way of encoding it where each tag gets mapped to a predefined integer value. The language/grammar looks like:
- Gayle L McDowell April 04, 2005
Element --> Element Attr* END Element END [aka, encode the element tag, then its attributes, then tack on an END character, then encode its children, then another end tag]
Attr --> Tag Value [assume all values are strings]
END --> 01
Tag --> some predefined mapping to int
Value --> string value END
- Coding: Write code to encode xml element (as char *) as Byte *
- Algorithm: Is there anything else you could do to (in many cases) compress this even furthur?| Report Duplicate | Flag | PURGE
Microsoft Software Engineer / Developer Coding Algorithm - 0of 0 votes
AnswersCoding: Game of master mind: you have four balls, and four different colors, as a solution. The user tries to guess the solution. If they guess the right color for the right spot, it counts as a 'hit'. If it's the right color, but the wrong spot, it counts as a psuedo-hit. For example: if the solution is 'RGGB' and the user guesses 'YRGB' they have 2 hits and one pseudo hit. Write a program to, given a solution and a guess, calculate the number of hits and pseudo hits.
- Gayle L McDowell April 04, 2005| Report Duplicate | Flag | PURGE
Microsoft Software Engineer / Developer Coding - 0of 0 votes
AnswersCoding/Test: I want to be able to maintain a list of my family's birthdates and print them in oldest-to-youngest order. Implement the classes and methods that I need for this
- Gayle L McDowell April 04, 2005
Test: how would you test this (if you were doing black box testing)?| Report Duplicate | Flag | PURGE
Microsoft Software Engineer / Developer Testing Object Oriented Design Coding - 0of 0 votes
AnswerCoding: SQL query to select number of elements in a table
- Gayle L McDowell April 04, 2005| Report Duplicate | Flag | PURGE
Goldman Sachs Software Engineer / Developer Coding - 0of 0 votes
AnswersAlgorithm: print a singly linked list in reverse order
- Gayle L McDowell April 04, 2005| Report Duplicate | Flag | PURGE
Goldman Sachs Software Engineer / Developer Coding Algorithm - 0of 0 votes
AnswersAlgorithm: Explain algorithm to shuffle cards
- Gayle L McDowell April 04, 2005| Report Duplicate | Flag | PURGE
Amazon Microsoft Software Engineer / Developer Coding Algorithm - 0of 0 votes
AnswersCoding: Implement a binary search in a sorted array
- Gayle L McDowell April 04, 2005| Report Duplicate | Flag | PURGE
Amazon Software Engineer / Developer Coding