Coding Interview Questions
- 2of 2 votes
AnswersWrite a program to generate all prime numbers from 2 to N for any N value
- SHA.AN March 04, 2009| Report Duplicate | Flag | PURGE
Epic Systems Software Engineer / Developer Coding - 0of 0 votes
AnswersWrite a function to identify if an integer has the same value when reversed (i.e flipped over. 6 when reversed will be 9).
- Anonymous February 28, 2009
For ex : the method should return true for the following integers
818
1691
88
but should return false for
8018
212| Report Duplicate | Flag | PURGE
Facebook Software Engineer / Developer Coding - 0of 0 votes
AnswersWrite the function for changing a number from hexadecimal to integer htoi(s)?
- AMRITANSHU SHEKHAR February 24, 2009| Report Duplicate | Flag | PURGE
Apple Development Support Engineer Coding - 0of 0 votes
AnswersWrite a code to replace the word with another (please do not use the some built in function of a programming language)..
- ghajni January 05, 2009| Report Duplicate | Flag | PURGE
Epic Systems Software Engineer / Developer Coding - 0of 0 votes
AnswersWrite a program which asks user to input numbers and find the smallest even number and largest odd number from those numbers..
- ghajni January 05, 2009| Report Duplicate | Flag | PURGE
Epic Systems Software Engineer / Developer Coding - 0of 0 votes
AnswersCode a fibonnaci sequence.
- joseph December 25, 2008| Report Duplicate | Flag | PURGE
Intuit Software Engineer / Developer Coding - 0of 0 votes
AnswersWrite a code to check whether a number (int) is a palindrome or not. The code was supposed to be bug free and all exceptions handled. The code was supposed to return true if function worked properly and false if function created an error.
- Prashi December 20, 2008
Int IS_Palindrom (int num, int *p)
{
}
return value conveys state of the function and *p contains result of the function.| Report Duplicate | Flag | PURGE
Amazon Software Engineer / Developer Coding - 0of 0 votes
AnswersDetect a cycle in graph(DFS)
- Anonymous November 06, 2008
Count number of bits and asked me later to do it in O(1)| Report Duplicate | Flag | PURGE
Google Software Engineer / Developer Coding - 0of 0 votes
AnswersConvert string into new string e.g. "abcD"->"cdeF" and "plxY" -> "rnzA"
- Ripul Patel October 23, 2008| Report Duplicate | Flag | PURGE
Epic Systems Software Engineer / Developer Coding - 0of 0 votes
AnswersShuffle an array of 52 integers.
- Satish October 22, 2008| Report Duplicate | Flag | PURGE
Microsoft Software Engineer in Test Coding - 2of 0 votes
AnswersA number is called 'desirable' if all the digits are strictly ascending eg: 159 as 1<5<9. You know that your rival has a strictly numeric password that is 'desirable'. Your close ally has given you the number of digits (N) in your rival's password. WAP th\hjtat takes in 'N' as input and prints out all possible 'desirable' numbers that can be formed with N digits.
- Anonymous October 19, 2008| Report Duplicate | Flag | PURGE
Epic Systems Software Engineer / Developer Coding - 1of 1 vote
AnswersWrite a method to reverse words of string.
- Ratan October 16, 2008| Report Duplicate | Flag | PURGE
Amazon Software Engineer / Developer String Manipulation Coding - 0of 0 votes
AnswersImplement an algorithm to generate all prime number from 1-100 in fastest and most efficient way
- Ratan October 16, 2008| Report Duplicate | Flag | PURGE
Amazon Software Engineer / Developer Math & Computation Coding - 1of 1 vote
AnswersDesign a One shot timer library capable of supporting multiple times simultaneously. Cancel is also supported. Only ONE hardware timer register.So basically, a process/function can call SetTime(10) and it will get notified after 10 seconds. It can also say SetTime(2)... SetTime(7). Then it will get two notifications, one after 2 and one after 7. [SetTime returns a handle]
- SG October 15, 2008
The process(s) can also issue a cancel. Cancel(handle), to cancel a specific timer they set.
The hardware timer registers, assume decrements by 1 every 1 second. So if you set it to 10, it will notify you after 10 seconds. Basically it interrupts, and lets say calls RegExpired(). You can Read/Write this register anytime very fast (uS).
The key here how you make use of this single register to support any number of timer events that applications/processes are demanding asynchronously.
Discuss the data structure you would use and implement it in C.| Report Duplicate | Flag | PURGE
National Instruments Software Engineer / Developer Coding - 1of 0 votes
AnswersMake a nonblocking UART library given a underlying UART hardware, data registers and flags that mark end of transmission and stuff.
- SG October 15, 2008
This is very common. Simply look for Software UART in embedded systems. Also uses some OS concepts like round-robin, preventing spin locks etc.| Report Duplicate | Flag | PURGE
National Instruments Software Engineer / Developer Coding - 1of 1 vote
AnswersPrint a Link list in reverse order.
- SG October 15, 2008
Given: PrintReverse(List *head){}
Discuss Pros and cons of Inplace reversal, as compared to reversing by creating a new list. They were looking not only for Memory and Space, but also from a concurrency Point of View.| Report Duplicate | Flag | PURGE
National Instruments Software Engineer / Developer Coding - 0of 0 votes
AnswersThere are two collections of objects C1 and C2. C1 can be any thing - Flowers, Fruits, Foot Balls etc.. and C2 also same. How can you find out if C1 is a subset of C2 or C2 is a subset of C1 or both are equal? Provide algorithm, code and test cases.
- Nachiketha October 08, 2008
The interviewer was expecting a linear algorithm - the algorithm with a time complexity of O(n)| Report Duplicate | Flag | PURGE
Microsoft Software Engineer in Test Coding - 0of 0 votes
AnswersHow do you find out if a given string S1 is a substring of another string S2? Provide algorithm, code and test cases.
- Nachiketha October 08, 2008| Report Duplicate | Flag | PURGE
Microsoft Software Engineer in Test Coding - 0of 0 votes
AnswersImplement memcpy(void* src, void* dst, int len)
- Anonymous October 06, 2008| Report Duplicate | Flag | PURGE
Google Software Engineer in Test Coding - 0of 0 votes
Answerscalculate how many days between two given date.
- Jammy October 04, 2008| Report Duplicate | Flag | PURGE
Amazon Software Engineer in Test Coding - 4of 0 votes
AnswersWrite a function to convert integers to roman numerals with 1=I, 5=V, 10=X, 100=C, 1003=M. E.g. 3999 = MMMCMXCIX
- Anonymous September 25, 2008
This was tougher than I thought.| Report Duplicate | Flag | PURGE
Microsoft Software Engineer in Test Coding - 0of 0 votes
AnswersGiven a 2 dimensional array of integers representing a tictactoe board, write a function to look for winners.
- Anonymous September 25, 2008| Report Duplicate | Flag | PURGE
Microsoft Software Engineer in Test Coding - 0of 0 votes
Answers1) Write a function which determines wheather in given array there is a sequence of n or more elements, which have the same value. Example:
- First phone interview September 23, 2008
n = 3, input[] = { 1,1,1,2,3,4,5 } gives true;
n = 2, input[] = { 5,1,2,2,2,4,5 } gives true;
n = 3, input[] = { 5,2,2,3,2,5,5 } gives false;
2) Write a function which determines, wheather the array is a mirror - reflection - like. Example:
input[] = {1,2,3,2,1} gives true
input[] = {1,2,3,3,2,1} gives true.| Report Duplicate | Flag | PURGE
Microsoft Software Engineer / Developer Coding - 6of 0 votes
AnswersReverse a linked list iteratively, do it first with single pointers and then do it again with double pointers. Now do it again recursively but not tail-recursive, and then do it again tail-recursively. What do you do if it has a loop?
- Anonymous September 22, 2008| Report Duplicate | Flag | PURGE
Microsoft Software Engineer in Test Coding - 0of 0 votes
AnswersGiven a puzzle of letters/ characters e.g.
- Anonymous September 18, 2008
a e r o p s
b h a r l s
w r i s l o
a s n k t q
Write a function to which this puzzle and a word will be passed to test whether that word exists in the puzzle or not.
e.g. rain and slow will return true. rain is present in the second column and slow in the third row wrapped around.| Report Duplicate | Flag | PURGE
Google Software Engineer / Developer Coding - 0of 0 votes
AnswersFind the first non- repeated character in an array
- Nikunj September 13, 2008| Report Duplicate | Flag | PURGE
Coding Algorithm - 0of 0 votes
Answersdeclaration of "static function" -- what it means ?
- xyz September 12, 2008| Report Duplicate | Flag | PURGE
Bloomberg LP Financial Software Developer Coding