Tuesday, December 05, 2006

Interview Notes 1

Three of my old interview logs, maybe you can use them to help you prepare for one of your early career software programming job interviews. Maybe I'll put a more recent batch of these up later.


4/16


I had a phone screen recently, man those things are fun. First one in a while, though mostly just for fun, and I wasn't well prepared at all since it came out of the blue. I actually took notes afterwards, so I thought I'd briefly discuss the interview.

First we talked about Java's Access Control modifiers (public, private, protected, package) and about which each modifier did what. I couldn't remember package though. I feel stupid, because after I said I couldn't remember the last modifier, we talked about packages and I didn't make the connection for a while. We talked about what packages are, why we use them, and how to classes to a package. That's when I finally made that connection.

Then we talked about Interfaces. What they are, what they're used for, and why you would use them versus standard inheritance.

Next, we talked about Exceptions. The two types of exceptions, why to use throw versus try/catch, and how the Method Call Stack was used with Exceptions.

Then we went into Threads. He had me give an explanation of them, how to use them. I gave him some code of how to create a new thread and gave him some examples of when we use them without explicitly creating (in someone else's code, like with Swing, as well as when processing http sessions).

We talked about Reflection, what it is used for, and why it is used. I had to give some code using the refection package.

Next we went over databases. He had me give him code to make a simple query on a table and print the results out. He asked me a little about SQL also, like how to insert and delete stuff.

We then talked about Unit Testing and Functional Testing. I didn't know this. It turns out unit testing tests one class while funtional testing tests an entire project. He also asked me if I'd used Ant before. I told him I used Make instead, but I think I'll look into Ant now.

Lastly, we talked about J2EE. Three types (servlets, JMS, web services). We didn't go much into it since I didn't know much. And that was the end of the interview.


4/20

I had another interview; the people were very laid back there. The first interviewer mostly asked me about what I had done before. The coding questions were to write the code for a page of boxes with text in them, design a database layout for certain information, and then usin Javascript to resize a box when a button was clicked. With the second guy, we mostly talked about a card shuffling algorithm I brought up when I said I made a card game before. He told me about a "Perfect Shuffle", when cards interleave one by one. 7 (or 8) straight perfect shuffles result in the cards being in their original position, which is a technique used by card sharks. He asked me what kind of stuff I wanted to work on before letting me go. It was a pretty fun interview, all in all.


4/25

First stage interview today; went through three people in about an hour and a half.

First guy mostly talked to me about data structures. Started off with asking me how I would index all the pictures on the internet and make sure not to index pictures multiple time. I said to use a hash table. Then he had me do some pointer logic in c. How to reverse a string in place and how to copy one file to another.

The second guy asked me a lot about my old work experience. At the end he asked me one programming question, which was to write code copying

The third guy mostly gave me puzzles to solve. He asked me how many sugar cubes were in a cube that was 10 sugar cubes across and 10 sugar cubes high. Then he asked me some kind of math problem about finding out how long it would take to run across a field. Then, for some reason, he had me do some recusive programming: Just the Fibonacci code and traversing a tree. He ended by asking me a badly worded problem.

That problem ended up being this: Imagine you and your friend are on other sides of a river. There is a box with two locks: you have the key to one of the locks and your friend has the key to the other lock. Both locks need to be unlocked to open the box and the locks don't touch each other. You want to deliver an important message to your friend, but you can't do it yourself and you don't want to risk anyone else seeing the message. What do you do?

Of course, once I clarified the problem, I realized it was an encryption abstraction and answered: "Put the message in the box, lock your lock, and have a messenger bring it to the friend. He locks his lock and has the messenger return it to you. You unlock your lock and have the messenger return it to your friend. Now the friend unlocks his lock and takes out the document." And that was the end of the interview.