In this page I have listed all the coding questions that have been solved in this website.
Question 1: Given an array of integers in ascending order, return index of the two numbers such that they add up to a specific key provided.
Question 2: Given two non empty Linked List with non negative numbers, and numbers are stored in reverse order having single digit. Add the two list and return the result as a linked list.
Question 3: Count the number of ways a baby can reach the nth stair taking 1 or 2 steps at a time in C language.
Question 4: Sort an array of 0s, 1s and 2s in C
Question 5: Given an array, the difference between the elements is one, find if the “key” element is present or not.
Question 6: Given an unsorted array, find the minimum difference between 2 elements.
Question 7: Given an unsorted array, find the least difference between the element pairs. Display all the pairs present.
Question 8: Given an unsorted array, and a key. Find 2 elements such that the difference between the elements is equal to the key.
Question 9: Given an unsorted integer array, find the smallest missing positive integer.
Question 10: Given an array, find all the repeated elements in C language
Question 11: Given an integer value, convert it into roman number.
Question 12: Given a string, and number of rows, write the string in zigzag pattern.
Question 13: Given a string find the longest Palindromic Substring with detailed explanation and solution in C++.
Question 14: Given an input string (s) and a pattern (p), implement regular expression matching with support for ‘.’ and ‘*’.
Question 15: Find the Container with Most Water explanation with diagram and solution in cpp language
Question 16: Given an array of non repeating numbers and a key, find all the unique combinations in that array, where the sum of those combination is equal to the key.
Question 17: Given an array, find 3 elements such that [a + b + c] = 0. Find all the 3 unique elements.
Question 18: Given an array of n integers and an integer “key”, find three integers in the array such that the sum is closest to key.
Question 19: Given an array n integers and an integer key, are there four elements a, b, c, and d in the array such that a + b + c + d = key? Find all unique quadruplets in the array which gives the sum of key.
Question 20: Given a linked list Remove Nth Node From End of List
Question 21: Letter Combinations of a Phone Number, solution in C++
Question 22: You are given with n pairs of parentheses, generate all combinations of well-formed parentheses.
Question 23: Merge two sorted linked lists and return it as a new list in C
Question 24: Given linked list swap Nodes in Pairs, solution in C++
Question 25: Divide two integers without using multiplication, division and mod operator
Question 26: Implement next permutation, which rearranges numbers into the next greater permutation of numbers.
Question 27: Given an array sorted in ascending order and is rotated at some pivot, given a target value to search, if found in the array return its index
Question 28: Merge k sorted linked lists and return it as one sorted list in C++
Question 29: Given a collection of candidate numbers and a key, find all unique combinations in candidates where the candidate numbers sums to target
Question 30: Given a collection of distinct integers, return all possible permutations C++ solution
Question 31: Given two non-negative integers num1 and num2 represented as strings, return the product of num1 and num2, also represented as a string
Question 32: Given a collection of numbers that might contain duplicates, return all possible unique permutations in C++
Question 33: Given an n x n 2D matrix rotate it by 90 degrees (clockwise) in C++ in place
Question 34: Group Anagrams when given an array of strings in C++
Question 35: Rain water trapping in C++
Question 36: Implement pow(x, n), which calculates x raised to the power n (x^n) in C++
Question 37: Given a matrix of m x n elements , print all elements of the matrix in spiral order in CPP
Question 38: Given an array of non-negative integers determine if you are able to reach the last index in C++
Question 39: Merge overlapping Intervals solution in C++
Question 40: Reverse Linked List iterative and recursive in C++
Question 41: Given a positive integer n, generate a square matrix filled with elements from 1 to n^2 in spiral order in C++
Question 42: Wildcard Matching in C++
Question 43: Find Intersection of Two Linked Lists in c++
Question 44: Rotate linked list by k nodes in C++
Question 45: Find path from top right to bottom left with Solution in C++
Question 46: Find path from top right to bottom left with obstacles in C++
Question 47: Minimum Cost Path in CPP
Question 48: Given an absolute path for a file (linux-style), simplify it CPP
Question 49: Reach the end of the array with minimum jumps. Solution in C++
Question 50: Given a m x n matrix, if an element is 0, set its entire row and column to 0. Do it in-place in CPP
Question 51: Given a 2D Matrix and a key element, search and return if element is present or not in C++
Question 52: Given an array with element colored red, white or blue, sort them in-place, with the colors in the order red, white and blue in CPP
Question 53: Given two integers n and k, return all possible combinations of k numbers out of 1 … n in CPP
Question 54: Given a set of distinct integers, nums, return all possible subsets in CPP
Question 55: Given 2D matrix and a word, find if the word exists in the grid in C++
Question 56: N-Queens in CPP
Question 57: Given a sorted array, remove duplicate elements in-place in CPP
Question 58: you are given an sorted array with repeated elements that is rotated at some point, return true or false if you find the key element in C++
Question 59: Given a linked list with duplicates, remove the nodes with duplicates and keep only distinct numbers, with solution in CPP
Question 60: You are given a linked list and a key “x”, partition the list in such a way that, all the nodes less than “x” comes before the nodes greater than or equal to “x” solution in CPP
Question 61: You are given a positive number “n”, print the sequence of grey code solution in CPP
Question 62: Given array of integers that might contain duplicates, return all the subsets. Solution in CPP
Question 63: Check if a given string is a valid number in CPP
Question 64: you are given a string having digits, convert into the string by looking at the table given below, solution in C++
Question 65: Reverse Linked List given 2 points m and n, solution in CPP
Question 66: Given a string of integers, restore all valid IP addresses solution in C++
Question 67: Given an array of non overlapping integers, insert a new interval by merging them, solution in C++
Question 68: Given a positive integer, generate pascal triangle, solution in C++
Question 69: Given a positive number “k” return the row of that index of pascals triangle, solution in C++
Question 70: Check if the given board is valid Sudoku or not, explanation with solution in C++
Question 71: Find minimum path from top to bottom in a triangle solution with explanation in C++
Question 72: Optimum Time to Buy and Sell Stock for maximum profit explanation with solution in C++
Question 73: Word Ladder explanation with solution in CPP
Question 74: Given a non-empty array, all the elements appears twice except for one, find that element.
Question 75: Given a string return all the substring that is a palindrome, solution in CPP
Question 76: Given a 2D board with X and O, get all the region surrounded by X, explanation in CPP
Question 77: Check if there is a gas stations along a circular route, solution with explanation in CPP
Question 78: Solve Sudoku, explanation in CPP
Question 79: Given an array every element appears three times except for one. Find that single one. Solution in C++
Question 80: Given a linked list such that each node contains an additional random pointer which could point to any node in the list or null. Return the deep copy of the list, solution in C++
Question 81: Given a string s and a dictionary wordDict containing a list of non-empty words, determine if s can be seperated into a space-separated sequence of one or more dictionary words. Solution in C++
Question 82: Given a linked list, check if it has a cycle in it, solution in C++
Question 83: Given a linked list, if it has a cycle, get the node where the cycle begins else return NULL.
Question 84: Given a sentence and maxWidth. Arrange the text in such a way that each line has exactly maxWidth characters, solution in C++
Question 85: Reorder list in to alternate nodes like first lowest and first highest. Solution in C++
Question 86: Given a linked list, sort the list using insertion sort. Solution with explanation
Question 87: Create a data structure for n elements and constant operations
Question 88: Given an array and a number n, rotate the array by n steps to its right solution in C++
Question 89: Given a string, reverse all the vowels in the string , solution in C++
Question 90: Given an array, check if it has any duplicate elements, 2 solutions in CPP
Question 91: Given a sorted array, find the starting and ending index that matches the target – 2 solutions using C++
Question 92: Given an array that is sorted and a target, if the target is found, return the index. If not found, return the index where it would be if it were inserted, 2 solutions in C++
Question 93: Given an array, find the continuous sub array that has the largest sum, return the sum. 2 solutions in C++
Question 94: 1’s and 2’s complement of a Binary Number
Question 95: Add and subtract 2 numbers using bitwise operators. C++ Solution
Question 96: Calculate the square of a number and also check if that number is even or odd using bitwise operator.
Question 97: Check if the number has bits in alternate pattern and also check if the same number has equal number of set and unset bits using bitwise operators.
Question 98: Given 2 numbers check if one number is complement of another and also check if those two numbers are same using bitwise operators.
Question 99: Perform below operations using Bitwise Operators
Question 100: Perform below swapping operations using Bitwise operators
Question 101: Perform multiplication operation using Bitwise operators
Question 102: Perform binary search on a singly linked list, solution in C++
Question 103: Perform bubble sort on singly linked list, solution in C++
Question 104: Perform below operations on Circular Singly Linked List, solution in C++
Question 105: Perform below delete operations from single linked list, solution in C++
Question 106: Perform below delete operations from single linked list, solution in C++
Question 107: Given an unsorted linked list, sort the list using merge sort, solution in C++
Question 108: Given an expression in reverse polish notation, evaluate it and get the output in C++
Question 109: You are given a sentence, reverse the string word by word in C++
Question 110: Given an integer array, find the maximum product made from continuous elements in that array. Solution in C++
Question 111: Find the minimum element from an array that is sorted and is rotated, solution in C++
Question 112: Given an array, find the majority element, solution in C++
Question 113: Given 2 strings, check if they are isomorphic strings, solution in C++
Question 114: Given an array and a key element, find the number of continuous elements whose sum is greater than the key element, solution in C++
Question 115: Dynamic Programming: Longest Increasing Subsequence
Question 116: Dynamic Programming: Longest Bitonic Subsequence
Question 117: Dynamic Programming: Get Max Coin In Game problem.
Question 118: Dynamic Programming: Rod Cutting Problem
Question 119: Dynamic Programming: Box Stacking Problem
Question 120: Dynamic Programming: Building Bridges
Question 121: Dynamic Programming: Egg Dropping Problem
Question 122: Dynamic Programming: Min Edit Distance
Question 123: Bottom view of binary Tree
Question 124: Boundary Traversal of Binary Tree
Question 125: Top view of a binary tree
Question 126: Left view and right view of a Binary Tree
Question 127: Level Order Traversal
Question 128: Vertical Order Traversal
Question 129: Height or Max depth of a BTree
Question 130: Spiral order or Zigzag traversal of a Binary Tree
Question 131: Diameter of a Binary Tree
Question 132: Lowest Common ancestor of a Binary Tree.
Question 133: Check if 2 nodes are mirror of each other
Question 134: Check if two binary tree are identical
Question 135: Check if binary tree is a sum tree
Question 136: Add all the node values in a Binary Tree or Sum of a Binary tree
Question 137: Print the number of leaf nodes in a binary tree
Question 138: Print all the paths from root node to leaf node
Question 139: Print the nodes at k distance from the root of a binary tree
Question 140: Reverse Bits
Question 141: Count the number of set bits
Question 142: Power of 2
Question 143: Missing Number
Question 144: Counting set bits in a number
Question 145: Hamming Distance
Question 146: Bitwise and of number range