The Problems
Here is a list of the questions that I received through out the day during my interview. These questions are in no particular order (other then the order I remembered them).
- If you were given the assignment to test a keyboard, how would you test it?
- If you were given the assignment to test a clock, how would you test it?
- Let's say that you are a building inspector and have been assigned to this newly constructed 100 story building. Your last job is to test the elevator systems in this building, how would you perform this task? Please lay it out in test plan form
- You are an employer of a company and you are in the process of hiring a new employee. You must pay this employee in gold at a rate of 1 oz. per day. This employee will work for you for 7 days and must be paid every day, no more and no less then 1 oz. per day. You happen to have one 7 oz. bar of gold and may make two cuts on this piece of gold. What cuts would you make in order to successfully complete the task?
- You are given lengths of string that will always burn in 60 minutes from one end to the other. You have been tasked with measuring 45 minutes using these string how would you do it? Now imagine that the strings will burn from one end to the other in 60 minutes but they will not always burn at the same rate. Sometimes the strings will burn faster or slower at parts. How would you measure the time now?
- You are given 5 colored objects and need to arrange them in a circular fashion. How many unique ways can you arrange these objects?
- Please write a function that will determine if a number passed into it is a perfect number. How would you test this?
- You have been asked to write a program that will determine the winner in an election. If given N candidate and given a step of M, you must remove every Mth candidate from the list wrapping around when reaching the end. If given N=7 and M=3, the result would be 4. What data structures might you consider for such a problem? Why? Now write the code using data structure X.
- Please write a function that will determine and return the duplicate strings given two lists of strings. How would you test this? What is the complexity of this function?
- Given a track that extends infinitely in both directions you need to write a program that two trains will execute in order to make them collide. Both of these trains start on the track at a spot marked with an S. You have four instructions that you may execute, Move Left, Move Right, GOTO and SGOTO. GOTO will go to a label in your code and SGOTO will be executed when the train is over an S mark. Write the program. A picture may be helpful.. I might post one later...
- Please write a function that will reverse the words in a string. Describe how you would test this code
Example: The sky is blue. -> .blue is sky The - Given a two dimensional array. If you encounter a row that is full of data, shift everything above this row down one position, effectively replacing the row and adding a blank row at the top. Write a function that will do this in place. A picture would also help with this one as well...