Need help weeded out a couple of people through a test, any help on questions?
Basically, I'm the only programmer for my Robotics Club at school and I can only choose three of six new members who would like to become programmers. They are all beginners, and I will be teaching them Java. I want to weed out three of them through some type of test so I can get people who are at least a little experienced. In a short test (like 5-10 questions) what should I ask to accomplish this?
- RatchetrLv 71 decade agoFavorite Answer
This is an old one I used to have fun with in job interviews. I always learned a lot about how people solve problems with this one.
Write a function that takes an array of 10 integers.
The array contains numbers in the range 1 to 11. There are no duplicates. So there must be exactly 1 number missing.
The return value from the function is the missing number.
I liked this one because there are lots of ways to solve it. Anyone who can't solve it, or comes up with something that is horribly convoluted doesn't belong on your team.
Some solutions will modify the array that was passed in. Person gets extra credit if they ask if that's OK ahead of time. If not, ask them how they would solve it if you told them they can't.
Don't know if you've gotten into algorithm analysis (Big O) yet or not, but if so, that's a good follow up question. Your solution is O(?).
What I really liked about this question: There *is* one best way to implement this. It's O(N), and requires no additional memory. All other solutions are worser ;-) But nobody comes up with the elegant solution in an interview (Except 1, who was a math major), but some will figure it out in a day or 2. I got follow up emails from a few...they figured it out and they wanted to share. You want that sort of person on you team...someone who is still thinking about the problem on their own time.
- 1 decade ago
Since programming is mainly problem solving, I would give them logic questions. Here is an example that most people have heard before. (Ya, I know this example sucks, but you get the idea.)
Q: A boat is floating in calm water. There is a ladder off one side of this boat. It's bottom rung is 40 centimeters from the surface of the water. The water is rising at rate of 1,500 millimeters per hour. How long will it take the water to reach the ladder?
A: Never. The boat rises with the water.