Algorithm Questions

If you are preparing for technical interview questions for product based companies like Google, Microsoft, Amazon, Facebook, Flipkart, NetApp, Intuit, VmWare, Cisco, Intel, EMC, Adobe then you should be good in technical questions of arrays, strings, linked lists, trees, matrix etc.

Array Technical Interview Questions

String Technical Interview Questions

Linked List Technical Interview Questions

Tree Technical Interview Questions

Matrix Technical Interview Questions

Arrays Questions

Reverse Array

Pair Sum Equals Number

Floor and Ceil

Largest Sum Subarray

Missing Number

Odd Occuring Number

Sort by Frequency

First and Second Smallest

Majority Element

Difference between elements

Arrange Even and Odd

Closest Sum Elements

Distinct Elements

First Repeating Number

Common Elements in Arrays

Smallest Missing Number

Max Adjacent Sum

Find Occurrences of Number

Rotate Image

Distance Between Numbers

Pair with given difference

Product Array Puzzle

Replace Elements

First Repeating Element

Move Zeroes to End

Pythagorean Triplets

Maximum Average Subarray

Subarray Sum Equal to X 

Leaders in Array

Largest Pair Sum

Segregate 0s 1s and 2s

Find Duplicates

Consecutive Elements Check

Triplet with given Sum

Binary Search in Sorted Array

Fixed point in sorted array

Reorder Elements by Indexes

Merging two sorted arrays

Find next greater number 

Reorder array using given indexes

Count of triplets with sum less than given value

Merge two sorted arrays 

Subarray and Subsequence 

Rearrange array maximum minimum form

Find the lost element from a duplicated array

Count minimum steps to get the given array

Maximum element in an array which is increasing and then decreasing

Minimum number of jumps to reach the end of an array

Subarray with given sum

Length of Longest Increasing Subsequence

Smallest positive number missing unsorted array

The Celebrity Problem

Sorted subsequence of size 3

Partition Problem

Find pair with given difference

Maximum length of chain pairs

Four elements that sum to given

Maximum circular subarray sum

Count possible triangles

Longest Increasing Subsequence

Petrol Bunks Tour

Tug of War

Counting Sort

Maximum Repeating Number

Positive Negative Arrangement

Find a Peak element

Elements More Than n/k

Max Product Subsequence

Longest Bitonic subarray in an array

Number of smaller elements on right side

Implement two stacks in an array

Maximum sum increasing subsequence

Find the two numbers with odd occurrences in an unsorted array

Largest subarray with equal number of 0's and 1's

Maximum product subarray

Replace every element with the greatest on the right side in an array

Sorting a k sorted array

Find the row with maximum number of 1's

Shuffle a given array

Iterative Implementation of quick sort

Arrange given numbers to form the biggest number

Pancake sorting

Pancake sorting Problem

Maximum Subarray Sum using Divide and Conquer

Merge Overlapping Intervals

Stock Buy Sell to Maximize Profit

Sort Elements by frequency

Print all possible combinations of r elements in a given array of size n

Monotonically increasing function

Minimum element in a sorted and rotated array

Merge k Sorted Arrays

Flip Zeroes for Consecutive 1's

Least Average Subarray

Longest span with same sum in two binary arrays

Form minimum number from given sequence of D's and I's

Number of strictly increasing subarrays

Minimum difference between any two elements in an array

Number of pairs with given sum

Make Array Palindrome

Dynamic Programming, Longest Bitonic SubSequence

String Questions

Repeating character

Concatenation of two strings

Reverse a String

Remove duplicates from a string

Palindrome String

Sorting the array of strings

Remove characters from first string which are in second

Print Reverse of a string (Recursion)

Divide a string in N equal parts

The smallest window in a string containing all characters of another string

Reverse words in a given string

Given a string find its first non-repeating character

A Program to check if strings are rotations of each other or not

Print all duplicates in the input string

Print all interleavings of given two strings

Check whether two strings are anagram of each other

Write a program to print all permutations of a given string

List items containing all characters of a given word

Run length encoding

Print all permutations with repetition

Given string is interleaving of two other strings or not

Longest Palindromic Substring

wildcard character matching

Remove 'b' and 'ac' from a given string

Recursively remove all adjacent duplicates

Sort an array of strings

Check if a given string is a rotation of a palindrome

Find the second most frequent character

Print all pair of anagrams in a given array of strings

Remove spaces from a string

Lexicographic rank of string

Print all anagrams together in a sequence of words

Count the number of words

String(represents an integer) to value

Palindromes in a given range

Check rearranged string can form a palindrome

print all palindromic partitions

Minimum insertions to form a shortest palindrome

Print string of odd length in 'X' format

Transform one string to another using minimum number of given operations

Shortest Superstring Problem

Print all possible words from phone digits

Palindrome string (number)

Number of sub-strings which recursively add up to 9

Rotate string to get lexicographically minimum string

Print Longest common subsequence

Recursive function to do substring search

Reverse a string without affecting special characters

Recursive Implementation of atoi()

Program to add two binary digits

Length of longest valid substring

Check if two given strings are isomorphic to each other

Online algorithm for checking palindrome in a stream

Recursively print all the sentences that can be formed from list of word lists

Remove recurring digits in a given number

Find First non-repeating character in a string

Convert string1 to string2 in one edit

1`s and 2`s complement of binary number

Split a string

Palindrome permutations of a string

Repeated subsequence of length 2 or more


Longest Common Extension

Removing spaces from a string using stringstream

Count number of substrings with k distinct characaters

Change gender of a given string

Remove Extra Spaces from a string

Print shortest path to print a string on screen

Longest Common Prefix (Using Biary Search)

Lower Case To Upper Case

Longest Common Prefix (Using Divide and Conquer)

Calculate sum of all numbers present in a string

Permutations (STL)

Longest common prefix (Character by character)

Longest common prefix (word by word)

Longest palindrome can be formed by removing or rearranging characters

Perfect reversible string

Longest common subsequence withpermutations

Caesar Cipher

Print all possible ways to break a string in bracket form

Generate all binary strings from given pattern

Remove minimum characters so that two strings become anagrams

Compare two version numbers

Kth Non-repeating character

Nth character in Concatenated Decimal string

Convert a string that is repetition of a substring of length k

Minimum characters to be added at front to make string palindrome

Count of character pairs at same distance as in english alphabets

Print all palindromic partitions of a string

Minimum number of characters to be removed to make a binary string alternate

Recursive Palindrome check

Reverse string without temporary variable

Can be split into four distinct strings

Even sub-string count

Check if string follows order of characters by a pattern or not

Smallest palindrome after replacement

Check if string can become empty by recursively deleting given sub-string

Sort a string according to another string

Check if all rows of a matrix are circular rotations of each other

Generate all binary strings without consecutive 1's

Check length of a string is equal to the number appended at its last

Program to toggle all characters in a string

Check whether strings are k distance apart or not

Linked-List Questions

Create Linked list

Create Doubly Linked List

Find Nth Node

Alternate Sub List Split

Cycle Detection

Delete Alternate Nodes

Delete Linked List

Delete Node in Doubly Linked List

Delete Node using Pointer

Identical Linked Lists

Insert Node in Ascending Order

Merge Sorted Linked Lists

Find Middle

Move Element at First

Nth Element from End

Number Occurrence in List

Pairwise Swap

Palindrome Linked List

Remove Duplicates

Remove Duplicates (Un-Sorted)

Doubly Linkedlist Reverse

Reverse Linked List

Reverse Linked List (Recursive)

Split Circular List

Linked List Intersection

Reverse a Linked List in groups

Delete nodes with higher value on right side

Delete a node under given conditions

Triplet from three linked lists with given sum

Sort a linked list with 0s, 1s and 2s

Delete N nodes after M 

Merge a linked list into another at alternate positions

Can we reverse a linked list in less than O(n) time ?

Remove middle points in a linked list of line segments

Sort a linked list that is sorted alternating ascending and descending

Merge sort better than quick sort for linked lists

Compare two strings(linked lists)

Delete a node of a linked list at given position

Segregate even and odd nodes in a linked list

Flattening a linked list

Clone a linked list with next and random pointer (Hashing)

Point to next higher value node

Rearrange a linked list in Zig-Zag

Point to greatest value in the right

Binary Tree to Doubly linked list

Sort linked which is sorted on absolute values

Merge Sort for Linked Lists

Reverse alternate k nodes in a Singly Linked List

Add two numbers represented by linked lists

Union and Intersection of Two Linked Lists

Rotate a Linked List

Flatten a multilevel linked list

Quick Sort on SIngly Linked List

Pairwise swap elements of a given linked list by chnaging links

Sum Linked List out of two Sorted Linked Lists 

Clone a Linked List with next and random pointer

Insertion Sort for Singly Linked List

Rearrange a given linked list in-place

Select a random node from a singly linked list

Merge two sorted linked lists such that merged list is in reverse order

Rearrange a linked list even and odd position nodes

Add 1 to a number represented as a linked list

Check if a linked list of strings form a palindrome

Merge Sort for Doubly Linked List

Delete last occurrence

Delete a node with given key

Length of a linked list

Search an element

Swap nodes in the linked list

Swap kth node from beginning with kth node from end

Find Nth node

Detect Loop in List

Insert Node in Sorted List

Tree Questions

Tree Data Structure

In-Order Traversal

Post-Order Traversal

Pre-Order Traversal

Trees are identical or not

Delete a Tree

Binary Tree

Binary Search Tree

Searching a node in Binary Search Tree

Inserting a node in Binary Search Tree

Program to calculate the size of a tree

Program to find the height of the tree

Matrix Questions

Check if two given matrices are identical

Transpose of a Matrix

Subtraction of two matrices

Addition of Matrices

Multiplication of two matrices

Scroll to Top