Coding Interview Questions
- 0of 0 votes
AnswersQ9. Write code to implement a class for wrapping text stored in a file. You should add enough functionality to the class to demonstrate your ability to design classes with either the C++ or C# language.
- Jack March 17, 2006
The class should at least meet the following requirements:
1. The class should be named CPersistentString
2. A class instance should flush its string to a file before it dies.
3. The class should support at least the following operators: "=", "==", and "[ ]".
4. The class should include the following operations: GetLength(), IsPalindrome(),Load(), Persist().
Feel free to add more than just the minimum requirements. You may use any functions in the standard C library (for C++) or .NET framework (for C#) and you may use a compiler to check your work.| Report Duplicate | Flag | PURGE
Sage Software Software Engineer / Developer Coding - 0of 0 votes
AnswersDescribe psuedo code to count the number of 1's in a binary number.
- Jack March 13, 2006| Report Duplicate | Flag | PURGE
Electronic Arts Software Engineer / Developer Coding - 0of 0 votes
AnswersTwo robots are each standing on a beacon, on a line of infinite length.
- Henrick March 07, 2006
They both execute the same code. Write the code to have them collide.
Only use these commands:
SKIPNB - skip the next line of code if not on a beacon
MVR - move right one step
MVL - movel eft one step
JMP - goto label in the code
hint: have both robots move to the right in a loop. if a robot passes a beacon, double its speed.| Report Duplicate | Flag | PURGE
Microsoft Coding - 0of 0 votes
AnswersWrite code to find the dot product and cross product.
- Henrick March 07, 2006
Given 3 points on plane and a point in space, find the distance between the point and the plane.
Find the location of the point projected to the plane.| Report Duplicate | Flag | PURGE
Microsoft Math & Computation Coding - 0of 0 votes
AnswersWhat is an ideal data structure to traverse through in order to create a depth-first spanning forrest?
- krammer February 28, 2006| Report Duplicate | Flag | PURGE
Agilent Technologies Software Engineer / Developer Coding Algorithm - 0of 0 votes
AnswersWrite a program that traverses through a sentence and returns the words in reverse order.
- krammer February 28, 2006| Report Duplicate | Flag | PURGE
Agilent Technologies Software Engineer / Developer Coding - 0of 0 votes
AnswersWrite a function that sums & returns the digits of an unsigned integer.
- Jack February 27, 2006| Report Duplicate | Flag | PURGE
Microsoft Program Manager Coding - 0of 0 votes
AnswersHere is a tree. It's a binary tree but in no particular order. How do you write this tree to a file so that it can be reread in an reconstructed exactly as shown?
- Kartik February 24, 2006| Report Duplicate | Flag | PURGE
Amazon Software Engineer / Developer Coding Algorithm - 0of 0 votes
AnswersMultiply a number by 7 without the * operator.
- Kartik February 24, 2006| Report Duplicate | Flag | PURGE
Amazon Software Engineer / Developer Coding - 0of 0 votes
AnswersI want to see if all the ones in a number appear on the right side of the number and all zeros appear on the left, how can I do this most efficiently? (i.e. 00000111 is true but 100010 is false)
- Kartik February 24, 2006| Report Duplicate | Flag | PURGE
Amazon Software Engineer / Developer Coding - 0of 0 votes
Answer2nd phone interview: reverse linklist(so stupid, I was too focus on the rule using the exist library much better than build something new(Effctive Java) and when the intervier insisted on asking me to give the non extra memory consuming answer, I was stucked for a while then I told her to move on the next topic. Find the duplicate number from an array. I gave the hash solving method.but I also gave her other answers.
- bl February 23, 2006| Report Duplicate | Flag | PURGE
Amazon Software Engineer / Developer Coding - 0of 0 votes
AnswersWrite code to reverse vowels of string
- bl February 23, 2006| Report Duplicate | Flag | PURGE
Amazon Software Engineer / Developer Coding - 0of 0 votes
AnswersGiven two log files, each with a billion usernames (each username appended to the log file), find the usernames existing in both documents in the most efficient manner? Use pseudo-code or code. If your code calls pre-existing library functions, create each library function from scratch.
- dotNet February 20, 2006| Report Duplicate | Flag | PURGE
Amazon Software Engineer / Developer Coding Algorithm Object Oriented Design - 0of 0 votes
Answers2nd interview was on-site, with one of the team developers. Given a linked list, swap values inside nodes. Now do it by swaping the node pointers. This wasn't a hard question at all, but more of an organization question for me because it was kind of a twisted question and easy to be off by one pointer.
- Jack February 17, 2006| Report Duplicate | Flag | PURGE
Expedia Software Engineer / Developer Coding Linked Lists - 0of 0 votes
Answers3rd interview was with some other developer. Given two arrays of signed integers. Find the intersecting set of the two. Describe different solutions. He once exclaimed that I was digging into the next question and said I was the only one so far to do that. The next question was implement strpbrk(char* str,char* find). It should return the string starting from the first character matched(find contains a string of characters). We ran out of time as he was asking me how to optimize my lookup(I was using an array).
- Jack February 17, 2006| Report Duplicate | Flag | PURGE
Expedia Software Engineer / Developer Coding - 0of 0 votes
AnswersWas given C code for Base64 Encoding & asked to identify bugs in it.
- Sudipta February 10, 2006| Report Duplicate | Flag | PURGE
VMWare Inc Software Engineer / Developer Coding - 1of 0 votes
AnswersAlgorithm: You have a tree (not Binary) and you want to print the values of all the nodes in this tree level by level. Discussed on phone and asked me to email Java code for my algorithm.
- ybh6336 February 09, 2006| Report Duplicate | Flag | PURGE
Amazon Software Engineer / Developer Trees and Graphs Coding Algorithm - 0of 0 votes
AnswersWhat's wrong with this code:
- vodangkhoa February 04, 2006
unsigned int i;
for (i = 100; i >= 0; --i)
printf("%d\n",i);| Report Duplicate | Flag | PURGE
NVIDIA Software Engineer / Developer Coding - 0of 0 votes
AnswersCount the number of ON bits in an integer.
- vodangkhoa February 04, 2006| Report Duplicate | Flag | PURGE
NVIDIA Agilent Technologies Software Engineer / Developer Coding Algorithm - 0of 0 votes
AnswersWrite atoi(const char * chr)
- vodangkhoa February 04, 2006| Report Duplicate | Flag | PURGE
NVIDIA Agilent Technologies Software Engineer / Developer Coding Algorithm - 0of 0 votes
AnswersDescribe in English what this code does:
- vodangkhoa February 04, 2006
((n & (n-1)) == 0)| Report Duplicate | Flag | PURGE
Agilent Technologies Software Engineer / Developer Coding - 0of 0 votes
AnswerWrite an object(class), called StockCache, that caches a single stock every couple of minutes. What are the function prototypes? Where would you need to put in thread protection? How would you organize the set of StockCache objects?
- Reggie January 30, 2006| Report Duplicate | Flag | PURGE
CapitalIQ Software Engineer / Developer Object Oriented Design Coding - 0of 0 votes
AnswersDetermine if a string is a palindrome. (Remember to think about spaces and capital letters).
- Reggie January 30, 2006| Report Duplicate | Flag | PURGE
CapitalIQ Software Engineer / Developer Coding - 0of 0 votes
AnswersDetermine is a graph is circular.
- other January 30, 2006| Report Duplicate | Flag | PURGE
Amazon Software Engineer / Developer Coding Algorithm - 0of 0 votes
AnswersGiven two binary trees, find whether or not they are similar.
- Neil January 28, 2006| Report Duplicate | Flag | PURGE
Amazon Software Engineer / Developer Coding Algorithm - 0of 0 votes
AnswersRemove characters from a string. What is the running time of your algorithm? Can you do better?
- Jeff K January 28, 2006| Report Duplicate | Flag | PURGE
Bloomberg LP Software Engineer / Developer Coding - 0of 0 votes
AnswersCount characters in a string, wanted to see a hashtable used.
- ola January 23, 2006| Report Duplicate | Flag | PURGE
Amazon Software Engineer / Developer Coding - 1of 0 votes
AnswersWrite in java a method to parse an integer from a string
- ola January 23, 2006| Report Duplicate | Flag | PURGE
Amazon Software Engineer / Developer Coding - 0of 0 votes
Answerscount bits in an integer. Solved using mask, did not attempt -1 approach.
- ola January 23, 2006| Report Duplicate | Flag | PURGE
Amazon Software Engineer / Developer Coding Algorithm