0% found this document useful (0 votes)
55 views

Interview Dose

This document contains a list of algorithms and data structures categorized by topic. Some of the topics covered include math algorithms, bit manipulation, sorting algorithms, stacks and queues, arrays, strings, heaps, linked lists, backtracking, trees, tries, graphs, dynamic programming, and greedy algorithms. It also includes multiple choice questions related to time and space complexity and example problems to implement for various algorithms and data structures.

Uploaded by

akashgupta
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as XLSX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
55 views

Interview Dose

This document contains a list of algorithms and data structures categorized by topic. Some of the topics covered include math algorithms, bit manipulation, sorting algorithms, stacks and queues, arrays, strings, heaps, linked lists, backtracking, trees, tries, graphs, dynamic programming, and greedy algorithms. It also includes multiple choice questions related to time and space complexity and example problems to implement for various algorithms and data structures.

Uploaded by

akashgupta
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as XLSX, PDF, TXT or read online on Scribd
You are on page 1/ 17

Time complexity analysis

Math Algorithms

Bit Manipulation

Sorting Algorithms

Stack
& Queue

Array
String
Heap

Linked List

BackTracking

Tree
TRIE

Segment Tree

GRAPH
DP

Greedy
Minm deletions to make array sorted. 2. Maxm Sum Increasing
Subsequence. 3. Maxm Bitonic Subsequence. 4. Building
Bridges 5. Longest Chain of Pairs.
//discuss.codechef.com/t/multiple-choice-questions-related-to-testing-knowledge-about-time-and-space-complexity-of-a-pro

Find all prime nos from 1 to N


Given a number find if it's prime
Calculate X^Y in log(Y) time
Find all prime factors of a number N
Calculate NCR value for given N and R
Read and implement the problems for all catalan number variations taught in class
Unique Binary Search Trees

Single Number
Single Number II
Majority Element
Bitwise AND of Numbers Range
Counting Bits
Hamming Distance
Decode XORed Permutation

Implement all sorting algos using an unsorted array input:-


Selection sort
Bubble Sort
Merge Sort
Quick Sort
Insertion Sort
Counting Sort
Radix sort
Bucket Sort

Implement Stack using Queues


Implement Queue using Stacks
Valid Parentheses
Next Greater Element I
Design stack which supports getmin in O(1) time and space (Read editorial)
Largest Rectangle in Histogram
LRU Cache
Rotting Oranges
Reverse a stack without using extra space
Basic Calculator
Basic Calculator II
Car Fleet

Kth Largest Element in an Array


Sort Colors
Largest sum contiguous subarray
Merge 2 sorted arrays without using extra space
Merge Intervals
Next Permutation
Counting inversion
Best Time to Buy and Sell Stock
Given array of size N and number K, find all elements that appear more than N/K times
Trapping Rain Water
Minimum Size Subarray Sum
Median of Two Sorted Arrays
Two Sum
3Sum
4Sum
4Sum II
Range Sum Query - Immutable
Sort a K-sorted array
Shortest Subarray with Sum at Least K
Search in Rotated Sorted Array
Find Median from Data Stream
Closest Subsequence Sum (Leetcode 1755)
Range Addition
Capacity To Ship Packages Within D Days
product of an array except self
chocolate distribution problem
rotate array k times

Valid Palindrome
Valid Anagram
Permutation in string
Valid parentheses
Remove Consecutive Characters
Longest Common Prefix
Convert a Sentence into its Equivalent Mobile Numeric Keypad Sequence
Print all the Duplicates in the Input String
Longest Substring without Repeating Characters
Longest Repeating Character Replacement
Group Anagrams
Longest Palindromic Substring
Palindromic Substrings
Next Permutation
Count Palindromic Subsequences
Smallest Window in a String Containing all the Characters of Another String
Wildcard String Matching
Longest Prefix Suffix
Rabin-Karp Algorithm for Pattern Searching
Transform One String to Another using Minimum Number of Given Operation
Minimum Window Substring
Boyer Moore Algorithm for Pattern Searching
Word Wrap
Merge k Sorted Lists
Sliding Window Maximum
Find Median from Data Stream
Top K Frequent Elements
Sort Characters By Frequency
Kth Largest Element in a Stream
Process Tasks Using Servers

Reverse a linkedList (Iterative and recursive)


Reverse LinkedList in blocks of size K
Loop detection in LinkedList
Find intersection node or starting node of a loop in linkedList
Remove Duplicates in LinkedList
Add 2 linkedLists represented as numbers
Sort a LinkedList (merge sort)
Check if a LinkedList is palindrome
Flatten a linkedList
Multiply 2 nos represented as LinkedList
Josephus circle using circular linkedList

N-Queens
N-Queens II
Generate Parentheses
Letter Combinations of a Phone Number
Word Search
Word Search II
Word Break II
Remove Invalid Parentheses
Sudoku Solver
Permutations
Combination Sum

Lowest Common Ancestor of a Binary Tree


Binary Tree Maximum Path Sum
Binary Tree Right Side View
Serialize and Deserialize Binary Tree
All Nodes Distance K in Binary Tree
Count Good Nodes in Binary Tree
Lowest Common Ancestor of a Binary Tree III
Validate Binary Search Tree
Vertical Order Traversal of a Binary Tree
Convert Binary Search Tree to Sorted Doubly Linked List
Diameter of Binary Tree
Binary Tree Zigzag Level Order Traversal
Invert Binary Tree
Balance a Binary Search Tree
Binary Tree Level Order Traversal
Flatten Binary Tree to Linked List
Construct Binary Tree from Preorder and Inorder Traversal
Symmetric Tree
Unique Binary Search Trees
Cousins in Binary Tree
Construct Binary Search Tree from Preorder Traversal
Inorder Successor in BST

Implement Trie (Prefix Tree)


Implement Trie II (Prefix Tree)
Design Add and Search Words Data Structure
Count number of strings with given prefix
Maximum XOR of 2 numbers in an array
Word Break
Word Break II

Range sum query


Range max/min query
Range XOR query
Range GCD query
Range LCM query
Count of number of Zeroes in a given range
Find Kth zero in array (segment tree)

Course Schedule II
Course Schedule
Number of Connected Components in an Undirected Graph
Evaluate Division
Clone Graph
Is Graph Bipartite?
Possible Bipartition
All Paths From Source to Target
Path With Minimum Effort
Graph Valid Tree
Connecting Cities With Minimum Cost
Regions Cut By Slashes
Network Delay Time
Shortest Path to Get Food
Path With Maximum Minimum Value
Shortest Path in a Hidden Grid
Minimum Path Cost in a Hidden Grid
Path with Maximum Probability
Parallel Courses
Find the City With the Smallest Number of Neighbors at a Threshold Distance
Course Schedule IV
Min Cost to Connect All Points
Remove Max Number of Edges to Keep Graph Fully Traversable
Critical Connections in a Network
Number of Provinces
Maximum Number of Accepted Invitations
Minimum Degree of a Connected Trio in a Graph
Detonate the Maximum Bombs

Egg Drop With 2 Eggs and N Floors


Super Egg Drop
Burst Balloons
Longest Common Subsequence
Shortest Common Supersequence
Longest Palindromic Subsequence
Maximum Length of Repeated Subarray
Delete Operation for Two Strings
Partition Equal Subset Sum
Ones and Zeroes
Target Sum
Coin Change
Coin Change 2
Longest Palindromic Substring
Palindromic Substrings
Longest Increasing Subsequence
Number of Longest Increasing Subsequence
Minimum Operations to Make the Array K-Increasing
Edit Distance
One Edit Distance
Minimum Path Sum
Unique Paths
Unique Paths II
Largest Rectangle in Histogram
Maximal Square
Maximal Rectangle
Dungeon Game
Partition to K Equal Sum Subsets
Matchsticks to Square
Number of Ways to Wear Different Hats to Each Other

Implement Huffman algo (Use Editorial and our class lecture)


Meeting Rooms II
Employee Free Time
Task Scheduler
Reorganize String
Minimum Number of Taps to Open to Water a Garden
Gas Station
Minimum Deletion Cost to Avoid Repeating Letters
Best Time to Buy and Sell Stock II
Jump Game II
Maximum Number of Events That Can Be Attended
Partition Labels
Two City Scheduling
Jump Game

minimum window subsequence


longest increasing Subsequence 2
mplexity-of-a-program/17976 Done(confusion in 2 question)

Done
Done
Done
DOne
Done
Done
Catalan Nos https://youtu.be/CMaZ69P1bAc

Done
Done
Done(Moore's Vooting Algo)
Done
Done
Done

++++++++++++++
Done
Done
Done
Done
Done
Done
Maximum Gap

++++++++++++++
Done
Done
Done
Find next smaller element Done
Find previous greater element Done
Find previous smaller element Done
Done
(BFS) Done
Done
Done
Done
Done
++++++++++++++
quick select algo (O(n)) Done
two pointer Done
Kadane's Algo (Done) Done
gap algo Done
greedy algo Done
Done
merge sort Done
Done
Done(HashMap)
Done
Done
Done

Meet in the middle algo (Done)


Difference array (Done) Done
binary search (Explained in class)
Done
Done
needs to do Done
++++++++++++++

Done
Done
Done
use Stacks (if possible) Done
Done
Done
Done
Done
Done
Done
Done
Done
Done
Done
(confusion)
Done

use Dynaming Programming


++++++++++++++
Done
Done
Done
Done
Done
Done

++++++++++++++
Done

++++++++++++++
Imp

Imp

Imp

Imp

Imp

Imp
Imp

Imp

Imp
Imp
Imp

++++++++++++++

Topological Sort
Cycle Detection
DSUF / DFS
DSUF
DFS
Bipartite graph
Bipartite Graph
DFS
DFS + Binary Search / Dijkstra
Chcek if Graph is a TREE
MST (Kruskal's/Prims)
Counting islands / DSUF
Dijkstra/Bellman-Ford
BFS
Dijkstra
Dijkstra
Dijkstra
Dijkstra
Topological Sort
Floyd Warshall
Floyd Warshall
Prims/Kruskals MST
Prims/Kruskals MST / DSUF
Tarjan's Algo
DSUF
Ford-Fulkerson / Hungarian algo
Bruteforce (Adjacency Matrix)
BFS

MCM
MCM
MCM
LCS Done
LCS Done
LCS Done
LCS Done
LCS Done
KP (Knapsack) Done
KP (Knapsack) Done
KP (Knapsack) Done without using KP
KP (Knapsack) Done
KP (Knapsack) Done
LPS
LPS
LIS Done
LIS Done
LIS (NlogN) Done
MED (Min Edit Dist)
MED (Min Edit Dist)
DP on Grid
DP on Grid
DP on Grid
DP on Grid
DP on Grid
DP on Grid
DP on Grid
DP BitMasking
DP BitMasking
DP BitMasking

You might also like