DEV Community

Cover image for Eight Steps to solve coding interview question
Pratap Sharma
Pratap Sharma

Posted on • Updated on • Originally published at pratapsharma.io

Eight Steps to solve coding interview question

Recently I have started giving lots of coding interviews online. Lately, when I was asked to solve a coding problem, I realized that my approach to solving the problem was not good, which always made me move in the wrong direction and not solve the problem. I started studying my way of solving a problem and realized what I was doing wrong.

After lots of study and efforts, I came up with Eight (8) steps to solve a coding problem. After following these steps, I solved the problem with ease and in a proper way. Here I'm sharing with you the tips to solve a coding problem. Let's go ahead with an example question.

Eight Steps to solve coding interview question

Step 1: Verify the constraints.

Step 2: Write out some test cases.

Step 3: Figure out a solution without a code.

Step 4: Write out your solution in code by hand.

Step 5: Double check for errors.

Step 6: Test your code with your test cases.

Step 7: Analyzing Space & Time complexity.

Step 8: Can we optimize our solution?

To go through the steps in details please click here eight steps to solve coding interview question.

If you learned something from this article, please share it with your friends.

You may also follow me on LinkedIn and Twitter.

Top comments (0)