Practice for Cracking Any Coding InterviewReadDiscussCoursesPracticeImprove Article ImproveSave Article SaveLike Article LikeCoding questions in this article are difficulty wise ordered. The idea of this post is to target two types of people.Competitive Programming Preparation (For Ist and IInd Year Students) : It is recommended to finish all questions from all categories except possibly Linked List, Tree and BST. However at least 10 questions from these categories should also be covered. If you have never done competitive programming before, it is strongly recommended to see How to Begin with Competitive Programming first. If you wish to get yourself prepared with a language first, you may first begin C++ Track or Java TrackInterview preparation It is recommended to cover all topics. In every topic, you can start from questions according to your comfort level.Cracking Any Coding InterviewsThe practice system tells you exactly the test case where your code failed. In case you need more clarity about a question, you may use the expected output button to see output for your given input. You can also view successful submissions of others in case you are stuck. To see solutions of others, please click the “All Submissions” button at the bottom of the problem statement.TopicsMathematicalPuzzlesArraysStringSearchingSortingHashingMatrixRecursionDivide & ConquerLinked ListDoubly and Circular Linked ListsStackQueuePrefix Sum and Sliding WindowBit MagicTreeBinary Search TreeHeapGraphGreedy AlgorithmsDynamic ProgrammingBacktrackingTrieMisc TopicsImportant Links Complete Interview PreparationGet fulfilled all your interview preparation and coding practice needs at a single place with the Complete Interview Preparation Course that provides you all the required stuff to prepare for any product-based, service-based, or start-up company at the most affordable prices. Practice 200+ coding interview questions with the help of this course and get yourself interview prepared for your dream company.MathematicalPrint the pattern (You only need to write function here)Print table (This is a full code problem. Please see sample codes here before attempting the problem)Series APSeries GPClosest NumberArmstrong NumbersSum of digits of a numberReverse digitsPrint the Kth DigitBinary number to decimal numberJumping NumbersGCD of two numbersLCM of two numbersAdd two fractionsGCD of arrayFactorial of a numberCompute nPrCompute nCrLargest prime factorPerfect NumbersPair cube countFind Nth root of MPrime NumberSieve of EratosthenesSum of all prime numbers between 1 and N.Pairs of prime numbersRelated Learning Resources : Mathematical Algorithms and Number Theory PuzzlesCount Squares3 DivisorsCheck if four points form a squareCheck for powerOverlapping rectanglesTrailing zeroes in factorialAngle between hour and minute handNumber Of Open DoorsTriangular NumbersNth Even Fibonacci NumberLast two digit FibonacciSquares in a MatrixDay of the weekRelated Learning Resources : Puzzles ArraysArray operations (Search, insert, delete)Array alternate printingMaximum and minimum in an arraySecond largest in arraySum of array elementsReverse an ArrayRotate ArrayCount of smaller elementsRemove duplicate elements from sorted ArrayCount possible trianglesLeaders in an arrayMinimum distance between two numbersSorted subsequence of size 3Maximum Sub ArrayMajority ElementWave ArrayMaximum IndexMax sum path in two arraysProduct array puzzleFind duplicates in a small ranged arrayFind Missing And RepeatingStock buy and sellTrapping Rain WaterPair with given sum in a sorted arrayChocolate Distribution ProblemLongest Consecutive subsequenceThree way partitioningRelated Learning Resources : Array Data StructureStringCheck for palindromeCheck for anagramAnagram PalindromeTitle case conversionSort the stringMerge two stringsSave IronmanGood or Bad stringURLify a given stringExtract MaximumReverse words in a given stringImplement strstrCheck for subsequenceCheck for rotationCheck if two strings are k-anagramsUncommon charactersAnagram SearchFirst repeating characterFirst non-repeating characterLongest Distinct characters in stringLongest Palindromic SubstringFind k-th character in stringSmallest window in a string containing all characters of another stringAdd Binary StringsMultiply two StringsNearest multiple of 10Related Learning Resources : String Data StructureSearchingLinear SearchFacing the sunMagnet Array ProblemBinary SearchFloor in a Sorted ArrayCount occurrences in a sorted arraySearch in a sorted and rotatedFind the missing numberMissing element of APSquare root of a numberFind Transition Point in a Sorted Binary ArrayLast index of OnePeak elementAllocate minimum number of pagesCommon elements in three sortedSmallest Positive missing numberRelated Learning Resources : Searching Algorithms SortingCheck if array is sortedSort a binary arraySort an array of 0s, 1s and 2sBubble SortInsertion SortSelection SortQuick SortMerge SortSort an array when two halves are sortedRelative SortingTriplet Sum in ArrayMinimum Swaps to SortSorting elements by frequencyTriplet FamilyCount the tripletsRelated Learning Resources : Sorting AlgorithmsHashingCount distinct elementsArray Subset of another arrayNuts and Bolts ProblemCount frequencies of elementsCheck if two arrays are equal or notFirst element to occur k timesIn First But SecondNon-Repeating ElementGroup Anagrams TogetherWinner of an electionCheck for a pair with given sumCount distinct pairs with difference kCount pairs with given sumFind all four sum numbersA Simple FractionLargest Fibonacci SubsequenceRelated Learning Resources : Hashing Data Structure MatrixTranspose of MatrixPrint Matrix in snake PatternPrint a given matrix in spiral formIs Sudoku ValidCount zeros in a sorted matrixSquares in a MatrixA Boolean Matrix QuestionSearch in row-wise and column-wise sortedFind the row with maximum number of 1sCount pairs Sum in matricesMedian In a Row-Wise sorted MatrixRelated Learning Resources : Matrix Data StructureRecursionPrint PatternHandshakesTower of HanoiJosephus problemRecursively remove all adjacent duplicatesPossible words from Phone digitsFlood fill AlgorithmPermutations of a stringRelated Learning Resources : Recursion Divide & ConquerWrite your own power functionProgram for n-th Fibonacci NumberK-th element of two sorted ArraysMedian of two sorted arraysKaratsuba AlgorithmThe Painter’s Partition ProblemConvex HullCounting inversionsRelated Learning Resources : Divide and Conquer AlgorithmsLinked ListPrint a Linked ListLength of a linked listNode at a given index in linked listMiddle of a linked listn-th node from end of a linked listDelete a nodeRemove every k’th nodeDelete N nodes after M nodes of a linked listDelete without head pointerRearrange a linked listSegregate even and odd (Using only one traversal)Reorder ListPolynomial AdditionInsert in a Sorted ListSwap nodes in pairsReverse a linked listReverse a Linked List in groups of given size.Check for palindromeFlattening a linked listGet intersection pointRemove duplicates from sorted listRemove duplicates from unsorted listsSort a linked list of 0s, 1s and 2s.Circular Linked ListDetect loop in a linked listFind length of LoopRemove loop in a linked listAdd two numbers represented by linked listsClone a linked list with random pointersAdd 1 to a number represented as linked listAdd two numbers represented as linked listMultiply two linked listsMerge two sorted linked listsMerge Sort on Linked ListIntersection of Two Linked ListsUnion of Two Linked ListsRelated Learning Resources : Linked List Data StructureDoubly and Circular Linked ListsInsert a node in Doubly linked listDelete node in Doubly Linked ListCircular Linked List TraversalSplit a Circular Linked List into two halvesInsert in Sorted way in a Sorted DLLQuickSort on Doubly Linked ListMerge Sort on Doubly Linked ListRotate doubly Linked List by P nodesXOR Linked ListRelated Learning Resources : Doubly Linked List and Circular Linked List. StackImplement Stack using ArrayImplement Stack using Linked ListCheck for balanced parenthesisReverse a stackImplement two stacks in an arrayDesign a stack with getMinThe celebrity problemStock Span ProblemNext Greater ElementNext Smaller ElementLongest valid ParenthesesRelated Learning Resources : Stack Data StructureQueue and DequeueImplement Queue using Linked ListImplement Queue using ArrayImplement Stack using QueueImplement Queue using StackReversing a QueueCircular tourFirst non-repeating character in a streamRelated Learning Resources : Queue Data Structure Prefix Sum and Sliding WindowEquilibrium PointCheck if there is a subarray with 0 sunLongest Sub-Array with Sum KLongest subarray with sum divisible by KLargest subarray with equal 1s and 0sLongest common span with same number of 1s and 0s among two arraysFind mximum sum in any subarray of size kCount distinct elements in every window of size kCheck for subarray with given sumRelated Learning Resources : Prefix Sum and Sliding WindowBit MagicCheck if a number is even or odd.Number of bit flipsGame of XORFind bit at a positionSwap odd and even bitsPower of 2Odd occurring elementMissing number in arrayIndex Of an Extra ElementReverse BitsCount set bitsPower SetRelated Learning Resources : Bit MagicTreeInorder TraversalPreorder TraversalPostorder TraversalLevel order traversalFind height of Binary TreeCount Leaves in Binary TreeCheck for Children Sum PropertyMirror TreeCheck for Balanced TreeLowest Common Ancestor in a Binary TreeDiameter of Binary TreeLeft View of Binary TreeRight View of Binary TreeMaximum path sumLevel order traversal line by lineTree from Postorder and InorderTree from Preorder and InorderConnect Nodes at Same LevelZig-Zag level order traversalSerialize and Deserialize a Binary TreeLeaves to DLLBinary Tree to Doubly Linked ListBinary Tree to Circular Doubly Linked ListRelated Learning Resources : Tree Data StructureBinary Search TreeBST SearchBST InsertBST DeleteMinimum in BSTInorder Traversal and BSTCount BST nodes that lie in a given rangeAdd all greater valuesPredecessor and Successor in BSTClosest Neighbor in BSTLowest Common Ancestor in a BSTConvert Level Order Traversal to BSTNormal BST to Balanced BSTPair with given sum in BSTCheck for BSTCorrect BST with two nodes swappedMedian of BSTk-th smallest element in BSTUnique BST’sArray to BSTPreorder Traversal and BSTPreorder to PostorderLeaf nodes from preorder traversalTriplet with 0 sum in BSTMerge two BST ‘sLargest BST SubtreeRelated Learning Resources : Binary Search TreeHeapBinary Heap OperationsHeight of HeapHeap SortSort a Nearly Sorted ArrayK Largest ElementsK-th largest element in a streamMedian of streamMerge k sorted arraysRelated Learning Resources : Heap Data Structure GraphPrint adjacency listBreadth First SearchDepth First SearchFind whether path existKnight WalkSnake and Ladder ProblemBipartite GraphDetect Cycle in an undirected graphDetect Cycle in a directed graphFind first n numbers with given set of digitsRotten orangesTopological sortShortest Source to Destination PathTransitive closure of a GraphStrongly Connected ComponentsRelated Learning Resources : Graph Data Structure Greedy AlgorithmsFractional KnapsackLargest number with given sumActivity SelectionN meetings in one roomMinimum PlatformsMinimum number of CoinsJob Sequencing ProblemMinimize the heightsHuffman CodingHuffman DecodingMinimum Spanning TreeDijkstra for Adjacency MatrixRelated Learning Resources : Greedy AlgorithmsDynamic ProgrammingPrint first n Fibonacci Numbers.Count ways to reach the n’th stairCutted SegmentsKadane’s AlgorithmStickler ThiefMinimum number of jumpsTotal Decoding MessagesMin Cost PathCoin ChangeLongest Common SubsequenceConsecutive 1’s not allowedEdit DistanceRod CuttingWater OverflowMaximum Tip CalculatorLongest Increasing SubsequenceMaximum sum increasing subsequenceMax length chain0 – 1 Knapsack ProblemInterleaved stringLongest Palindromic SubsequenceWildcard Pattern MatchingBox StackingLongest Bitonic subsequenceMinimum sum partitionLargest square formed in a matrixWord BreakMatrix Chain MultiplicationSpecial KeyboardEgg Dropping PuzzleOptimal Strategy for a GameRelated Learning Resources : Dynamic ProgrammingBacktrackingRat Maze With Multiple JumpsCoins and GameHamiltonian PathSolve the SudokuCombination Sum – Part 2Combination SumSubsetsLargest number in K swapsM-Coloring ProblemBlack and WhiteRelated Learning Resources : BacktrackingTrieTrie Search and InsertTrie DeleteUnique rows in a binary matrixCount of distinct substringsWord BoggleRelated Learning Resources : Trie Data Structure Misc Questions to test your overall learningLongest common prefixImplement AtoiTwo numbers with sum closest to zeroSmallest greater elements in whole arrayMax rectangleFind triplets with zero sumCounting elements in two arraysMerge K sorted linked listsMaximum DifferenceCircle of stringsAll possible Word BreaksAlien DictionaryDesign a tiny URL or URL shortenerImplement LRU Cache Important LinksSudo Placement : For companies like Amazon, Microsoft, Adobe, .., etcSudo Placement 2 : For companies like TCS, Infosys, Wipro, Cognizant, .. etcAptitude questions asked in round 1 : Placements Course designed for this purpose.MCQs asked from different computer science subjects : Subject-Wise QuizzesInterview theory and coding questions of all companies : Company wise all practice questions.Interview experiences of all companies : Interview corner.Must Do Coding Questions for Companies like Amazon, Microsoft, Adobe, …Must Do Coding Questions Company-wiseDon’t forget to check out the courses mentioned below: Last Updated : 21 Jul, 2023Like Article Save Article Please Login to comment...