views:

811

answers:

6

Hi,

Recently I have been interviewing for quite a few Software Development Engineering position and almost every interview I have faced have been concentrated heavily on Algorithm and Data Structures, am wondering how could it be possible to face an unknown problem and design an algorithm for it using appropriate data structures that too in the span on minutes - 5 mins at max.

I would really appreciate if someone can put some light on the issue and how to make best of the interview process in terms of dealing with Algorithm/Data Structures Problems.

Thanks.

+3  A: 

When I've interviewed people, and asked them questions, I'm not looking for an answer (necessarily). Talk it out - discuss what you're thinking.

As an interviewer, seeing the logical train of thought will score more points with me than just saying "I'd do ...". If I can see that you know how to approach the problem, that demonstrates the ability to work out problems, which is usually the goal.

Reed Copsey
Speaking as an interviewer, this is exactly what I look for - what led you to a conclusion - not the conclusion itself. Usually if its not an acceptable answer I will continue to prod and hint at the direction I am looking for. Learning to talk out your thought process in a high stress situation like an interview is tough, but definitely something you want to practice.
Greg Rogers
Yeah - The fact that the interviewee will communicate with me while they're thinking about it is more valuable, IMO, then them being able to come up with an answer on the spot.
Reed Copsey
A: 

This is a really nebulous question, given that you're asking how to be prepared to write algorithms with data structures. That's akin to asking how to know how to make things with materials. What sort of algorithms are they expecting you to produce? What sort of data structures are they asking you to use or produce? The interviewer is (likely) trying to get a feel for how you think. There may be some that are looking for "book answers" too, unfortunately. Some examples would be beneficial.

Adam Robinson
Actually my question was about how to deal with algorithm/data structures questions which come out of blue and we need to solve them in short time span of couple of minutes. I agree with your point about interviewer is trying to get a feel for how interviewee would think.
Rachel
+1  A: 
Traveling Tech Guy
+1 for 5-minute question is just presented to see how you approach a problem, not how to solve it.
Rachel
+1  A: 

Steve Yegge has a really great blog entry on getting a job at Google where he addresses what you need to know about algorithms for a Google interview and what preparation materials you should read.

Asaph
+1  A: 

The point of asking these questions is that as people who build software, we are supposed to know this stuff and be able to apply them. This skill is a fundamental component and has uses beyond just passing the interview.

Most of the topics are discussed in any university algorithm course. But to be really good at them, you can try practicing problems from TopCoder, SPOJ and UVa (and lots of other sites like these).

MAK
A: 

You might want to look at a book on Data structures and Algorithms. Aside from the ones listed by the blog entry recommended by Asaph (and a quick look indicates that the blog is worth reading), I've been enjoying How to Think About Algorithms (which I got by ILL). It is a college textbook which gives general patterns of algorithmic thinking as well as specific algorithm examples (and some exercises have answers in the back).

Kathy Van Stone