Make your own free website on Tripod.com

Search

There are two arrays. Find two elements in the arrays which add up to X. This test their common programming logic.  You can also ask them about the Big O function of their algorithm.

-Michael Liang

Source Code Control

"What source code version control system do you use?"

-Len Chaney

Design

Q. How can a function maintain state between calls.

Answer 1: Use static member variables.

Answer 2: Such a function should be implemented as an object. This way you don't need to have every

caller share the same state.

-Richard McFarlane

Attitude

This question has to do with a programmerís social skills. Your manager decided to please the client; thus he/she wrote a new specification that meets one of the clientís many wish lists. After you have reviewed the specification, you have decided that the new modules do not fit into the current core product. In fact, it will break the current product architecture. How do you handle the problem, if your manager decided that you should not challenge his/her designed?

-Giang, Cuong

Coding

Write a Java code sample to do buffered/unbuffered file I/O.

-Kogan, Eugene

OOP

Understanding of polymorphism & OO design patterns.

-Kogan, Eugene

String Search

This question is supposed to lead to a conversation. The further, the better...

Describe the algorithm you would use to read in a stream of words (English language words) and, after the stream is read, return the number of words you've read, and how often each word occurs. The algorithm used should work with any number of words, which means that it should work well with a small paragraph of text, but also with a stream as big as the library of congress.

In short, for each new word you read in, you have to check if it was already read, if yes, count it, if no, add it to the list of words.

First guess, a "hashtable" is a possible answer, but not really feasible because, because Hashtables's speed depends heavily on the size of the input (...)

First step answer is a "binary tree" with each node containing a word, and the number of occurrences of the word. For each new word, find it in the tree (takes log n steps), if found, increase the word counter by 1, if not insert it.

However, what if the words read in are already sorted? In this case, you get the same complexity as having all nodes stored in a linear list (n2), because the nodes inserted in a tree actually create a list.

How can the binary tree be modified so that it accommodates this case? Answer: Rearranging it periodically.

So the final answer is a "balanced binary tree", where after each word is inserted the levels of the tree are checked. If the tree became unbalanced after the last insert, which means that its level is difference between the highest and the lowest level is more than 1, a simple rotation can be done to re-balance the tree.

Evaluation: I guess this question checks a little bit of college knowledge, but also how the interviewee can apply this knowledge, as well as problem solving skills, and I guess general attitude to problems.

-Breuss, Philipp

Security

Imagine you stand on one side of a river, with a boat, a lock, a key for the lock, and the boat contains a box, and you can lock the box. Your buddy is on the other side of the river. He has also a lock and also a key for his lock. However, your key does not open his lock. And his key does not open your lock. You have a pile a of gold and you would like to get this gold across the river under the following conditions:

1) You cannot sit in the boat. You can only push the boat across the river and you have to stay on your side of the river.

2) Also the key has to stay with you.

3) The gold can cross the river only inside the box.

4) The box must be locked.

Hint:

You can put more than one lock on the box.

Answer:

Put the gold in the box, put your lock on, and lock it. Then push the boat across. Since you buddy cannot open the lock the bock with his key, he can only put his lock on too and send push the boat back.

Then you take your lock off, and push the boat back to your buddy. Now he can open the box...

What does it have to do with the stuff we do? Security - public key, private key works similar...

-Breuss, Philipp

Java

Q : What is the 'synchronized' status of a method in the derived class that overides a synchronized method in the super class?

A : Not synchronized

-Chellamani, Rajesh

Technical / Programming

Have them choose the language they are comfortable with or the one most used, (in our case Java). Pick a straight forward task like persisting the object to a database - a save or retrieve method. Or a simple search in a linked list.

Positives to look for:

Good programmers usually put all of their {} in first and then fill-in.

Good programmers usually draw a picture or describe a plan to get the job done.

Good programmers will ask questions if the task was too ambigous.

Good programmers will have a rudimentary naming conventions.

Good programmers will be confident in their solution and may look for ways to optomize.

Good programmers will stub out sub function calls.

Negatives to watch out for:

As much as we like naming conventions loop indices are usually short in the code of experienced programmers

Making an excessive amount of syntactic mistakes. (no one is perfect but they should have the syntax down cold).

Vacillating back and forth about decisions in implementation.

-Jeremy Smith

Leadership

Point out a bug in their code and see how they handle it.

Ask how they would/have handle(d) a situation where a member of their team disagrees, (disagrees to the point of disrupting others) with the current design/implementation during a project meeting.

Good answers:

Have them prepare something and present it to you personally, before disrupting the team more.

(Shows concern for team members and the project success)

Look for the holes they are trying to patch with their modifications.

(Willing to admit mistakes if they exist)

Don't let the situation become a major distraction to the team keep things moving. Know when to say enough is enough.

(Will stick by their guns if the situation warrants)

Bad answers:

Public humiliation in the meeting. (that engenders fear not teamwork).

Immediate dismissal/transfer for "insubordination". (Pushes the problem off)

-Jeremy Smith

Design

Here is a question that I haven't used but really liked when reading it in a recent article. It helps show the thought process of the candidate in a concise example.

(I'll just quote this section.)

"Part 6: the design question. Ask the candidate to design something. Jabe Blumenthal, the original designer of Excel, liked to ask candidates to design a house. According to Jabe, he's had candidates who would go up to the whiteboard and immediately draw a square. A square! These were immediate No Hires. In design questions, what are you looking for?

Good candidates will try to get more information out of you about the problem. Who is the house for? As a policy, I will not hire someone who leaps into the design without asking more about who it's for. Often I am so annoyed that I will give them a hard time by interrupting them in the middle and saying, "actually, you forgot to ask this, but this is a house for a family of 48-foot tall blind giraffes."

Not-so-smart candidates think that design is like painting: you get a blank slate, and you can do whatever you want. Smart candidates understand that design is a difficult series of trade-offs. A great design question: design a trash can for a city street corner. Think of all the trade offs! It has to be easy to empty, but impossible to steal; it has to be easy to put things into, but hard for things to fly out of on a windy day; it has to be solid, yet inexpensive; in some cities, it has to be specially designed so that terrorists can't hide a bomb in it.

Creative candidates will often surprise you with an interesting, non-obvious answer. One of my favorite questions is Design a Spice Rack for Blind People. Inevitably, candidates will put Braille somewhere on the spice bottles, and it usually winds up being on top of the lid for various reasons which you'll discover after you've asked this question 100 times. I had one candidate who decided that it would be better to put the spices in a drawer, because it is more comfortable to scan Braille with your fingertips horizontal than vertical. (Try it!) This was so creative it surprised me -- in dozens of interviews, I had never heard that answer. And it really took a major creative "leap" outside of the bounds of the problem. On the strength of that answer alone, and no negatives, I hired the candidate, who is went on to be one of the best program managers on the Excel team.

Look for closure. This is part of Get Things Done. Sometimes candidates will drift back and forth, unable to make a decision, or they will try to avoid hard questions. Sometimes they will leave difficult decisions unanswered and try to move on. Not good. Good candidates have a tendency to try to naturally keep things moving forward, even when you try to hold them back. If the conversation ever starts going around in circles, and the candidate says something like "well, we can talk about this all day, but we've got to do something, so let's go with decision X" that's a really good sign. "

-Jeremy Smith