Sunday, January 23, 2011

Lessons learned from computer science interviews

Interviews and its questions. They always look easy after getting out of interview session. Most of the time people tend to ask technical questions and specifically programming ones. In this blog post I am writing my experience and advises while writing a program.

In the program to understand we have logical parts such as input, output and logical main. To start with your program

:> Identify the returned stuff. Say int is returned to find max out of an array
:> Put a logical method name with proper input or receiving parameters
:> In the start of the program initialize some variables if required
- counter, start and end pointer to string, length of the string
:> if recursive program then check on null or exit conditions in start of program.
:> in recursive program the return can be associative with recursion.
- i.e. return ( node.value < node.right.value && checkTreeisBST(node.right) )
:> do a dry run after finishing the program and test it for edge conditions

A good guide to programming questions is Crack the Interview . Here the answers are wrong but questions are right. So don't trust the answer.

No comments:

Post a Comment