├── Interview_Preparation
├── sorting_algorithms.md
├── searching_algorithms.md
├── abstract.md
├── Arrays_questions.docx
├── Maths.md
├── Readme.md
├── Standard_Template_Library_STL.md
├── two_pointers.md
├── tries.md
├── stacks.md
├── strings.md
├── binary_search.md
├── oops.md
├── arrays.md
└── dynamic_programming.md
├── README.md
└── Girls_in_Tech_opportunities.md
/Interview_Preparation/sorting_algorithms.md:
--------------------------------------------------------------------------------
1 |
2 |
--------------------------------------------------------------------------------
/Interview_Preparation/searching_algorithms.md:
--------------------------------------------------------------------------------
1 |
2 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | # The-Ultimate-Guide
2 | This repository contains resources, preparation guide for placements and other opportunities.
3 |
--------------------------------------------------------------------------------
/Interview_Preparation/abstract.md:
--------------------------------------------------------------------------------
1 | Stack vs Head vs Data vs Code segment
2 | Templates in C++
3 | Enum, Struct etc
4 | Pointers, References
5 |
--------------------------------------------------------------------------------
/Interview_Preparation/Arrays_questions.docx:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Njack-IITP/The-Ultimate-Guide/HEAD/Interview_Preparation/Arrays_questions.docx
--------------------------------------------------------------------------------
/Interview_Preparation/Maths.md:
--------------------------------------------------------------------------------
1 | ## Contents
2 |
3 | [TOC]
4 | # Mathematics
5 |
6 | ## Contents
7 |
8 | [TOC]
9 |
10 | ## Introduction
11 | A lot of problems require knowledge of Number Theory and Discrete mathematics. Hence it becomes important to be well versed with such topics before hand as many problems do include methods such as prime factorisation, prime number tests, count of divisors etc as subroutines.
12 |
13 |
14 |
15 | ## Euclidean Algorithm
16 | [Euclidean Algorithm (Video Lecture)](https://www.khanacademy.org/computing/computer-science/cryptography/modarithmetic/a/the-euclidean-algorithm)
17 |
18 | [A more detailed article](https://cp-algorithms.com/algebra/euclid-algorithm.html)
19 |
20 | ## Prime Numbers
21 | [Finding Prime Numbers in square root N](https://math.stackexchange.com/questions/1039519/finding-prime-factors-by-taking-the-square-root/1039525#1039525)
22 |
23 |
24 | Can you solve this problem? [Problem](https://www.spoj.com/problems/TDPRIMES/)
25 |
26 | If not, you probably need to know how to find a lot of primes more faster.
27 |
28 | [Sieve of Eratosthenes](https://cp-algorithms.com/algebra/sieve-of-eratosthenes.html)
29 |
30 | [Number of Divisors in cube root N](https://codeforces.com/blog/entry/22317)
31 |
32 | [Advanced Section](https://codeforces.com/blog/entry/8989)
33 |
34 | ## Fast Exponentiation
35 |
36 | [Modular Exponentiation Tutorial](https://discuss.codechef.com/t/a-tutorial-on-fast-modulo-multiplication-exponential-squaring/2899)
37 |
--------------------------------------------------------------------------------
/Interview_Preparation/Readme.md:
--------------------------------------------------------------------------------
1 | Coding interviews are tough. But fortunately, there's a tried and proven method to get better at them. With a combination of studying, practicing questions and doing mock interviews, getting that dream job can become a reality.
2 |
3 | 1. Study CS fundamentals
4 | 2. Practice solving algorithm questions
5 | 3. Internalize the Do's and Don'ts of interviews
6 | 4. Practice doing mock interviews
7 | 5. Know the placement procedure for the company you are applying and interview successfully to get the job
8 |
9 | ## Know the language
10 |
11 | [This resource](https://docs.google.com/document/d/1tGSeFzLYHqavsU7EVcC_core3MSsipGn9sEgyeLNLik/edit?usp=sharing) is targeted for the the extreme beginners.
12 | After understanding the syntax of language, you should atleast solve 30-40 questions from [a2oj](https://www.a2oj.com/Ladder5.html) just to get better at problem solving whenever stuck you can refer to editorials.
13 |
14 | * This is majorly about getting hang of problem solving skills and using the basic mathematics you previously know. If you are comfortable with any language(C, C++, Java, Python), you can skip this.
15 |
16 |
17 | ## Common data structures and algorithms to prepare for interviews:
18 |
19 | Note:
20 | * Each topic contains some resources and problems to understand the topic. Try to solve problems on your own at first. You might need to refer solution if you are doing it first time. After completing a topic from here, do practice some questions from leetcode(you can sort questions on basis of tags and difficulty) and proceed to next topic if you understand the topic very well(Don't skip any topic).
21 | * Always check solution/discuss section after completing the question. You may find easier and better implementation.
22 |
23 |
24 | 1. [STL](Standard_Template_Library_STL.md)
25 | 2. [Arrays and Vectors](arrays.md)
26 | 3. [Maths](Maths.md)
27 | 4. [Strings](strings.md)
28 | 5. [Binary Search](binary_search.md)
29 | 6. Bit Manipulation
30 | 7. [Two pointers](two_pointers.md)
31 | 8. Linked List
32 | 9. [Stack and Queues](stacks.md)
33 | 10. Hashing
34 | 11. Heaps and Maps
35 | 12. Tree Data Structure
36 | 13. Binary Search Trees
37 | 14. Greedy
38 | 15. Recursion and Backtracking
39 | 16. [Dynamic Programming](dynamic_programming.md)
40 | 17. Graphs
41 | 18. [Tries](tries.md)
42 |
43 |
--------------------------------------------------------------------------------
/Interview_Preparation/Standard_Template_Library_STL.md:
--------------------------------------------------------------------------------
1 | # Standard Template Library (STL)
2 |
3 | - [Introductory_tutorial Link_1](https://www.hackerearth.com/practice/notes/standard-template-library/)
4 | - [Introductory_tutorial Link_2(Tip: Do not memorise or learn in details, just read thoroughly)](https://www.geeksforgeeks.org/the-c-standard-template-library-stl/)
5 | - [Introductory_Video_1](https://www.youtube.com/watch?v=Hg3cTlJVXa8&list=PL_dsdStdDXbq8BTjGdUEWgWYFWYP6pwYb)
6 | - [Introductory_Video_2](https://www.youtube.com/watch?v=LyGlTmaWEPs&list=PLk6CEY9XxSIA-xo3HRYC3M0Aitzdut7AA)
7 | - [When to us which container](https://www.hackerearth.com/practice/notes/c-stls-when-to-use-which-stl/)
8 |
9 | ### Map Questions For Learning and Practise:
10 |
11 | ##### Practice Questions:
12 |
13 | 1. [Frequency of each character in a String (easy_level)](https://leetcode.com/problems/sort-characters-by-frequency/)
14 | 2. [Remove Duplicate Elements (easy_level) ](https://practice.geeksforgeeks.org/problems/remove-duplicates3034/1)
15 | 3. [Rearrange characters to form palindrome if possible](https://www.geeksforgeeks.org/rearrange-characters-form-palindrome-possible/)
16 | 4. [Sort array of 0,1,2 ](https://practice.geeksforgeeks.org/problems/sort-an-array-of-0s-1s-and-2s/0)
17 |
18 | ### Set Questions For Learning and Practise:
19 |
20 | ##### Practice Questions:
21 |
22 | 1. [For basic understanding and implementation of Set](https://practice.geeksforgeeks.org/problems/c-stl-set-6-set/1)
23 | 2. [Find duplicates in an array (easy_level)](https://practice.geeksforgeeks.org/problems/find-duplicates-in-an-array/1)
24 | 3. [Distict absolute Sum (easy_level)](https://practice.geeksforgeeks.org/problems/distinct-absolute-array-elements4529/1)
25 | 4. [Do first question ](https://www.geeksforgeeks.org/mathworks-interview-experience-for-internship-on-campus/)
26 |
27 | ### Vector Questions For Learning and Practise:
28 |
29 | ##### Practice Questions:
30 |
31 | 1. [For basic understanding of Vector](https://www.hackerearth.com/practice/notes/stl-vector/)
32 | 2. [For implementation of vector ](https://practice.geeksforgeeks.org/problems/c-stl-set-1-vector/1)
33 | 3. [Find the Frequency (Basic) ](https://practice.geeksforgeeks.org/problems/find-the-frequency/1)
34 |
35 | ### Pair Questions For Learning and Practise:
36 |
37 | ##### Practice Questions:
38 |
39 | 1. [For basic understanding and implementation of pairs](https://practice.geeksforgeeks.org/problems/c-stl-set-2-pair/1)
40 |
--------------------------------------------------------------------------------
/Interview_Preparation/two_pointers.md:
--------------------------------------------------------------------------------
1 | # Two pointers
2 |
3 | - [Video](https://www.youtube.com/watch?v=ymKrGndnTis)
4 | - [Video-Problem Solving](https://www.youtube.com/watch?v=_yHSCc1w3mU)
5 |
6 | - [Tutorial1](https://www.interviewbit.com/tutorial/two-pointers/)
7 | - [Tutorial2](https://algodaily.com/lessons/using-the-two-pointer-technique)
8 |
9 | ## Practice Problems:
10 |
11 | Note, this questions can be done using sorting and hashing(using maps,sets). Try to think both sorting and two-pointer approaches.
12 |
13 | #### Easy:
14 |
15 | 1. [ Two Sum II - Input array is sorted](https://leetcode.com/problems/two-sum-ii-input-array-is-sorted/)
16 | 2. [Diffk](https://www.interviewbit.com/problems/diffk/)
17 | 3. [Reverse vowels of string](https://leetcode.com/problems/reverse-vowels-of-a-string/)
18 | 4. [Merge Sorted Array](https://leetcode.com/problems/merge-sorted-array/)
19 | 5. [Squares of a Sorted Array](https://leetcode.com/problems/squares-of-a-sorted-array/)
20 | 6. [Intersection of the arrays](https://leetcode.com/problems/intersection-of-two-arrays/)
21 | 7. [Move Zeroes](https://leetcode.com/problems/move-zeroes/)
22 | 8. [Remove Duplicates from Sorted Array](https://www.interviewbit.com/problems/remove-duplicates-from-sorted-array/)
23 | 9. [Remove Duplicates from Sorted Array II](https://www.interviewbit.com/problems/remove-duplicates-from-sorted-array-ii/)
24 | 10. [Remove element](https://leetcode.com/problems/remove-element/)
25 |
26 |
27 | #### Medium:
28 |
29 | 1. [Intersection of Two Arrays II](https://leetcode.com/problems/intersection-of-two-arrays-ii/)
30 | 2. [Three Sum](https://www.interviewbit.com/problems/3-sum/)
31 | 3. [3 Sum Zero](https://www.interviewbit.com/problems/3-sum-zero/)
32 | 4. [Interval List Intersections](https://leetcode.com/problems/interval-list-intersections/)
33 | 5. [Sort by color](https://www.interviewbit.com/problems/sort-by-color/)
34 | 6. [Count triangles](https://www.interviewbit.com/problems/counting-triangles/)
35 | 7. [Merge Two Sorted Lists II](https://www.interviewbit.com/problems/merge-two-sorted-lists-ii/)
36 |
37 |
38 | #### Hard:
39 |
40 | 1. [Max Continuous Series of 1s](https://www.interviewbit.com/problems/max-continuous-series-of-1s/)
41 | 2. [3-pointers](https://www.interviewbit.com/problems/array-3-pointers/)
42 | 3. [Container With Most Water](https://www.interviewbit.com/problems/container-with-most-water/)
43 | 4. [Smallest Range Covering Elements from K Lists](https://leetcode.com/problems/smallest-range-covering-elements-from-k-lists/)
44 |
--------------------------------------------------------------------------------
/Interview_Preparation/tries.md:
--------------------------------------------------------------------------------
1 | # Trie:
2 |
3 | - [Tutorial 1](https://www.hackerearth.com/practice/data-structures/advanced-data-structures/trie-keyword-tree/tutorial/)
4 | - [Tutorial 2](https://www.hackerearth.com/practice/notes/lalitkundu95/tutorial-on-trie-and-example-problems/)
5 |
6 | - [Video](https://www.youtube.com/watch?v=AXjmTQ8LEoI)
7 |
8 | * Used to calculate length of common prefix of strings or related question.
9 | * Used to calculate [maximum subarray XOR in a given array](https://www.geeksforgeeks.org/find-the-maximum-subarray-xor-in-a-given-array/)
10 | * Used to calculate [Maximum XOR Pair](https://www.youtube.com/watch?v=jCu-Pd0IjIA)
11 |
12 | ## Practice Problems
13 |
14 | Note: SOme problems can be done using sets/map. Try to think solution using tries.
15 |
16 | #### Easy
17 |
18 | 1. [Tries Insert and Search](https://practice.geeksforgeeks.org/problems/trie-insert-and-search/0)
19 | 2. [Tries](https://www.hackerearth.com/practice/data-structures/advanced-data-structures/trie-keyword-tree/practice-problems/algorithm/tries-78733022/)
20 | 3. [Unique rows in boolean matrix](https://practice.geeksforgeeks.org/problems/unique-rows-in-boolean-matrix/1)
21 | [Count of distinct substrings](https://practice.geeksforgeeks.org/problems/count-of-distinct-substrings/1)
22 | 4. [Pair of strings having longest common prefix of maximum length in given array](https://www.geeksforgeeks.org/pair-of-strings-having-longest-common-prefix-of-maximum-length-in-given-array/)
23 | 5. [Longest Word in Dictionary](https://leetcode.com/problems/longest-word-in-dictionary/)
24 |
25 | #### Medium
26 |
27 | 1. [Implement Trie (Prefix Tree)](https://leetcode.com/problems/implement-trie-prefix-tree/)
28 | 2. [Trie delete](https://practice.geeksforgeeks.org/problems/trie-delete/1)
29 | 3. [ Maximum XOR of Two Numbers in an Array](https://leetcode.com/problems/maximum-xor-of-two-numbers-in-an-array/)
30 | 4. [Replace words](https://leetcode.com/problems/replace-words/)
31 | 5. [Map sum](https://leetcode.com/problems/map-sum-pairs/)
32 |
33 | #### Hard
34 |
35 | 1. [Hotel Reviews](https://www.interviewbit.com/problems/hotel-reviews/)
36 | 2. [Shortest unique prefix](https://www.interviewbit.com/problems/shortest-unique-prefix/)
37 | 3. [Palindrome pairs](https://www.interviewbit.com/problems/palindrome-pairs/) : Can be done using Hashing. If using a struct, remember to clear the memory before the next call. because it might happen that GCC hasn't cleared previous memory before the next call or you might have memory leak issues like not deleting from the heap.
38 | 4. [Anagrams](https://www.interviewbit.com/problems/anagrams/) : Can be solved using tries, but hashing(using maps) does better as fewer chances for memory leaks and easy to implement.
--------------------------------------------------------------------------------
/Interview_Preparation/stacks.md:
--------------------------------------------------------------------------------
1 | # Stacks
2 |
3 | - [Stacks Introduction Video](https://www.youtube.com/watch?v=F1F2imiOJfk)
4 | - [Stacks tutorial](https://www.geeksforgeeks.org/stack-data-structure-introduction-program/)
5 | - [Infix, Prefix, Postfix](https://www.youtube.com/watch?v=jos1Flt21is)
6 |
7 | ## Implementation
8 | ```
9 | stack A; // declares an empty stack.
10 | A.push(newElement); // Pushes a new element. O(1)
11 | A.pop(); // pop O(1)
12 | A.empty() // check if stack is empty O(1)
13 | A.size(); // size of stack O(1)
14 | A.top(); // O(1). Gives the top element.
15 |
16 | ```
17 | ## Practice Problems:
18 | 1. [Min Stack](https://www.interviewbit.com/problems/min-stack/)
19 | 2. [Simplify Path](https://www.interviewbit.com/problems/simplify-directory-path/)
20 | 3. [Decode string](https://leetcode.com/problems/decode-string/)
21 | 4. [Remove all adjacent duplicates in a string](https://leetcode.com/problems/remove-all-adjacent-duplicates-in-string/)
22 | 5. [Reverse Polish notation](https://leetcode.com/problems/evaluate-reverse-polish-notation/)
23 | 6. [Valid Stack Sequences](https://leetcode.com/problems/validate-stack-sequences/)
24 |
25 | # Queue
26 |
27 | - [Queue Introduction Video](https://www.youtube.com/watch?v=XuCbpw6Bj1U)
28 | - [Queue Tutorial](https://www.geeksforgeeks.org/queue-data-structure/)
29 |
30 | ## Implementation
31 | ```
32 | queue A; // declares an empty queue.
33 | A.push(newElement); // Pushes a new element. O(1)
34 | A.pop(); // pop element O(1)
35 | A.empty() // check if stack is empty O(1)
36 | A.size(); // size of queue O(1)
37 | A.front(); // Gives the first element O(1).
38 | ```
39 | ## Practice Problem:
40 | 1. [First non-repeating character in a stream of characters](https://www.interviewbit.com/problems/first-non-repeating-character-in-a-stream-of-characters/)
41 |
42 | # Deque
43 |
44 | - [Deque Tutorial](https://www.geeksforgeeks.org/deque-cpp-stl/)
45 | ## Implementation
46 | ```
47 | deque A; // declares an empty deque.
48 | A.push_back(newElement); // Pushes a new element at back of deque. O(1)
49 | A.push_front(newElement); // Pushes a new element at front of deque. O(1)
50 | A.size(); // size of deque O(1)
51 | A.front(); // Gives the front element O(1).
52 | A.back(); // Gives the back element O(1).
53 | A.pop_front(); // pop element from front O(1)
54 | A.pop_back(); // pop element from back O(1)
55 | ```
56 | ## Practice Problem:
57 | 1. [Design circular queue](https://leetcode.com/problems/design-circular-deque/)
58 | 2. [Sliding window maximum](https://www.interviewbit.com/problems/sliding-window-maximum/)
59 |
60 |
61 | # Practice Problems:
62 |
63 | 1. [Valid Parentheses](https://leetcode.com/problems/valid-parentheses/)
64 | 2. [Evaluate expression](https://www.interviewbit.com/problems/evaluate-expression/)
65 | 3. [Redundant braces](https://www.interviewbit.com/problems/redundant-braces/)
66 | 4. [Number of atoms](https://leetcode.com/problems/number-of-atoms/)
67 | 5. [Remove duplicate letters](https://leetcode.com/problems/remove-duplicate-letters/)
68 | 6. [Remove k digits](https://leetcode.com/problems/remove-k-digits/)
69 | 7. [Nearest Smalller element](https://www.interviewbit.com/problems/nearest-smaller-element/)
70 | 8. [MAXSPPROD](https://www.interviewbit.com/problems/maxspprod/)
71 | 9. [Largest Rectangle in Histogram](https://www.interviewbit.com/problems/largest-rectangle-in-histogram/)
72 | 10. [Rain water trapped](https://www.interviewbit.com/problems/rain-water-trapped/)
73 |
--------------------------------------------------------------------------------
/Interview_Preparation/strings.md:
--------------------------------------------------------------------------------
1 | # Strings
2 |
3 | - Videos:
4 | * [Character Array and Pointers](https://www.youtube.com/watch?v=Bf8a6IC1dE8)
5 | * [Strings](https://www.youtube.com/watch?v=3rDp0yOACZQ)
6 | - [Tutorial: Strings GFG](https://www.geeksforgeeks.org/stdstring-class-in-c/)
7 |
8 | ## Implementation
9 | ```
10 | C style char arrays work in C++ as well. However, C++ provides string which is much more powerful than C arrays.
11 | String declaration :
12 | string A; // declares an empty string
13 | string A = "Hello"; // declares string initialized to "Hello".
14 |
15 | Accessing ith element :
16 | A[i] // O(1)
17 |
18 | Size ( number of elements ) of the string :
19 | A.length() // O(1)
20 |
21 | Appending to the string :
22 | A += "Hello"; // Appends Hello to the string. O(n) operation
23 | A.push_back('H'); // Append character H to the string. O(1) operation.
24 | ```
25 |
26 |
27 | #### Practice Questions:
28 | (May skip if comfortable in using strings)
29 | 1. [Consecutive Characters](https://leetcode.com/problems/consecutive-characters/)
30 | 2. [First Unique Character in a String](https://leetcode.com/problems/first-unique-character-in-a-string/)
31 | 3. [Ransom note](https://leetcode.com/problems/ransom-note/)
32 | 4. [Amazing subarrays](https://www.interviewbit.com/problems/amazing-subarrays/)
33 | 5. [Palindrome string](https://www.interviewbit.com/problems/palindrome-string/)
34 | 6. [Count and Say](https://www.interviewbit.com/problems/count-and-say/)
35 | 7. [Group Anagrams](https://leetcode.com/problems/group-anagrams/)
36 |
37 |
38 | ## KMP
39 |
40 | - [Tutorial 1](https://www.hackerearth.com/practice/algorithms/string-algorithm/string-searching/tutorial/)
41 | - [Tutorial 2](https://cp-algorithms.com/string/prefix-function.html)
42 | - [Video1](https://www.youtube.com/watch?v=KG44VoDtsAA)
43 | - [Video2](https://www.youtube.com/watch?v=cH-5KcgUcOE)
44 |
45 |
46 | ##### Practice Questions:
47 | 1. [Test Your Understanding](https://www.hackerearth.com/practice/algorithms/string-algorithm/string-searching/tutorial/)
48 | 2. [Implement strstr](https://leetcode.com/problems/implement-strstr/)
49 | 3. [Minimum characters required to make a string palindromic](https://www.interviewbit.com/problems/minimum-characters-required-to-make-a-string-palindromic)
50 | 4. [Repeated substring pattern](https://leetcode.com/problems/repeated-substring-pattern/)
51 |
52 |
53 | ## Manachar Algorithm
54 |
55 | - [Tutorial](https://www.hackerearth.com/practice/algorithms/string-algorithm/manachars-algorithm/tutorial/)
56 | - [Video](https://www.youtube.com/watch?v=nbTSfrEfo6M)
57 |
58 | ##### Practice Questions:
59 | 1. [Longest Palindromic Substring](https://leetcode.com/problems/longest-palindromic-substring/)
60 | 2. [Palindromic substrings](https://leetcode.com/problems/palindromic-substrings/)
61 |
62 |
63 | ## Robin Karp Algorithm
64 | - [Tutorial](https://www.geeksforgeeks.org/rabin-karp-algorithm-for-pattern-searching/)
65 | - [Rolling Hash](https://www.youtube.com/watch?v=BQ9E-2umSWc)
66 | - [Robin Karp Algorithm](https://www.youtube.com/watch?v=H4VrKHVG5qI)
67 |
68 | ##### Practice Questions:
69 | Most of the KMP problems can be solved using Robin Karp Algorithm but it is used less because hashing will not be 100% deterministically correct, because two complete different strings might have the same hash (the hashes collide). [Read more here](https://cp-algorithms.com/string/string-hashing.html)
70 |
71 | 1. [NHAY - A Needle in the Haystack](https://www.spoj.com/problems/NHAY/)
72 | 2. [SUB_PROB - Substring Problem](https://www.spoj.com/problems/SUB_PROB/)
73 | 3. [Distinct Echo Substrings](https://leetcode.com/problems/distinct-echo-substrings/)
74 | 4. [Longest Chunked Palindrome Decomposition](https://leetcode.com/problems/longest-chunked-palindrome-decomposition/)
75 |
--------------------------------------------------------------------------------
/Girls_in_Tech_opportunities.md:
--------------------------------------------------------------------------------
1 | # List of opportunities/programmes for girls in Tech:
2 |
3 |
4 | ## For 1st year:
5 | 1. [Google Women Techmaker](https://www.womentechmakers.com/scholars) - An academic scholarship, awarded based on academic performance, leadership, and impact on the community of women in tech. Applications period starts from March.
6 |
7 | ## For 2nd year:
8 |
9 | 1. [Microsoft Codess](https://acehacker.com/codess/): Codess is a community for female coders initiated by Microsoft. This organises a simple online coding test in early March. Registrations begin around February.
10 | 2. [Google Women Techmaker](https://www.womentechmakers.com/scholars) - An academic scholarship, awarded based on academic performance, leadership, and impact on the community of women in tech. Applications period starts from March
11 | 3. [Twitter DevelopHer](https://developher2020india.splashthat.com/)- A two day program for second-year and third-year women pursuing computer science where you get to participate in workshops, activities, and meet amazing women with similar passions. Applications start from July
12 |
13 | ## For 3rd year:
14 | 1. [Adobe Women In Tech ](https://research.adobe.com/adobe-india-women-in-technology-scholarship/) - The scholarship will fund toward tuition fees for the remainder of the award recipient’s university education and provide opportunity for Summer Internship at Adobe India in 2021*.Application period begins in August.
15 | 3. [Twitter DevelopHer](https://developher2020india.splashthat.com/)- A two day program for second-year and third-year women pursuing computer science where you get to participate in workshops, activities, and meet amazing women with similar passions. Applications start from July
16 |
17 |
18 | ## Other Programmes
19 |
20 | 1. [GirlScript Summer of Code](https://www.gssoc.tech/) : GirlScript Summer of Code is the 3 month long Open Source program during summers conducted by GirlScript Foundation, started in 2018, with an aim to help beginners get started with Open Source Development while encouraging diversity. Registration for students and mentors begin in January.
21 | 2. [Rails Girls Summer of Code](https://railsgirlssummerofcode.org/): Rails Girls Summer of Code is a global fellowship program for women and non-binary coders. Students receive a three-month scholarship to work on existing Open Source projects and expand their skill set. Registration for students and mentors are expected to begin in January.
22 | 3. [Google CodeJam IO](https://codingcompetitions.withgoogle.com/codejamio) : Code Jam to I/O for Women is one way we bring women (students and professionals) from around the globe together, working to solve tough algorithmic challenges in a 2.5 hour, single-round coding competition. The top 150 on the scoreboard will receive a ticket and reimbursement to offset travel expenses to Google I/O. Competition is expected to be organised in February.
23 | 4. [She Codes by Indeed](https://she-codes.org/): She Codes is a national level coding program hosted by job search website Indeed and it focuses to bring spotlight on talented Indian Coders. It is a free contest open to all women students and professionals in India, the contest aims to bring out the best in programming talent in India. Registration begin in August.
24 | 5. [Outreachy](https://www.outreachy.org/) : Outreachy internships are 3 months long. Interns are paid an internship stipend of $5,500 USD. Interns have a $500 USD travel stipend to attend conferences or events. It is organized twice a year. [Sign up for mailing list here](https://lists.outreachy.org/cgi-bin/mailman/listinfo/announce) or an announcement when the next internship round opens.
25 | 6. [Grace Hopper Scholarship](https://ghc.anitab.org/): Grace Hopper Celebration (GHC) is the world’s largest gathering of women technologists. Learn, network, and be inspired as we work together to achieve intersectional gender and pay parity in tech. You can add your resume [here](https://careercenter.anitab.org/) in the GHC and GHCI database, even if not attending conference.
26 |
27 | ## Scholarships:
28 |
29 | 1. GSoC Systers
30 | 2. SheIntuit by Intuit - Aug
31 | 3. Goldman Sachs Women Mentorship Program
32 | 4. Women Who Code Mentorship - Dec
33 |
--------------------------------------------------------------------------------
/Interview_Preparation/binary_search.md:
--------------------------------------------------------------------------------
1 | # Binary Search
2 |
3 | - [Tutorial 1](https://www.geeksforgeeks.org/binary-search/)
4 | - [Tutorial 2](https://leetcode.com/explore/learn/card/binary-search/138/background/1038/discuss/423162/Binary-Search-101)
5 | - [Video](https://www.youtube.com/watch?v=P3YID7liBug)
6 |
7 |
8 | ### Binary Search Templates:
9 |
10 | - Template 1:
11 | used to search for an element or condition which can be determined by accessing a single index in the array. Search Condition can be determined without comparing to the element's neighbors (or use specific elements around it).
12 | ```
13 | Initial Condition: left = 0, right = length-1
14 | Termination: left > right
15 | Searching Left: right = mid-1
16 | Searching Right: left = mid+1
17 |
18 | int binarySearch(vector& nums, int target){
19 | if(nums.size() == 0)
20 | return -1;
21 |
22 | int left = 0, right = nums.size() - 1; // Initial condition
23 | while(left <= right){
24 | int mid = left + (right - left) / 2; // Prevent (left + right) overflow
25 | if(nums[mid] == target)
26 | return mid;
27 | else if(nums[mid] < target)
28 | left = mid + 1; // Searching right
29 | else
30 | right = mid - 1; // Searching left
31 | }
32 | // End Condition: left > right
33 | return -1;
34 | }
35 | ```
36 | ##### Practice Questions:
37 | 1. [Binary Search](https://leetcode.com/problems/binary-search/)
38 | 2. [Search Insert Position](https://leetcode.com/problems/search-insert-position/)
39 | 3. [Guess Number Higher or Lower](https://leetcode.com/problems/guess-number-higher-or-lower/)
40 |
41 |
42 |
43 | - Template 2:
44 | It is used to search for an element or condition which requires accessing the current index and its immediate right neighbor's index in the array.
45 | ```
46 | Initial Condition: left = 0, right = length
47 | Termination: left == right
48 | Searching Left: right = mid
49 | Searching Right: left = mid+1
50 |
51 | int binarySearch(vector& nums, int target){
52 | if(nums.size() == 0)
53 | return -1;
54 |
55 | int left = 0, right = nums.size();
56 | while(left < right){
57 | int mid = left + (right - left) / 2; // Prevent (left + right) overflow
58 | if(nums[mid] == target){ return mid; }
59 | else if(nums[mid] < target) { left = mid + 1; }
60 | else { right = mid; }
61 | }
62 |
63 | // Post-processing:
64 | // End Condition: left == right
65 | if(left != nums.size() && nums[left] == target) return left;
66 | return -1;
67 | }
68 | ```
69 |
70 | ##### Practice Questions:
71 | 1. [Find First and Last Position of Element in Sorted Array](https://leetcode.com/problems/find-first-and-last-position-of-element-in-sorted-array/)
72 | 2. [First Bad version](https://leetcode.com/problems/first-bad-version/)
73 | 3. [Peak Index in a Mountain Array](https://leetcode.com/problems/peak-index-in-a-mountain-array/)
74 | 4. [Find Minimum in Rotated Sorted Array](https://leetcode.com/problems/find-minimum-in-rotated-sorted-array/)
75 | 5. [Find Peak Element](https://leetcode.com/problems/find-peak-element/)
76 |
77 |
78 | ## Beyond Sorted Array Binary Search
79 | - Binary search obviously works on searching for elements in a sorted array. But it works is because the array itself is monotonic ( either increasing or decreasing ). So, if you are a particular position, you can make a definite call whether the answer lies in the left part of the position or the right part of it.
80 |
Similar thing can be done with monotonic functions ( monotonically increasing or decreasing ) as well.
81 | Lets say we have f(x) which increases when x increases.
82 |
So, given a problem of finding x so that f(x) = p, I can do a binary search for x.
83 | At any instance,
84 | 1. if f(current_position) > p, then I will search for values lower than current_position.
85 | 2. if f(current_position) < p, then I will search for values higher than current_position
86 | 3. if f(current_position) = p, then I have found my answer.
87 |
88 | #### Practice Questions:
89 | 1. [Sqrtx](https://leetcode.com/problems/sqrtx/)
90 | 2. [Capacity To Ship Packages Within D Days](https://leetcode.com/problems/capacity-to-ship-packages-within-d-days/)
91 | 3. [Painter's Partition Problem](https://www.interviewbit.com/problems/painters-partition-problem/)
92 | 4. [Allocate books](https://www.interviewbit.com/problems/allocate-books/)
93 |
94 |
95 | ### More Practice Problems:
96 | 1. [Search a 2D Matrix II](https://leetcode.com/problems/search-a-2d-matrix-ii/)
97 | 2. [Heaters](https://leetcode.com/problems/heaters/)
98 | 3. [Kth Smallest Element in a Sorted Matrix](https://leetcode.com/problems/kth-smallest-element-in-a-sorted-matrix/)
99 | 4. [Find Minimum in Rotated Sorted Array II](https://leetcode.com/problems/find-minimum-in-rotated-sorted-array-ii/)
100 | 5. [Split Array Sum](https://leetcode.com/problems/split-array-largest-sum/)
101 | 6. [Median of two sorted arrays](https://leetcode.com/problems/median-of-two-sorted-arrays/)
102 | 7. [Matrix median](https://www.interviewbit.com/problems/matrix-median/)
103 |
104 |
105 | ## References:
106 | 1. [Binary Search-leetcode](https://leetcode.com/explore/learn/card/binary-search/136/template-analysis/)
107 | 2. [Interviewbit](https://www.interviewbit.com/practice/)
108 |
109 |
110 |
--------------------------------------------------------------------------------
/Interview_Preparation/oops.md:
--------------------------------------------------------------------------------
1 | #### This assumes that you already know how to write basic code, i.e. you know how to create at least an array, a function, a struct in any language. We would be using C++ for this tutorial.
2 |
3 | The goal of this week is to learn basics of OOP (Object Oriented Programming), understand their importance and application in software development, learn about standard data structures available in STL (Standard Template Library) and implement them yourself from scratch.
4 |
5 | OOPs is asked by 99% of the companies in their interviews and it is implicitly assumed that you would know it, many of you would have used OOPs while programming without even realizing that.
6 | The rest of the content in this tutorial has been picked up from **Google FTE, Expedia, LinkedIn, Commvault, Amazon, Morgan Stanley, Optum (UHG), Samsung, Envestnet Yodlee** interviews or coding round held this year. The actual list is of course way bigger.
7 |
8 | Let's start!
9 |
10 | ## Part 1: OOPs
11 |
12 | 1. What is Object Oriented Programming and why is it necessary?
13 |
14 | [click here to know basics and importance in 7 minuted](https://www.youtube.com/watch?v=pTB0EiLXUC8)
15 |
16 | [click here if you want to fall in love with OOP and have infinite time](https://www.youtube.com/watch?v=-DP1i2ZU9gk)
17 |
18 | [click here to know about the 4 pillars of OOP, content may be convered in previous two videos](https://www.youtube.com/watch?v=1ONhXmQuWP8)
19 |
20 | 2. OOPs in C++
21 |
22 | [link to the entire playlist, you can watch at 1.5x speed, watch till video number 27 for now](https://www.youtube.com/watch?v=xnh7ip5gpzc&list=PLfVsf4Bjg79DLA5K3GLbIwf3baNVFO2Lq)
23 |
24 | You are good to go for now!
25 |
26 | ## Part 2: Implement basic DS from scratch
27 |
28 | Goal is to implement basic data structures like vector (dynamic array), linked list, stack & queue using linked list, binary tree, binary search tree, trie, set, map, hashmap (unordered_set and unordered_map), binary heap from scratch.
29 | You should be using OOPs concepts to implement them. Think of the inbuilt-funtions STL has for each of these data structures (for example push(), pop(), find(), insert(), erase(), size(), empty() etc.) and implement them.
30 | Video tutorials for these would be shared after 3 days - this file would be updated. Till then, you are encouraged to try it out yourself.
31 |
32 | #### These video tutorials might skip on some functions necessary for a data structure class. Check and confirm them using the [C++ documentation - cplusplus.com](http://www.cplusplus.com/reference/). Also think on the asymptotic time complexity of each operation on the data structure and edge cases like empty list, overflow, constraints etc.
33 |
34 | [Hackerrank playlist with some common questions](https://www.youtube.com/playlist?list=PL2_aWCzGMAwI3W_JlcBbtYTwiQSsOTa6P)
35 |
36 | [mycodeschool playlist](https://www.youtube.com/playlist?list=PL2_aWCzGMAwI3W_JlcBbtYTwiQSsOTa6P)
37 |
38 | PS: Graphs would be covered separately.
39 |
40 | 1. [Vector (dynamic array)](https://www.youtube.com/watch?v=ryRf4Jh_YC0) or [this one](https://www.youtube.com/watch?v=HN3tZaMcgkw)
41 | 1. [Hashtable (unordered_set, unordered_map)](https://www.youtube.com/watch?v=2_3fR-k-LzI)
42 |
43 | [more on hashtable](https://www.youtube.com/watch?v=shs0KM3wKv8)
44 | 1. [Linked List using class](https://www.youtube.com/watch?v=njTh_OwMljA)
45 |
46 | Implement linked list using struct too - since it is more commonly used
47 |
48 | [check this forward list link document](https://www.geeksforgeeks.org/forward-list-c-set-1-introduction-important-functions/)
49 |
50 | [check this list document](http://www.cplusplus.com/reference/list/list)
51 |
52 | See doubly linked list separately and guess the difference.
53 | 1. [Stack and Queue](https://www.youtube.com/watch?v=wjI1WNcIntg&list=PLI1t_8YX-Apv-UiRlnZwqqrRT8D1RhriX&index=3)
54 |
55 | [Queue with two stacks - amortized O(1)](https://www.youtube.com/watch?v=7ArHz8jPglw&list=PLI1t_8YX-Apv-UiRlnZwqqrRT8D1RhriX&index=2)
56 |
57 | [Stack with two queues - amortized O(1) Leetcode question](https://leetcode.com/problems/implement-stack-using-queues/)
58 |
59 | [Stack using Linked List](https://www.youtube.com/watch?v=MuwxQ2IB8lQ)
60 |
61 | [Queue using Linked List](https://www.youtube.com/watch?v=A5_XdiK4J8A)
62 |
63 | See alternatives like deque
64 |
65 | 1. [Basic Trees](https://www.youtube.com/watch?v=oSWTXtMglKE&list=PLI1t_8YX-Apv-UiRlnZwqqrRT8D1RhriX&index=7)
66 |
67 | [Basic BST](https://www.youtube.com/watch?v=i_Q0v_Ct5lY&list=PLI1t_8YX-Apv-UiRlnZwqqrRT8D1RhriX&index=6)
68 |
69 | Implement rest of the BST functions yourself.
70 | 1. [Heap/ Priority Queue](https://www.youtube.com/watch?v=t0Cq6tVNRBA&list=PLI1t_8YX-Apv-UiRlnZwqqrRT8D1RhriX&index=10)
71 |
72 | Also check the unconventional pointer approach instead of using an array.
73 |
74 | 1. [Trie](https://www.youtube.com/watch?v=zIjfhVPRZCg&list=PLI1t_8YX-Apv-UiRlnZwqqrRT8D1RhriX&index=9)
75 |
76 | [Trie implementation tutorial](www.hackerearth.com/practice/data-structures/advanced-data-structures/trie-keyword-tree/tutorial/)
77 |
78 | ### Now see how set and map (including unordered_set and unordered_map) are implemented in C++.
79 |
80 | ### Questions to take care of while following up with this guide:
81 |
82 | 1. What was your project about? Why did you choose this project? What innovation did you bring to the project?
83 | 2. What problems did you face while doing this project? How did you tackle them?
84 | 3. What things do you believe you could have done better?
85 | 4. What did you learn from the project?
86 | 5. What tech stack was used in the project? Why did you use this particular tool and why not something else, what advantage does it give?
87 | 6. Was it a team project? If yes, were there any moments you and your teammates had a conflict of opinion? (Likely expected answer is yes). If so, How did you solve those conflicts?
88 |
89 | Don't hesitate to ask for help from your seniors, or just reply back to the mail in which this tutorial was sent.
90 |
--------------------------------------------------------------------------------
/Interview_Preparation/arrays.md:
--------------------------------------------------------------------------------
1 | **Arrays**
2 |
3 | **Easy**
4 |
5 | 1. [*https://www.interviewbit.com/problems/max-sum-contiguous-subarray/*](https://www.interviewbit.com/problems/max-sum-contiguous-subarray/)
6 |
7 | 2. [*https://www.interviewbit.com/problems/noble-integer/*](https://www.interviewbit.com/problems/noble-integer/)
8 |
9 | 3. [*https://www.interviewbit.com/problems/wave-array/*](https://www.interviewbit.com/problems/wave-array/)
10 |
11 | 4. [*https://www.interviewbit.com/problems/kth-row-of-pascals-triangle/*](https://www.interviewbit.com/problems/kth-row-of-pascals-triangle/)
12 |
13 | 5. [*https://www.interviewbit.com/problems/set-matrix-zeros/*](https://www.interviewbit.com/problems/set-matrix-zeros/)
14 |
15 | 6. [*https://www.interviewbit.com/problems/find-permutation/*](https://www.interviewbit.com/problems/find-permutation/)
16 |
17 | 7. [*https://www.interviewbit.com/problems/perfect-peak-of-array/*](https://www.interviewbit.com/problems/perfect-peak-of-array/)
18 |
19 | 8. [*https://www.interviewbit.com/problems/leaders-in-an-array/*](https://www.interviewbit.com/problems/leaders-in-an-array/)
20 |
21 | 9. [*https://www.interviewbit.com/problems/max-min-05542f2f-69aa-4253-9cc7-84eb7bf739c4/*](https://www.interviewbit.com/problems/max-min-05542f2f-69aa-4253-9cc7-84eb7bf739c4/)
22 |
23 | 10. [*https://leetcode.com/problems/contains-duplicate/*](https://leetcode.com/problems/contains-duplicate/)
24 |
25 | 11. [*https://leetcode.com/problems/missing-number/*](https://leetcode.com/problems/missing-number/)
26 |
27 | 12. [*https://leetcode.com/problems/find-all-numbers-disappeared-in-an-array/*](https://leetcode.com/problems/find-all-numbers-disappeared-in-an-array/)
28 |
29 | 13. [*https://leetcode.com/problems/single-number/*](https://leetcode.com/problems/single-number/)
30 |
31 | 14. [*https://www.interviewbit.com/problems/min-steps-in-infinite-grid/*](https://www.interviewbit.com/problems/min-steps-in-infinite-grid/)
32 |
33 | 15. [*https://www.interviewbit.com/problems/anti-diagonals/*](https://www.interviewbit.com/problems/anti-diagonals/)
34 |
35 | 16. [*https://www.interviewbit.com/problems/rotate-matrix/*](https://www.interviewbit.com/problems/rotate-matrix/)
36 |
37 | 17. [*https://www.interviewbit.com/problems/sort-array-with-squares/*](https://www.interviewbit.com/problems/sort-array-with-squares/)
38 |
39 | **Medium**
40 |
41 | 1. [*https://www.interviewbit.com/problems/add-one-to-number/*](https://www.interviewbit.com/problems/add-one-to-number/)
42 |
43 | 2. [*https://www.interviewbit.com/problems/maximum-absolute-difference/*](https://www.interviewbit.com/problems/maximum-absolute-difference/)
44 |
45 | 3. [*https://www.interviewbit.com/problems/partitions/*](https://www.interviewbit.com/problems/partitions/)
46 |
47 | 4. [*https://www.interviewbit.com/problems/hotel-bookings-possible/*](https://www.interviewbit.com/problems/hotel-bookings-possible/)
48 |
49 | 5. [*https://www.interviewbit.com/problems/maximum-unsorted-subarray/*](https://www.interviewbit.com/problems/maximum-unsorted-subarray/)
50 |
51 | 6. [*https://www.interviewbit.com/problems/max-distance/*](https://www.interviewbit.com/problems/max-distance/)
52 |
53 | 7. [*https://www.interviewbit.com/problems/spiral-order-matrix-ii/*](https://www.interviewbit.com/problems/spiral-order-matrix-ii/)
54 |
55 | 8. [*https://www.interviewbit.com/problems/repeat-and-missing-number-array/*](https://www.interviewbit.com/problems/repeat-and-missing-number-array/)
56 |
57 | 9. [*https://www.interviewbit.com/problems/merge-intervals/*](https://www.interviewbit.com/problems/merge-intervals/)
58 |
59 | 10. [*https://www.interviewbit.com/problems/merge-overlapping-intervals/*](https://www.interviewbit.com/problems/merge-overlapping-intervals/)
60 |
61 | 11. [*https://www.interviewbit.com/problems/largest-number/*](https://www.interviewbit.com/problems/largest-number/)
62 |
63 | 12. [*https://www.interviewbit.com/problems/first-missing-integer/*](https://www.interviewbit.com/problems/first-missing-integer/)
64 |
65 | 13. [*https://www.interviewbit.com/problems/minimum-lights-to-activate/*](https://www.interviewbit.com/problems/minimum-lights-to-activate/)
66 |
67 | 14. [*https://www.interviewbit.com/problems/maximum-sum-triplet/*](https://www.interviewbit.com/problems/maximum-sum-triplet/)
68 |
69 | 15. [*https://www.interviewbit.com/problems/maximum-sum-square-submatrix/*](https://www.interviewbit.com/problems/maximum-sum-square-submatrix/)
70 |
71 | 16. [*https://www.interviewbit.com/problems/maximum-area-of-triangle/*](https://www.interviewbit.com/problems/maximum-area-of-triangle/)
72 |
73 | 17. [*https://www.interviewbit.com/problems/pick-from-both-sides/*](https://www.interviewbit.com/problems/pick-from-both-sides/)
74 |
75 | 18. [*https://www.interviewbit.com/problems/balance-array/*](https://www.interviewbit.com/problems/balance-array/)
76 |
77 | 19. [*https://leetcode.com/problems/product-of-array-except-self/*](https://leetcode.com/problems/product-of-array-except-self/)
78 |
79 | 20. [*https://leetcode.com/problems/find-the-duplicate-number/*](https://leetcode.com/problems/find-the-duplicate-number/)
80 |
81 | 21. [*https://leetcode.com/problems/rotate-image/*](https://leetcode.com/problems/rotate-image/)
82 |
83 | 22. [*https://leetcode.com/problems/spiral-matrix/*](https://leetcode.com/problems/spiral-matrix/)
84 |
85 | 23. [*https://www.interviewbit.com/problems/next-permutation/*](https://www.interviewbit.com/problems/next-permutation/)
86 |
87 | 24. [*https://www.interviewbit.com/problems/find-permutation/*](https://www.interviewbit.com/problems/find-permutation/)
88 |
89 | **Hard**
90 |
91 | 1. [*https://www.interviewbit.com/problems/find-duplicate-in-array/*](https://www.interviewbit.com/problems/find-duplicate-in-array/)
92 |
93 | 2. [*https://www.interviewbit.com/problems/n3-repeat-number/*](https://www.interviewbit.com/problems/n3-repeat-number/)
94 |
95 | 3. [*https://leetcode.com/problems/longest-consecutive-sequence/*](https://leetcode.com/problems/longest-consecutive-sequence/)
96 |
97 | 4. [*https://leetcode.com/problems/first-missing-positive/*](https://leetcode.com/problems/first-missing-positive/)
98 |
99 | 5. [*https://www.interviewbit.com/problems/maximum-consecutive-gap/*](https://www.interviewbit.com/problems/maximum-consecutive-gap/)
100 |
101 |
102 |
--------------------------------------------------------------------------------
/Interview_Preparation/dynamic_programming.md:
--------------------------------------------------------------------------------
1 | # Dynamic Programming
2 |
3 | ## Basic introduction:
4 |
5 | Note:
6 | - If you have knowledge about definitions and what basic DP means then you can skip this part
7 | - If you specifically need a youtube video to explain you can find it at the end of this part
8 |
9 | A very simple way of imagining is that you want to optimise your recursive approach. ( A practical definition ).
10 | A formal definition will be that you want to break your problem into subproblems and then use their answer to build your overall answer.
11 |
12 | If you think you have never seen DP then you are wrong !!
13 |
14 | Some basic problems that use dp and you probably have seen before:
15 |
16 | ```
17 | Fibonacci sequence:
18 |
19 | Basic recursive definition a[n]=a[n-1]+a[n-2];
20 |
21 | fib[N];
22 | Int fibo(int n){
23 | if(n<0)return 0;
24 | if(fib[n]!=-1)return fib[n];
25 | fib[n]=fibo(n-1)+fibo(n-2);
26 | Return fib[n];
27 | }
28 | memset(fib,-1,sizeof(fib))
29 | fib[0]=fib[1]=1;
30 |
31 | ```
32 | Here one can observe that even though it is a recursive solution it still covers only the size N . Since you can never revisit a state because you saved it for future use.
33 |
34 | Similar recursive definitions can be easily solved with dp.
35 |
36 | Let us observe the time complexity here.
37 | All this code basically does is find you the fib[x] by filling up the array fib. One index is never revisited hence the worst case will be that you visit the whole array. Hence time and space complexity are both O(n).
38 |
39 |
40 | Take some time to analyse this. If you are fine with this let's move on.
41 |
42 |
43 |
44 | ## Types of DP:
45 |
46 | This basically refers to in what way you want to visit your states and fill your dp array.
47 |
48 | There are 2 main approaches.
49 |
50 | 1. Bottom up approach:
51 | 2. Top down approach.
52 |
53 | A very naive explanation will be that in the bottom up approach we fill the array using loops and start from the base case while in top down we start from the required state and move on to the base case using recursion.
54 |
55 | Let us look back to our fibonacci example.
56 |
57 | Try to observe that to get fib[n] we call the function fibo(n) and then find our answer moving down in recursion to hit base case zero or one.
58 |
59 | Now let us see another approach.
60 | ```
61 | int fib[N];
62 |
63 | fib[0]=fib[1]=1;
64 | for(int i=2;iSimple steps to solve a DP problem are:
126 | - First identify if it is a DP problem i.e can it be broken into subproblems and then use them to form answers.
127 | - Try to understand the states involved and then on what parameters will that state be dependent on.
128 | - Try to find the relation between different states and how to transit between them.
129 | - Choose an approach bottom up or top down.
130 |
131 |
132 |
133 | ## Resources :
134 | [A nice youtube video to explain this.](https://www.youtube.com/watch?v=vYquumk4nWw)
135 |
136 |
137 |
138 |
139 | ## Very basic questions:
140 |
141 | 1D DP:
142 |
143 | 1. [Tiling problem](https://www.geeksforgeeks.org/tiling-problem/)
144 | 2. [Subset sum](https://www.geeksforgeeks.org/subset-sum-divisible-m/)
145 | 3. [Painting fence](https://www.geeksforgeeks.org/painting-fence-algorithm/)
146 | 4. [Climbing stairs](https://leetcode.com/problems/climbing-stairs/)
147 | 5. [House robber](https://leetcode.com/problems/house-robber/)
148 |
149 | 2D DP:
150 |
151 | 1. [Binomial coefficient](https://www.geeksforgeeks.org/binomial-coefficient-dp-9/)
152 | 2. [Coin change problem](https://www.geeksforgeeks.org/coin-change-dp-7/)
153 | 3. [Finding Minimum-Cost Path in a 2-D Matrix](https://www.geeksforgeeks.org/min-cost-path-dp-6/)
154 | 4. [Rod Cutting](https://www.geeksforgeeks.org/cutting-a-rod-dp-13/)
155 |
156 | Finding the number of ways to reach from a starting position to an ending position travelling in specified directions only and other interesting problems in [hackerearth](https://www.hackerearth.com/practice/algorithms/dynamic-programming/2-dimensional/tutorial/)
157 |
158 |
159 |
160 | The above problems are classic and one should definitely solve them once.
161 |
162 |
163 | ## Some more classic problems:
164 |
165 | 1. [Longest common subsequence (LCS)](https://www.geeksforgeeks.org/dynamic-programming-set-4-longest-common-subsequence/)
166 | 2. [Longest increasing subsequence (LIS)](https://www.geeksforgeeks.org/longest-increasing-subsequence-dp-3/)
167 | 3. [Edit Distance](https://www.geeksforgeeks.org/edit-distance-dp-5/ )
168 | 4. [Knapsack](https://www.geeksforgeeks.org/0-1-knapsack-problem-dp-10/)
169 | 5. [Matrix Chain Multiplication](https://www.geeksforgeeks.org/matrix-chain-multiplication-dp-8/)
170 | 6. [Longest path in matrix](https://www.geeksforgeeks.org/find-the-longest-path-in-a-matrix-with-given-constraints/ )
171 | 7. [Series of stock problems](https://leetcode.com/problems/best-time-to-buy-and-sell-stock-with-transaction-fee/discuss/108870/Most-consistent-ways-of-dealing-with-the-series-of-stock-problems)
172 |
173 | ## Practice for Dynamic Programming:
174 |
175 | There is no end to DP !!
176 | DP can be combined with trees, graphs, bitmasking, strings, etc.
177 |
178 | For practice I would suggest try to increase your level by doing easy -> medium -> hard question.
179 | Many questions are there to practice on leetcode, hackerearth ( my fav sites)
180 | - [Leetcode](https://leetcode.com/tag/dynamic-programming/)
181 | - [hackerearth 1D-DP](https://www.hackerearth.com/practice/algorithms/dynamic-programming/introduction-to-dynamic-programming-1/practice-problems/)
182 | - [hackerearth 2D-DP](https://www.hackerearth.com/practice/algorithms/dynamic-programming/2-dimensional/practice-problems/)
183 | - [Atcoder DP](https://atcoder.jp/contests/dp/tasks)
184 |
185 | Some of the important questions I will add here ( mostly hard category )
186 |
187 | For easy questions just sit and read GFG question list. DO not waste too much time on easy questions.
188 |
189 | Best of luck for you preparation !!
190 |
191 | ## Hard problems
192 |
193 | Try these questions after you have a firm grasp of DP.
194 |
195 |
196 | 1. [Unique Paths](https://leetcode.com/problems/unique-paths/)
197 | 2. [Longest Increasing Subsequence](https://leetcode.com/problems/longest-increasing-subsequence/)
198 | 3. [Longest Valid Parenthesis](https://leetcode.com/problems/longest-valid-parentheses/ )
199 | 4. [Palindrome partitioning](https://leetcode.com/problems/palindrome-partitioning-ii/ )
200 | 5. [Maximum Sum BST](https://leetcode.com/problems/maximum-sum-bst-in-binary-tree/ )
201 | 7. [Distinct subsequences](https://leetcode.com/problems/distinct-subsequences/ )
202 | 8. [best time to buy and sell stock-iii](https://leetcode.com/problems/best-time-to-buy-and-sell-stock-iii/ )
203 | 9. [cheapest flight within k stops](https://leetcode.com/problems/cheapest-flights-within-k-stops/ )
204 | 10. [Evaluate expression to true](https://www.interviewbit.com/problems/evaluate-expression-to-true/)
205 | 11. [Maximum Product Subarray](https://leetcode.com/problems/maximum-product-subarray/)
206 | 12. [Burst Balloons](https://leetcode.com/problems/burst-balloons/)
207 |
--------------------------------------------------------------------------------