A man approached Noah Suojanen, who was resting in the lobby of Microsoft's headquarters in Redmond, Washington after he had endured six hours of intense job interviews with six separate interrogators. The man mumbled an unenthusiastic "Hey" before leading the fledgling programmer down a hallway and into a windowless room. The door closed behind them, and Suojanen waited for an introduction that never came. The only clue to the man's identity was his attire: "He was wearing a royal-blue shirt and jeans," Suojanen says. "It takes a genius to find a shirt that clashes with jeans."
The man handed Suojanen a marker and asked him to write code for a series of data structures on a whiteboard. Except for the occasional muttering of instructions, the only sounds in the room were the hum of computers and the squeaks of Suojanen's marker. Finally, the questioner abruptly excused him. Perplexed, Suojanen left the room — and never heard from the man again.
That was a year ago. "To this day, I have no idea who he was," says Suojanen, 22. "He never introduced himself."
In fact, Suojanen's close encounters at Microsoft were hardly unusual: Maddeningly cryptic programmer interviews are the stuff of legend. Still, nothing had prepared Suojanen and fellow Stanford University grad John Mongan for the real deal. "If you were lucky, you'd hear stories from older students who had survived their job searches," says Mongan, 23. "But nothing prepared me for the shock of that first interview."
Naturally, Suojanen and Mongan decided to write a book about their experiences: Programming Interviews Exposed: Secrets to Landing Your Next Job (John Wiley & Sons, May 2000) is based on the more than 60 job interviews that the two endured at various technology companies.
Expect no "fuzzy talk," no discussion about career goals, says Mongan. It's all about intimidation, big numbers, and a job candidate's ability to handle the unexpected. But first, it's about the phone call.
While he was still a student at Stanford, Mongan was gearing up to go out one Friday evening when his telephone rang. "This is Zafir," the caller said. "Are you familiar with the mathematical function factorial?"
"Yeeaah," Mongan replied, assuming the call was a joke.
"How would you program it?"
Distracted by mental calculations of the beers that he planned to drink that night, Mongan replied, "It's easy to do recursively."
Zafir wasn't impressed. "Okay, you will now program it iteratively, not recursively." "That's when I knew he was serious," Mongan recalls with a laugh. Phone interviews, he explains, are used to screen job candidates who may have lied about programming experience on their résumés.
Next comes the in-person interview, and the most unnerving element of the process: problem solving in front of a critical examiner. Try solving this brainteaser from the book in 20 minutes or less:
"Suppose you are in a hallway lined with 100 closed lockers. You begin by opening all 100 lockers. Next, you close every second locker. Then you go to every third locker and close it if it is open or open it if it is closed (call this toggling the locker). Continue toggling every nth locker on pass number n. After your hundredth pass of the hallway, in which you toggle only locker number 100, how many lockers are open?
Of course, that's not the correct answer to the problem. The correct answer is 10.
"Everyone becomes a deer in headlights when they encounter their first brainteaser," Suojanen says. "My first couple of interviews were so lousy that I had to chalk them up as learning experiences." Not to worry. A year after declining a job offer from Microsoft, Suojanen now works as a computer programmer for Contact Networks Inc. in Redwood Shores, California. Mongan works as a consultant at Autodesk Inc. in San Rafael, although that job is a temporary one. Next month he'll begin attending medical school.
The duo wrote their book for serious coders, but nongeeks will probably enjoy it as well. Reading the brainteaser solutions, you may even feel — at least momentarily — as smart as a programmer.
Now, if only you could dress like one.
Ellen McCarty (firstname.lastname@example.org) is a section editor for Verde.com. Contact John Mongan or Noah Suojanen by email, (email@example.com).
Sidebar: Problem Solved
Even brilliant coders can crumple under interview pressure. Here's a short course on how to handle a complex brainteaser without losing your mind.
Break it down. Smaller is more manageable. To solve the locker riddle, John Mongan and Noah Suojanen advise using only 12 lockers versus all 100 of them.
Talk out loud. An interview is often structured like an exam, but a lot of answers can be worth partial credit. If you're talking out loud, an interviewer knows where you are and can give you hints.
A problem shouldn't be too easy. The obvious answer is almost never the right one. Many problems are difficult because they suggest an incorrect assumption that leads to a wrong answer. Identify your assumptions early in the process and brainstorm all of the possibilities to identify the one piece of information that you're missing.
A problem shouldn't be too hard. Although answers can be complex, they rarely require time-consuming computations or math past trigonometry. Spending time crunching numbers? You're probably on the wrong track.
Don't get discouraged. Draw a picture, play with all of the possible uses of objects in a problem, and trust your process. The answer is there; it's just a matter of your moving the pieces around until the puzzle comes together. As long as you keep moving and voicing your process to the interviewer, you're bound to solve it.