How to handle Coding Question??

If anybody is asked coding question like write a function that performs string reverse?? How can we handle such questions in better way?

First and foremost, the question may sound very easy to you but never take interview question lightly. As there are some reasons behind such simple and easy question. Believe it, it’s true.

So if you are asked such question then, showing your willingness to explain in board is the first step.
Next, come up with an efficient algorithm and before proceeding with algorithm, ask few question for adding interaction such as

How the function arguments should be ( one or more in number, their data types) ??
What should be the function name and function return types?

After that, if you further want to add more interaction then, you may ask about the goal and non-goal conditions. Goals refers to the necessary condition that one should follow like error handling, efficiency in space and time, normal or general types. Non-goals refers to non-important things like if error handling is not important then you can take it as non-goal condition.

After completion of these steps, you can then proceed with the algorithm.

Be careful, only writing algorithm or code in the board is not just sufficient. You need to write line by line and then keep on explaining each line simultaneously.

Later on, if you have time, you may be asked for efficient method or may be some related test cases.

If you have any queries at all, then feel free to send suggestion and comments

No comments:

Post a Comment