You are on page 1of 9

Technical Training

Content
M6: ADVANCE DATA STRUCTURE & PROBLEM-SOLVING USING C++
Learning outcome
1. Understand the concept of fundamental Data Structures (Linked-lists, Trees, Binary Search Trees (BST), AVL Trees,
Stacks, Queues, Priority Queues, and Hash-Tables and Skiplists).
2. Design and Analyze programming problem statements.
3. Ability to sensibly select appropriate data structures and algorithms and use it to design algorithms for a specific problem.
4. Ability to create novel solutions to small scale programming challenges involving data structures and recursion.
5. Apply and Handle operations like searching, insertion, deletion and traversing mechanism.
6. Ability to Analyze the algorithmic complexity of simple, non-recursive programs.
7. Ability to Evaluate simple inductive proofs and proofs by contradiction and reason about program correctness and
invariants.

Main Required
Topics to be covered Lectures
Topics
Basics Control Statements 2
Assignment-1: Draw Pattern
Structure Padding, Bit Field and self-Referential Structure 2
Pointers and Dynamic Memory Allocation in C/ C++
Memory Layout in C++
Recursion Principles of recursion 2
Understanding solving Recurrence relation and working
Bit Fundamental of Bit Level operations 2
Manipulation Representation of Negative number
Little Endian and Big-Endian Architecture
Bitwise Operators
Bitwise shifting operators
Algorithms and their Implementation
Complexity Time and Space Complexity, trade off, Notations, Evaluation of Time and Space Complexity 2
Analysis for iterative and recursive algorithms
Arrays 1D Arrays: Memory Representation, Declaration and Initialization of Array, Insertion, Deletion, Left 10
Rotation, Right rotation, Reverse, Concept of lower bound and upper bound, Address Calculation.
2D Arrays: Memory Representation, initialization, Address calculation (Row and column Major),
Passing 2- D array to function, implementation of 2-D array using pointer.
Array of Pointer Vs Pointer to Array
Dynamic Arrays Vs Vectors
Linked List Linked List (Linear, Circular and Doubly) and Their operations
Generic linked list
10
Memory efficient Doubly Linked List
Introduction to Stack
Stack
Basic operations - PUSH and POP 4
Application of Stack: Decimal to binary, Decimal to Hexadecimal, Decimal to Octal, Infix to
Postfix and Prefix, Postfix evaluation. String reverse, palindrome check, Balanced parenthesis
check, validity of bracketed arithmetic expression.
Working with Multi stack: Implementation of multiple stacks using a single array (using equal
partition and memory sharing)
Mergeable Stack: Implementation using Linked List
Queue Introduction to Queue (Linear, Circular, Double Ended and Priority) and their operations 4
Priority Queue: Array, Linked List and Heap Implementation, Comparison of
various implementations
Implementation of Stack using Queue
Hashing Introduction of Hashing & Chaining 2

Ordered & Unordered Maps in C++


Characteristics of good hash function & Coding Problems
Problems: Patterns
Problems Need to be Discussed in Class Room
Topic: Problem: Company
Adobe Apple
Bit Manipulation Count set bits in an integer
Accolite Amazon FactSet
Find the two non-repeating elements in an array of Google MakeMyTrip Microsoft
Bit Manipulation repeating elements Qualcomm Samsung
Bit Manipulation Program to find whether a no is power of two Adobe
Bit Manipulation Find position of the only set bit Microsoft
Maq Software
Bit Manipulation Count number of bits to be flipped to convert A to B
Microsoft
Bit Manipulation Count total set bits in all numbers from 1 to n
Bit Manipulation Copy set bits in a range Facebook
Bit Manipulation Calculate square of a number without using *, / and pow() Amazon
Divide two integers without using multiplication, division
Bit Manipulation and mod operator Microsoft
Bit Manipulation Power Set Google + Adobe + Paytm

Problems Need to be Discussed in Class Room


Topic: Problem: Company
Array Reverse the array Infosys Moonfrog Labs
CO Accolite Amazon Cisco Hike
Find the maximum and minimum element in an Microsoft Snapdeal VMWare Google
Array array Adobe
CO Accolite Amazon Cisco Hike
Microsoft Snapdeal VMWare Google
Array Find the "Kth" max and min element of an array Adobe
Given an array which consists of only 0, 1 and 2.
Array Sort the array without using any sorting algo
Move all the negative elements to one side of the
Array array
Find the Union and Intersection of the two sorted
Array arrays.

Array Write a program to cyclically rotate an array by one.


Array find Largest sum contiguous Subarray [V. IMP]
Minimise the maximum difference between heights
Array [V.IMP]
Array Minimum no. of Jumps to reach end of an array
Array find duplicate in an array of N+1 Integers

Array Merge 2 sorted arrays without using Extra space.


Array Kadane's Algo [V.V.V.V.V IMP]
Array Merge Intervals
Uber + Goldman Sachs + Adobe
Array Next Permutation Interview Qs
Array Count Inversion
Amazon D-E-Shaw Directi Flipkart
Goldman Sachs Intuit MakeMyTrip
Array Best time to buy and Sell stock Microsoft Ola Cabs Oracle Paytm
Pubmatic Quikr Salesforce Sapient
Swiggy Walmart Media.net Google
find all pairs on integer array whose sum is equal to
Array given number
Array find common elements In 3 sorted arrays
Rearrange the array in alternating positive and
Array negative items with O(1) extra space
Array Find if there is any subarray with sum equal to 0
Array Find factorial of a large number
Array find maximum product subarray
Array Find longest coinsecutive subsequence
Given an array of size n and a number k, fin all
Array elements that appear more than " n/k " times.
Maximum profit by buying and selling a share
Array atmost twice

Array Find whether an array is a subset of another array


Array Find the triplet that sum to a given value
Samsung Interview Qs use auxiliary
Array Trapping Rain water problem arrays
Array Chocolate Distribution problem Amazon Interview Qs
Smallest Subarray with sum greater than a given
Array value
Three way partitioning of an array around a given
Array value
Minimum swaps required bring elements less equal
Array K together
Minimum no. of operations required to make an
Array array palindrome
Array Median of 2 sorted arrays of equal size
Array Median of 2 sorted arrays of different size

Assignment-1
Topic: Problem: Company
Amazon D-E-Shaw Microsoft Morgan
Arrays Maximum Product Subarray Stanley OYO Rooms Google
Adobe Amazon Microsoft Morgan
Stanley Samsung Snapdeal Times
Arrays Find Minimum in Rotated Sorted Array Internet
Microsoft + Google + Apple Interview
Arrays Find Pair with Sum in Sorted & Rotated Array Qs
Adobe Amazon Microsoft Morgan
Stanley Samsung Snapdeal Times
Arrays 3Sum Internet
Flipkart + Dunzo Interview Qs use 2
Arrays Container With Most Water pointer approach
Infosys + Amazon + Flipkart Interview
Arrays Given Sum Pair Qs
Arrays Merge Overlapping Intervals Google Interview Qs
Find Minimum Number of Merge Operations to Make
Arrays an Array Palindrome Amazon
Given an Array of Numbers Arrange the Numbers to
Arrays Form the Biggest Number Barclays Interview Qs
Arrays Space Optimization Using Bit Manipulations Amazon
Arrays Subarray Sum Divisible K Snapdeal Microsoft
Print all Possible Combinations of r Elements in a
Arrays Given Array of Size n Amazon
Arrays Mo's Algorithm Microsoft

Problems Need to be Discussed in Class Room


Topic: Problem: Company
2D Arrays Flipkart + Apple + Societe Generale IQ
Spiral traversal on a Matrix
2D Arrays Search an element in a matriix
2D Arrays Find median in a row wise sorted matrix
2D Arrays Find row with maximum no. of 1's
2D Arrays Print elements in sorted order using row-column wise Microsoft VMWare
sorted matrix
2D Arrays Amazon Microsoft
Maximum size rectangle
2D Arrays Find a specific pair in matrix
2D Arrays Rotate matrix by 90 degrees
2D Arrays Kth smallest element in a row-column wise sorted
matrix
2D Arrays Common elements in all rows of a given matrix

Assignment-2
Topic: Problem: Company
2D Arrays Amazon
Zigzag (or diagonal) Traversal of Matrix
2D Arrays Set Matrix Zeroes Amazon Microsoft
2D Arrays Rotate Image Microsoft Paytm Samsung Adobe
2D Arrays Google + Ola + Goldman Sachs IQ
Word Search
2D Arrays Microsoft + Uber + Apple +
Amazon IQ Read about DFS
Find the Number of Islands | Set 1 (Using DFS)
2D Arrays Given a Matrix of ‘O’ and ‘X’, Replace ‘O’ with ‘X’ if
surrounded by ‘X’ Google
2D Arrays Create a Matrix with Alternating Rectangles of O and X MAQ VMWare
Problems Need to be Discussed in Class Room
Topic: Problem: Company
Amazon Cisco D-E-Shaw Facebook
FactSet Morgan Stanley Paytm Zoho
Strings Valid Palindrome
Nagarro Media.net Directi Google
Strings Valid Anagram Adobe Flipkart
Google Interview Qs use Stacks (if
Strings Valid parentheses possible)
Strings Remove Consecutive Characters Samsung + Adobe
Adobe + Grofers + Dunzo Interview
Qs
Strings Longest Common Prefix
Convert a Sentence into its Equivalent Mobile Adobe
Strings Numeric Keypad Sequence
Strings Print all the Duplicates in the Input String Ola + Amdocs IQ
Strings Longest Substring without Repeating Characters Morgan Stanley + Amazon IQ
Strings Longest Repeating Character Replacement Amazon Google
Samsung + Adobe + Amazon
Strings Group Anagrams Interview Qs
Microsoft + Google + Samsung + Visa
Strings Longest Palindromic Substring IQ
Strings Palindromic Substrings Microsoft IQ
Strings Next Permutation Adobe + Goldman Sachs + Uber
Strings Count Palindromic Subsequences Myntra Interview Qs
Smallest Window in a String Containing all the
Strings Characters of Another String Microsoft + Amazon IQ
Strings Wildcard String Matching Microsoft + Amazon + Ola IQ
Strings Longest Prefix Suffix Flipkart + Swiggy IQ
Strings Rabin-Karp Algorithm for Pattern Searching Microsoft
Transform One String to Another using Minimum
Strings Number of Given Operation Directi
Amazon Google MakeMyTrip
Streamoid Technologies Microsoft
Strings Minimum Window Substring Media.net Atlassian Flipkart
Strings Boyer Moore Algorithm for Pattern Searching Amdocs
Strings Word Wrap Microsoft
Problems Need to be Discussed in Class Room
Topic: Problem: Company
Sprinklr
Linked List Reverse Linked List
Accolite Amazon D-E-Shaw Hike Lybrate
Mahindra Comviva MakeMyTrip MAQ
Software OYO Rooms Paytm Qualcomm
Samsung SAP Labs Snapdeal Veritas
Linked List Linked List Cycle VMWare Walmart Adobe
Accolite Amazon Belzabar Brocade FactSet
Flipkart MakeMyTrip Microsoft OATS
Linked List Merge Two Sorted Lists Systems Oracle Samsung Synopsys Zoho
Amazon Goldman Sachs Kritikal Solutions
Linked List Delete without Head node Microsoft Samsung Visa
Amazon Intuit
Linked List Remove duplicates from an unsorted linked list
Amazon MakeMyTrip
Linked List Sort a linked list of 0s-1s-or-2s Microsoft
Linked List Multiply two numbers represented linked lists Amazon
Adobe Amazon Citicorp Epic Systems
FactSet Hike MAQ Software Monotype
Solutions Morgan Stanley OYO Rooms
Linked List Remove nth node from end of list Accolite Qualcomm Samsung Snapdeal Flipkart
Linked List Reorder List Amazon Microsoft OYO Rooms Intuit
Accolite Amazon D-E-Shaw Hike Lybrate
Mahindra Comviva MakeMyTrip MAQ
Software OYO Rooms Paytm Qualcomm
Samsung SAP Labs Snapdeal Veritas
Linked List Detect and remove loop in a linked list VMWare Walmart Adobe
Write a Function to get the Intersection Point of
Linked List two Linked Lists Amazon
Linked List Flatten a linked list with next and child pointers Google
Linked List Linked list in zig-zag fashion Micorsoft
Linked List Reverse a doubly linked list Walmart
Delete nodes which have a greater value on right
Linked List side Amazon
Linked List Segregate even and odd Elements in a Linked List Walmart
Point to next higher value node in a linked list with
Linked List an Arbitrary Pointer GeekyAnts
Linked List Rearrange a given linked list in place Ola Uber
Linked List Sort Biotonic Doubly Linked Lists Morgan Stanley
Linked List Merge K Sorted Lists Microsoft+ Ola+ eBay
Accolite Adobe Amazon MAQ Software
Linked List Merge sort for linked list Microsoft Paytm Veritas Important
Linked List Quicksort on singly-linked list Paytm Important
Accolite Amazon Flipkart MakeMyTrip
Microsoft Morgan Stanley Qualcomm
Linked List Sum of two linked lists Snapdeal
24*7 Innovation Labs Amazon Drishti-Soft
Flipkart Goldman Sachs Microsoft Paytm
Linked List Flattening a linked list Payu Qualcomm Snapdeal Visa
Linked List Clone a linked list with next and random Pointer Triology
Linked List Subtract two numbers represented as linked lists Amazon Goldman Sachs
Problems Need to be Discussed in Class Room
Topic: Problem: Company
24*7 Innovation Labs Microsoft Samsung
Snapdeal
Stacks & Queues Implement two stacks in an Array
Stacks & Queues Evaluation of Postfix Expression Amazon + Google + Facebook
Stacks & Queues Implement Stack using Queues Facebook
Stacks & Queues Queue Reversal Amazon + Morgain Stanley
Microsoft +Atlassian
Stacks & Queues Implement Stack Queue using Deque
Microsoft + Amdocs
Stacks & Queues Reverse first k elements of queue
Stacks & Queues Design Stack with Middle Operation MaQ Software
Amazon + Samsung + Paytm + Vmware
Stacks & Queues Infix to Postfix inc
Amazon Google Microsoft Visa Goldman
Stacks & Queues Design and Implement Special stack Sachs
Stacks & Queues Longest Valid String Google Microsoft
Find if an expression has duplicate parenthesis Flipkart Oracle OYO Rooms Snapdeal
Stacks & Queues or not Walmart Yatra.com Microsoft Google
Stack permutations check if an array is stack
Stacks & Queues permutation of other Visa
Count natural numbers whose permutation
Stacks & Queues greater number Amazon
Amazon Goldman Sachs IBM Intuit Kuliza
Stacks & Queues Sort a stack using Recursion Yahoo Microsoft
Queue based approach for first non repeating
Stacks & Queues character in a stream Microsoft Flipkart
Stacks & Queues The Celebrity Problem Google + Visa + Apple
Stacks & Queues Next larger Element Visa
Stacks & Queues Distance of nearest cell Flipkar + Facebook
Stacks & Queues Rotten-oranges Facebook
Stacks & Queues Next smaller element Codenation
Stacks & Queues Circular-tour Codenation Flipkart
Stacks & Queues Efficiently implement k-stacks single array Flipkart
Stacks & Queues The celebrity problem Google + Visa + Apple
Stacks & Queues Iterative tower of hanoi Microsoft Flipkart
Find the maximum of minimums for every
Stacks & Queues window size in a given array Amazon Microsoft Flipkart
Stacks & Queues lru cache implementation Microsoft + Uber + Alibaba
Stacks & Queues Find a tour that visits all stations Uber

You might also like