Coding Interview Questions
- 0of 0 votes
AnswersMultiply two numbers without using multiply(obviously),division,bitwise operators and no loops.
- Anonymous March 09, 2010
For example: 3*2=6 without *,/,bitwise operators and no for,while loops.
Hint: Answer using recursion..| Report Duplicate | Flag | PURGE
Amazon Software Engineer / Developer Coding - 0of 0 votes
AnswersWrite a function to compare two xml files
- Anonymous March 09, 2010
bool CompareXMLFiles(string fileName, string fileName);
Scenario
1. Path to files are given
2. We have to compare the content of xml files.
3. Xml with different element position would be same i.e.
<Tests>
<Test>UI<Test>
<Test>Functional<Test>
</Tests>
is same as
<Tests>
<Test>Functional<Test>
<Test>UI<Test>
</Tests>
4. Different position of attributes can be there e.g.
<Test Id="4" No="50">Functional<Test>
is same as
<Test No="50" Id="4">Functional<Test>
5. One Xml file can contain comments and other can/cannot but this is same| Report Duplicate | Flag | PURGE
Microsoft Software Engineer / Developer Coding - 0of 0 votes
Answerscode to find transpose of a matrix using only one array
- dd March 06, 2010| Report Duplicate | Flag | PURGE
Qualcomm Software Engineer / Developer Coding - 0of 0 votes
Answersgiven a stream of integers.. 112233344442222 write a finction that would return as 1222334424
- Anonymus March 05, 2010| Report Duplicate | Flag | PURGE
Amazon Software Engineer / Developer Coding - 0of 0 votes
AnswersCan you write a program to create a deck of cards, with the two joker cards
- biggied88 March 03, 2010| Report Duplicate | Flag | PURGE
Amazon Software Engineer / Developer Coding - 0of 0 votes
AnswersWrite code to find the nth factorial
- biggied88 March 02, 2010| Report Duplicate | Flag | PURGE
Amazon Software Engineer / Developer Coding - 0of 0 votes
AnswersHi all, I had MS interview today on campus. He asked me to implement a function readone().and also gave me an input file with lot of lines. This function readone() should read the file(just one line from the file) whenever it is called.for example, if readone() is called first time - it ll read first line, if readone() is called second time, it will read second line. Though the qn seems simple, I baffled there!:(
- Anonymous March 02, 2010| Report Duplicate | Flag | PURGE
Microsoft Software Engineer / Developer C C++ Coding - 0of 0 votes
AnswersImplement copy-on-write string class.
- kuo February 27, 2010| Report Duplicate | Flag | PURGE
Facebook Software Engineer / Developer Coding - 0of 0 votes
AnswersHow do you write a TCP server? Give pseudocode.
- - February 22, 2010| Report Duplicate | Flag | PURGE
NetApp Software Engineer / Developer Coding - 0of 0 votes
AnswersHow do you implement memcpy? What can go wrong and how do you fix it?
- - February 22, 2010| Report Duplicate | Flag | PURGE
NetApp Software Engineer / Developer Coding - 0of 0 votes
Answersfind the Nth largest node in a BST
- nixu09 February 12, 2010| Report Duplicate | Flag | PURGE
Google Software Engineer / Developer Coding - 0of 0 votes
Answersimplement a circular queue class, note it will not overflow (my understanding is if the capacity is reached, the enqueue function should return false).
- some one January 27, 2010
How would you test it?| Report Duplicate | Flag | PURGE
Microsoft Software Engineer / Developer Coding - 0of 0 votes
AnswersWrite a function that takes an input string and returns a new string containing the unique characters from the input string, in the order in which they appeared in the original string. For example, "This is a string." should return "This atrng.". Show how you would test this function.
- kumar.palike January 26, 2010| Report Duplicate | Flag | PURGE
Microsoft Software Engineer in Test Coding - 0of 0 votes
AnswersWrite classes you need to support validation of inputs and return values. Show what specific input values and return values you would use to validate it.
- kumar.palike January 26, 2010
C:\>ping.exe /?
Usage: ping [-t] [-a] [-n count] [-l size] [-f] [-i TTL] [-v TOS]
[-r count] [-s count] [[-j host-list] | [-k host-list]]
[-w timeout] [-R] [-S srcaddr] [-4] [-6] target_name| Report Duplicate | Flag | PURGE
Microsoft Software Engineer in Test Coding - 0of 0 votes
AnswersWrite a function for the following scenario:
- amit January 19, 2010
Given a number determine wether the number is sum of consecutive positive integers,if it is not return false else return true. conscutive integers can be from 2 to n| Report Duplicate | Flag | PURGE
Amazon Software Engineer / Developer Coding - 0of 0 votes
AnswersGiven a BST and sum,find minimum node from root to leaf till u get the sum of node values equal to that sum.
- iiit hyd January 16, 2010| Report Duplicate | Flag | PURGE
Microsoft Software Engineer / Developer Algorithm Coding Trees and Graphs - 0of 0 votes
Answersan array of 0 and 1 in random order
- Anonymous January 14, 2010
segregate 0 on left and 1 on right in 0(n)| Report Duplicate | Flag | PURGE
Coding - 0of 0 votes
AnswersRepeated question: write code for aligned malloc and free.
- Anonymous January 02, 2010| Report Duplicate | Flag | PURGE
NVIDIA Coding - 0of 0 votes
AnswersWas asked to write a program to solve a given equation. Write the test cases
- emma December 22, 2009| Report Duplicate | Flag | PURGE
Sonoa Systems Testing / Quality Assurance Coding Testing - 0of 0 votes
AnswersWrite code to draw a circle.
- Aatish December 19, 2009| Report Duplicate | Flag | PURGE
Microsoft Software Engineer / Developer Coding - 0of 0 votes
AnswersOut of all the questions, MS asked me to implement a Reader writer lock problem.
- Aatish December 19, 2009
And obv., I did get it but not full proof!
Try to come up with a robust code/solution.| Report Duplicate | Flag | PURGE
Microsoft Software Engineer / Developer Threads Coding - 0of 0 votes
AnswersProgram solution for 'game of life' (3X's in an nXn grid. Initial stage - 3 x's horizontal next to each other. Next step - alternate to vertical 3 x's center one stays at the same position. Stages repeat. I coded using arrays, interviewer was interested in a solution without the use of arrays.
- aks December 03, 2009| Report Duplicate | Flag | PURGE
Google Software Engineer / Developer Coding - 1of 1 vote
AnswersWrite a function to add an array of numbers.
- June December 03, 2009| Report Duplicate | Flag | PURGE
Yahoo Software Engineer / Developer Application / UI Design Arrays C C++ Coding - 0of 0 votes
AnswersWrite a C program that takes a string ( like "234") and returns the number ( 234)
- Malie November 20, 2009
Write the test cases for your program
how do you check for the large numbers (in C# how to prevent from having run time errors for large numbers)| Report Duplicate | Flag | PURGE
Microsoft Software Engineer / Developer Coding - 0of 0 votes
Answerswrite a function to return a repeated two char in a given string? EX: FOOPARFOO here FO repeating twice and OO repeating twice. I told him o(n2) solution but he is looking best one.
- Anonymous November 20, 2009| Report Duplicate | Flag | PURGE
Amazon Software Engineer / Developer Coding - 0of 0 votes
AnswersWrite a function to shuffle cards
- Anonymous November 12, 2009| Report Duplicate | Flag | PURGE
Amazon Software Engineer / Developer Coding - 0of 0 votes
AnswersCheck whether the number is palindrome or not without using array?
- handiaya November 09, 2009
Convert the 6 decimal system into 10 decimal system?| Report Duplicate | Flag | PURGE
Microsoft Software Engineer / Developer Coding - 2of 2 votes
Answersfind the longest palindrome in a string?
- handiaya November 09, 2009| Report Duplicate | Flag | PURGE
Microsoft Amazon Software Engineer / Developer Algorithm Arrays C++ Coding String Manipulation C