Coding Interview Study Guide

Swap Nodes Pairs in Link List - Leet Code Solution

Problem Statement Given a linked list, swap every two adjacent nodes and return its head. You may not modify the...

Three Sum - Leet Code Solution

Problem Statement Given an array nums of n integers, are there elements a, b, c in nums such that a...

Three Sum Closest - Leet Code Solution

Problem Statement Given an array nums of n integers and an integer target, find three integers in nums such that...

Convert Roman to Integer number - Leet Code Solution

Problem Statement Roman numerals are represented by seven different symbols: I, V, X, L, C, D and M.

Longest Common Prefix - Leet Code Solution

Problem Statement Write a function to find the longest common prefix string amongst an array of strings.

Integer to Roman conversion - Leet Code Solution

Problem Statement Roman numerals are represented by seven different symbols: I, V, X, L, C, D and M. Symbol Value...

Container with Most Water - Leet Code Solution

Problem Statement Given n non-negative integers a1, a2, …, an , where each represents a point at coordinate (i, ai)....

Check whether an integer number given is palindrome or not - Leet Code Solution

Problem Statement Determine whether an integer is a palindrome. An integer is a palindrome when it reads the same backward...

Remove nth Node from Last - Leet Code Solution

Problem Statement Given a linked list, remove the n-th node from the end of list and return its head.

How to prepare for your next Coding Interview

Here are some tips while preparing for your coding interviews.

How to calculate angle between hour and minute hand, given a time

This problem is a simple mathematical calculation. Lets start deriving some equations. Note: Here we are talking about the round...

Convert String to Integer - atoi - Leet Code Solution

Problem Statement Implement atoi which converts a string to an integer. ``` Example 1: Input: “42” Output: 42

Check whether number is palindrome or not - Leet Code Solution

Problem Statement Determine whether an integer is a palindrome. An integer is a palindrome when it reads the same backward...

Zigzag Pattern String Conversion - Leet Code Solution

Problem Statement The string “PAYPALISHIRING” is written in a zigzag pattern on a given number of rows like this: (you...

Reverse digits of a signed integer - Leet Code Solution

Problem Statement Given a signed integer, reverse digits of an integer.

Longest Palindrome Substring - Leet Code Solution

Problem Statement Given a string s, find the longest palindromic substring in s. You may assume that the maximum length...

Find the Median of Two Sorted Arrays - Leet Code Solution

Problem Statement There are two sorted arrays nums1 and nums2 of size m and n respectively. Find the median of...

Longest Substring without repeating characters - Leet Code Solution

Problem Statement Given a string, find the length of the longest substring without repeating characters.

Add two numbers(reverse order) link list Problem - Leet Code Solution

Problem Statement You are given two non-empty linked lists representing two non-negative integers. The digits are stored in reverse order...

Radix Sort Algorithm

A number consists of digits. Example: 843. Its a 3-digit number. Radix sort, start by sorting numbers first by their...

Counting Sort Algorithm

Counting sort runs on relatively smaller set of input. Counting sort calculates, for every element in array - X, the...

Young Tableau problem - Cormen

Young Tableau A a X b matrix is Young Tableau if all rows(from left to right) and columns(from top to...

Min Priority Queue Implementation with Heap Data structure

Min Priority Queue is a data structure which manage a list of keys(values). And, gives priority to element with minimum...

Max Priority Queue Implementation with Heap Data structure

Max Priority Queue is a data structure which manage a list of keys(values). And, gives priority to element with maximum...

Two Sum Problem - Leet Code Solution

Problem Statement Given an array of integers, return indices of the two numbers such that they add up to a...

Heap Sort Algorithm

This is another very useful sorting algorithm based on Heap data structure. Read more about Heap Data Structure

What is Heap Data Structure

Its a tree based data structure which is a complete binary tree(all nodes have 2 nodes, leaf-child may not have...

Index for Coding Problems

Sorting Problems Merge Sort Quick Sort Heap Sort Bubble Sort Selection Sort Insertion Sort Count Sort Radix Sort

How to nail your Coding Interview

Here are some tips while giving your coding interviews.

Maximum Subarray Problem

Problem Statement You are given an array of integers. And, you have find the range of indexes or sub-array from...

Quick Sort Algorithm

This algorithm is very useful for large input. And, is quite efficient one. It has several implementation, and it is...

Counting Inversions Coding Problem

** Inversion There is an array(a) and two indexes i and j. Inversion is the element for whom i <...

Merge Sort Algorithm

This algorithm is very efficient one, and is classic example of Divide and Conquer algorithms.

Bubble Sort Algorithm

This is kind of preliminary technique of sorting. And, this is the first algorithm that a beginner learns.

Coding Interview - Useful Terms Cheatsheet

Big-O notation In simpler terms, its kind of a unit to measure how efficient an algorithm is, with respect to...

Selection Sort Algorithm

It is one of a simple algorithm to study for a beginner to understanding sorting algorithms.

Insertion Sort Algorithm

Its a kind of incremental insertion technique, where the algorithm build up sorting by first sorting n-1 items.

List of Sorting Algorithms

This topic is one of the most common studied. When somebody started preparation of coding interviews. Sorting algorithms would in...

Coding Interview Cheatsheet

Absolute Must Have Below are must have topics that you must know: Algorithms Data Structures Concepts Breadth First Search (BFS)...