# How to nail your Coding Interview

May 22, 2019

Here are some tips while giving your coding interviews.

WHenever interviewer asked you a question. Normally candidates jump to the most optimal solutions straight away. Never do that, even if you know the answer. Manytimes it happens that people just remembers the optimal solution, and when asked in interview on how they come up to this solution, or what are your thought process? They have no clue.

Remember, always start with the brute force algorithm. You can just discuss with your interviewer that this is the simplest approach, and there can be better solutions to this. Discuss them one by one. When you give issues in the naive solution, your interviewer understood that you have knowledge about the topic.

## 2. Clear the problem statement first before starting solving

Always try to speak the problem statement and clarify any confusion. Do not assume anything. Speak everything, whatever you are assuming. Many candidates just start writing solution, and when asked about specifics. They messed it completely. Not everything is implicit. Try to expand the problem and clear every single details before solving the problem.

## 3. Bug free code

Interviewer often asked about writing a production ready code. You should be able to come up with an error free code with almost all edge cases handled.

Interviewer loves to hear your thought process. They don’t like a perfect solution with no explanation given. Often candidates failed to explain their solution which clearly states that they have memorize the solution.

## 5. Most Important, Don’t give-up

It is very important to keep thinking, and speak your mind out. Never ever, give up. Keep up the thinking ON. Interviewer is there to give some hints too. Many times, interviewer gave a super hard problem, and want to see how you are thinking about it. Its not always expected to come up a super optimized solution.

## Similar Posts

### Three Sum Closest - Leet Code Solution

Problem Statement Given an array nums of n integers and an integer target, find…

### Single Number - Leet Code Solution

Problem Statement Given a non-empty array of integers, every element appears…

A number consists of digits. Example: 843. Its a 3-digit number. Radix sort…

### Check whether number is palindrome or not - Leet Code Solution

Problem Statement Determine whether an integer is a palindrome. An integer is a…

### Four Sum - Leet Code Solution

Problem Statement Given an array nums of n integers and an integer target, are…

### Leetcode - Split a String Into the Max Number of Unique Substrings

Problem Statement Given a string s, return the maximum number of unique…

## Latest Posts

### Python SMTP Email Code - How to Send HTML Email from Python Code with Authentication at SMTP Server

Introduction This post has the complete code to send email through smtp server…

### Python SMTP Email Code - Sender Address Rejected - Not Owned By User

Introduction In a normal email sending code from python, I’m getting following…

### Nodejs with MongoDB - Number of Opened Connections Keep on Increasing with Mongoose Library

Introduction In one of my app, I was using to talk to . I have used some event…

### Django Python - How to Build Docker Image and Run Web-service on Apache with Python 3.9

Introduction So you have a Django project, and want to run it using docker image…

### Python - How to Maintain Quality Build Process Using Pylint and Unittest Coverage With Minimum Threshold Values

Introduction It is very important to introduce few process so that your code and…

### Example Jenkin Groovy Pipeline Script for Building Python Projects with Git Events and Push to Artifactory

Introduction In this post, we will see a sample Jenkin Pipeline Groovy script…