Sunday 13 October 2019
A repository that contains interview questions for computer engineering positions, together with my answers to the questions. Currently available answers in Python 3.0.
The questions are from the dailyinterviewpro.com mailing list.
| Problem number | Title | Solution | Related LeetCode problem |
|---|---|---|---|
| 1 | Add Two Numbers as a linked list | p1.py | 2 |
| 2 | Longest Substring Without Repeating Characters | p2.py | |
| 3 | Longest Palindromic Substring | p3.py | |
| 4 | Validate Balanced Parentheses | p4.py | |
| 5 | First and Last Indices of an Element in a Sorted Array | p5.py | |
| 6 | Reverse a Linked List | p6.py | |
| 7 | Sorting a list with 3 unique numbers | p7.py | |
| 8 | Two-Sum | p8.py | 1 |
| 9 | Find the non-duplicate number | p9.py | 136 |
| 10 | Non-decreasing Array with Single Modification | p10.py | |
| 11 | Floor and Ceiling of a Binary Search Tree | p11.py | |
| 12 | Invert a Binary Tree | p12.py | |
| 13 | Maximum In A Stack | p13.py | |
| 14 | Number of Ways to Climb Stairs | p14.py | |
| 15 | Find Pythagorean Triplets | p15.py | |
| 16 | Edit Distance | p16.py | |
| 17 | Create a Simple Calculator | ||
| 18 | Longest Sequence with Two Unique Numbers | p18.py | |
| 19 | Find Cycles in a Graph | p19.py | |
| 20 | Word Search | p20.py | |
| 21 | Minimum Size Subarray Sum | p21.py | |
| 22 | Ways to Traverse a Grid | p22.py | |
| 23 | Intersection of Linked Lists | p23.py | 160 |
| 24 | Falling Dominoes | p24.py | 838 |
| 25 | Remove Consecutive Nodes that Sum to 0 | p25.py | 1171 |
| 26 | Remove k-th Last Element From Linked List | p26.py | 19 |
| 27 | Witness of The Tall People | p27.py | |
| 28 | Course Prerequisites | p28.py | 210 |
| 29 | Move Zeros | p29.py | 283 |
| 30 | Find the k-th Largest Element in a List | p30.py | 215 |
| 31 | Spiral Traversal of Grid | p31.py | 54 |
| 32 | Largest Product of 3 Elements | p32.py | 628 |
| 33 | Merge Overlapping Intervals | p33.py | 56 |
| 34 | Maximum Profit From Stocks | p34.py | 121 |
| 35 | Queue Using Two Stacks | p35.py | 232 |
| 36 | Contiguous Subarray with Maximum Sum | p36.py | 53 |
| 37 | Merge K Sorted Linked Lists | p37.py | 23 |
| 38 | Create a balanced binary search tree | p38.py | |
| 39 | Trapping Rainwater | p39.py | 42 |
| 40 | Buddy Strings | p40.py | 859 |
| 41 | Deepest Node in a Binary Tree | p41.py | 104 |
| 42 | Look and Say Sequence | p12.py | 38 |
| 43 | First Missing Positive Integer | p43.py | 41 |
| 44 | Validate Binary Search Tree | p44.py | 98 |
| 45 | Get all Values at a Certain Height in a Binary Tree | p45.py | |
| 46 | Longest Substring With K Distinct Characters | p46.py | |
| 47 | Count Number of Unival Subtrees | p47.py | |
| 48 | Reconstrunct Binary Tree from Preorder and Inorder Traversals | p48.py | 105 |
| 49 | Sort Colors | p49.py | 75 |
| 50 | Word Ordering in a Different Alphabetical Order | p50.py | |
| 51 | 3 Sum | p51.py | 15 |
| 52 | Largest BST in a Binary Tree | p52.py | |
| 53 | Find the Number of Islands | p53.py | 200 |
| 54 | Minimum Removals for Valid Parenthesis | p54.py | |
| 55 | Group Words that are Anagrams | p55.py | 49 |
| 56 | Running Median | p56.py | |
| 57 | Room scheduling | p57.py | |
| 58 | Reverse Words in a String | p58.py | 557 |
| 59 | Merge List Of Number Into Ranges | p59.py | 228 |
| 60 | Product of Array Except Self | p60.py | 238 |
| 61 | Given two arrays, write a function to compute their intersection. | p61.py | 349 |
| 62 | Longest Increasing Subsequence | p62.py | 300 |
| 63 | Angles of a Clock | p63.py | |
| 64 | Arithmetic Binary Tree | p64.py | |
| 65 | Tree Serialization | p65.py | 297 |
| 66 | Distribute Bonuses | p66.py | |
| 67 | Min Range Needed to Sort | p67.py | 581 |