ProDeveloperTutorial.com

Tutorials and Programming Solutions
Menu
  • Shell Scripting
  • System Design
  • Linux System Programming
  • 4g LTE
  • Coding questions
  • C
  • C++
  • DSA
  • GIT
  • 450 DSA Cracker
  • 5G NR
  • O-RAN

Guide to Most Frequently asked Coding Interview questions

In this page I have shared all the questions divided by problem types

Array Related Questions:

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: Sort an array of 0s, 1s and 2s in C

 

Question 3: Given an array, the difference between the elements is one, find if the “key” element is present or not.

 

Question 4: Given an unsorted array, find the minimum difference between 2 elements.

 

Question 5: Given an unsorted array, find the least difference between the element pairs. Display all the pairs present.

 

Question 6: Given an unsorted array, and a key. Find 2 elements such that the difference between the elements is equal to the key.

Question 7: Given an unsorted integer array, find the smallest missing positive integer.

 

Question 8: Given an array, find all the repeated elements in C language

 

Question 9: 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 10: Given an array, find 3 elements such that [a + b + c] = 0. Find all the 3 unique elements.

 

Question 11: 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 12: 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 13: 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 14: Given a collection of distinct integers, return all possible permutations C++ solution

 

Question 15: Given a collection of numbers that might contain duplicates, return all possible unique permutations in C++

 

Question 16: Given an array of non-negative integers determine if you are able to reach the last index in C++

 

Question 17: Merge overlapping Intervals solution in C++

 

Question 18: Reach the end of the array with minimum jumps. Solution in C++

 

Question 19: 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 20: Given a set of distinct integers, nums, return all possible subsets in CPP

 

Question 21: Given a sorted array, remove duplicate elements in-place in CPP

 

Question 22: 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 23: Given array of integers that might contain duplicates, return all the subsets. Solution in CPP

 

Question 24: Given an array of non overlapping integers, insert a new interval by merging them, solution in C++

 

Question 25: Given a positive integer, generate pascal triangle, solution in C++

 

Question 26: Given a positive number “k” return the row of that index of pascals triangle, solution in C++

Question 27: Given an array and a number n, rotate the array by n steps to its right solution in C++

 

Question 28: Given an array, check if it has any duplicate elements, 2 solutions in CPP

Question 29: Given a sorted array, find the starting and ending index that matches the target – 2 solutions using C++

Question 30: 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 31: Given an array, find the continuous sub array that has the largest sum, return the sum. 2 solutions in C++

Question 32: Given an integer array, find the maximum product made from continuous elements in that array. Solution in C++

Question 33: Given an array, find the majority element, solution in C++

 

 

 

Matrix Related Questions:

Question 1: Given an n x n 2D matrix rotate it by 90 degrees (clockwise) in C++ in place

 

Question 2: Given a matrix of m x n elements , print all elements of the matrix in spiral order in CPP

 

Question 3: Given a positive integer n, generate a square matrix filled with elements from 1 to n^2 in spiral order in C++

 

Question 4: Find path from top right to bottom left with Solution in C++

 

Question 5: Find path from top right to bottom left with obstacles in C++

 

Question 6: Minimum Cost Path in CPP

 

Question 7: 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 8: Given a 2D Matrix and a key element, search and return if element is present or not in C++

 

Question 9: Given 2D matrix and a word, find if the word exists in the grid in C++

 

Question 10: Check if the given board is valid Sudoku or not, explanation with solution in C++

 

Question 11: Find minimum path from top to bottom in a triangle solution with explanation in C++

 

Question 12: Given a 2D board with X and O, get all the region surrounded by X, explanation in CPP

Linked List Related Questions:

Question 1: 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 2: Given linked list swap Nodes in Pairs, solution in C++

 

Question 3: Given a linked list Remove Nth Node From End of List

 

Question 4: Merge two sorted linked lists and return it as a new list in C

 

Question 5: Merge k sorted linked lists and return it as one sorted list in C++

 

Question 6: Reverse Linked List iterative and recursive in C++

 

Question 7: Find Intersection of Two Linked Lists in c++

 

Question 8: Rotate linked list by k nodes in C++

 

Question 9: Given a linked list with duplicates, remove the nodes with duplicates and keep only distinct numbers, with solution in CPP

 

Question 10: 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 11: Reverse Linked List given 2 points m and n, solution in CPP

Question 12: 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 13: Given a linked list, check if it has a cycle in it, solution in C++

Question 14: Given a linked list, if it has a cycle, get the node where the cycle begins else return NULL.

Question 15: Reorder list in to alternate nodes like first lowest and first highest. Solution in C++

Question 16: Given a linked list, sort the list using insertion sort. Solution with explanation

Question 17: Perform binary search on a singly linked list, solution in C++

Question 18: Perform bubble sort on singly linked list, solution in C++

Question 19: Perform below operations on Circular Singly Linked List, solution in C++

Question 20: Perform below delete operations from single linked list, solution in C++

Question 21: Perform below delete operations from single linked list, solution in C++

Question 22: Given an unsorted linked list, sort the list using merge sort, solution in C++

Strings Related Questions:

Question 1: Given a string, and number of rows, write the string in zigzag pattern.

 

Question 2: Given an integer value, convert it into roman number.

 

Question 3: Given a string find the longest Palindromic Substring with detailed explanation and solution in C++.

 

Question 4: Given an input string (s) and a pattern (p), implement regular expression matching with support for ‘.’ and ‘*’.

 

Question 5: Letter Combinations of a Phone Number, solution in C++

 

Question 6: You are given with n pairs of parentheses, generate all combinations of well-formed parentheses.

 

Question 7: Given two non-negative integers num1 and num2 represented as strings, return the product of num1 and num2, also represented as a string

 

Question 8: Group Anagrams when given an array of strings in C++

 

Question 9: Given an absolute path for a file (linux-style), simplify it CPP

 

Question 10: Check if a given string is a valid number in CPP

 

Question 11: you are given a string having digits, convert into the string by looking at the table given below, solution in C++

 

Question 12: Given a string of integers, restore all valid IP addresses solution in C++

 

Question 13: Given a string return all the substring that is a palindrome, solution in CPP

Question 14: 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 15: Given a sentence and maxWidth. Arrange the text in such a way that each line has exactly maxWidth characters, solution in C++

Question 16: Given a string, reverse all the vowels in the string , solution in C++

Question 17: You are given a sentence, reverse the string word by word in C++

Question 18: Given 2 strings, check if they are isomorphic strings, solution in C++

 

 

 

Two Pointers Related Questions:

 

Question 1: Find the Container with Most Water explanation with diagram and solution in cpp language

 

Question 2: Rain water trapping in C++

Question 3: Find the minimum element from an array that is sorted and is rotated, solution in C++

Question 4: Given an array and a key element, find the number of continuous elements whose sum is greater than the key element, solution in C++

Backtracking Related Questions:

Question 1: Letter Combinations of a Phone Number, solution in C++

 

Question 2: Given two integers n and k, return all possible combinations of k numbers out of 1 … n in CPP

 

Question 3: N-Queens in CPP

Recursion and Dynamic Programming Related Questions:

 

Question 1: You are given with n pairs of parentheses, generate all combinations of well-formed parentheses.

 

Question 2: Implement pow(x, n), which calculates x raised to the power n (x^n) in C++

 

Question 3: Wildcard Matching in C++

Bitwise Operations Related Questions:

Question 1: Divide two integers without using multiplication, division and mod operator

Question 2: You are given a positive number “n”, print the sequence of grey code solution in CPP

Question 3: Given a non-empty array, all the elements appears twice except for one, find that element.

Question 4: Given an array every element appears three times except for one. Find that single one. Solution in C++

Question 5: 1’s and 2’s complement of a Binary Number

Question 6: Add and subtract 2 numbers using bitwise operators. C++ Solution

Question 7: 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 8: Given 2 numbers check if one number is complement of another and also check if those two numbers are same using bitwise operators.

Question 9: Perform below operations using Bitwise Operators

Question 10: Perform below swapping operations using Bitwise operators

Question 11: Perform multiplication operation using Bitwise operators

 

 

DFS/BFS Related Questions:

Question 1: Given a collection of candidate numbers and a key, find all unique combinations in candidates where the candidate numbers sums to target

 

Question 2: Word Ladder explanation with solution in CPP

 

Question 3: Given a string return all the substring that is a palindrome, solution in CPP

 

Question 4: Given a 2D board with X and O, get all the region surrounded by X, explanation in CPP

 

Question 5: Solve Sudoku, explanation in CPP

MISC Related Questions:

Question 1: Count the number of ways a baby can reach the nth stair taking 1 or 2 steps at a time in C language.

 

Question 2: Implement next permutation, which rearranges numbers into the next greater permutation of numbers.

 

Question 3: Optimum Time to Buy and Sell Stock for maximum profit explanation with solution in C++

 

Question 4: Check if there is a gas stations along a circular route, solution with explanation in CPP

Question 5: Create a data structure for n elements and constant operations

Question 6: Given an expression in reverse polish notation, evaluate it and get the output in C++

 

 

 

Share
Email
Tweet
Linkedin
Reddit
Stumble
Pinterest

ProDeveloperTutorial.com

Tutorials and Programming Solutions
Copyright © 2023 ProDeveloperTutorial.com
We use cookies on our website to give you the most relevant experience by remembering your preferences and repeat visits. By clicking “Accept”, you consent to the use of ALL the cookies.
Do not sell my personal information.
Cookie SettingsAccept
Manage consent

Privacy Overview

This website uses cookies to improve your experience while you navigate through the website. Out of these, the cookies that are categorized as necessary are stored on your browser as they are essential for the working of basic functionalities of the website. We also use third-party cookies that help us analyze and understand how you use this website. These cookies will be stored in your browser only with your consent. You also have the option to opt-out of these cookies. But opting out of some of these cookies may affect your browsing experience.
Necessary
Always Enabled
Necessary cookies are absolutely essential for the website to function properly. These cookies ensure basic functionalities and security features of the website, anonymously.
CookieDurationDescription
cookielawinfo-checkbox-analytics11 monthsThis cookie is set by GDPR Cookie Consent plugin. The cookie is used to store the user consent for the cookies in the category "Analytics".
cookielawinfo-checkbox-functional11 monthsThe cookie is set by GDPR cookie consent to record the user consent for the cookies in the category "Functional".
cookielawinfo-checkbox-necessary11 monthsThis cookie is set by GDPR Cookie Consent plugin. The cookies is used to store the user consent for the cookies in the category "Necessary".
cookielawinfo-checkbox-others11 monthsThis cookie is set by GDPR Cookie Consent plugin. The cookie is used to store the user consent for the cookies in the category "Other.
cookielawinfo-checkbox-performance11 monthsThis cookie is set by GDPR Cookie Consent plugin. The cookie is used to store the user consent for the cookies in the category "Performance".
viewed_cookie_policy11 monthsThe cookie is set by the GDPR Cookie Consent plugin and is used to store whether or not user has consented to the use of cookies. It does not store any personal data.
Functional
Functional cookies help to perform certain functionalities like sharing the content of the website on social media platforms, collect feedbacks, and other third-party features.
Performance
Performance cookies are used to understand and analyze the key performance indexes of the website which helps in delivering a better user experience for the visitors.
Analytics
Analytical cookies are used to understand how visitors interact with the website. These cookies help provide information on metrics the number of visitors, bounce rate, traffic source, etc.
Advertisement
Advertisement cookies are used to provide visitors with relevant ads and marketing campaigns. These cookies track visitors across websites and collect information to provide customized ads.
Others
Other uncategorized cookies are those that are being analyzed and have not been classified into a category as yet.
SAVE & ACCEPT