80 questions

- 1. Open EndedTrapping rain water problem
- 2. Open EndedRepeated String Match Given two strings A and B, find the minimum number of times A has to be repeated such that B is a substring of it. If no such solution, return -1. For example, with A = "abcd" and B = "cdabcdab". Return 3, because by repeating A three times ("abcdabcdabcd"), B is a substring of it; and B is not a substring of A repeated two times ("abcdabcd").
- 3. Open EndedRabin-Karp Algorithm
- 4. Open EndedFind a pattern of length M in a search string of length N (usually N >> M)
- 5. Open EndedHeight of a binary tree
- 6. Open EndedBinary search tree
- 7. Open EndedRolling hash for string comparison
- 8. Open EndedHow to find substring in doc
- 9. Open EndedNext closest time given hr:mn string
- 10. Open EndedK Empty Slots
- 11. Open EndedLongest Substring with At Most K Distinct Characters
- 12. Open EndedWhy Messaging Queue
- 13. Open EndedUtility Class
- 14. Open EndedSingleton, and is it thread safe?
- 15. Open EndedFind k smallest items
- 16. Open Endedin a binary tree, the last row has how many leaves if full
- 17. Open Endedarray index of parent of i in maxHeap
- 18. Open Endedleft/right child of i in maxHeap
- 19. Open EndedData structures used for DFS and BFS
- 20. Open EndedImplement stack using 2 queues
- 21. Open EndedQueue from 2 stacks
- 22. Open EndedData Structure for LRU cache
- 23. Open Endedhow to check if tree is BST
- 24. Open Endedheight of binary tree
- 25. Open Endedfind middle of a linked list
- 26. Open EndedHow is a trie node represented
- 27. Open EndedComplexity to make trie, insert and search
- 28. Open EndedMemoization
- 29. Open EndedTabulation vs memoization
- 30. Open EndedWhen to use memoization vs tabulation
- 31. Open EndedOptimal Substructure
- 32. Open EndedGreedy algos and optimal substructure
- 33. Open EndedLongest increasing subsequence
- 34. Open Endedword edit distance (insert, delete, replace)
- 35. Open EndedCode for word edit distance
- 36. Open EndedWorst case for quicksort
- 37. Open EndedMinimum Cost path given a 2-d array of numbers, can only go right or down, min path from top left to bottom right
- 38. Open EndedAdjacency Matrix
- 39. Open EndedAdjacency List
- 40. Open EndedBFS graph
- 41. Open EndedDFS graph
- 42. Open EndedRemove invalid parentheses from string, enter all valid substrings that have the minimum number of removals. can be more than just one substring
- 43. Open EndedGiven preorder and inorder traversal of a tree, construct the binary tree (suboptimal)
- 44. Open EndedGiven preorder and inorder traversal of a tree, construct the binary tree (optimal)
- 45. Open EndedHeight of a heap and given i, who is parent, left child, right child
- 46. Open EndedTiny URL shortener (has to be unique)
- 47. Open EndedInvert binary tree
- 48. Open Endedfind all possible subtree sums of a binary tree. then output a list of the most common sums (many if ties)
- 49. Open EndedIn a MxN matrix, that is sorted row rise and column wise (in ascending order), count # of negative numbers
- 50. Open EndedCount # of palindromic substrings
- 51. Open EndedFrog crossing river given stones[] array, given position of ith stone If the frog's last jump was k units, then its next jump must be either k - 1, k, or k + 1 units. Note that the frog can only jump in the forward direction. Given a list of stones' positions (in units) in sorted ascending order, determine if the frog is able to cross the river by landing on the last stone. Initially, the frog is on the first stone and assume the first jump must be 1 unit.
- 52. Open EndedBest meeting point A group of two or more people wants to meet and minimize the total travel distance. You are given a 2D grid of values 0 or 1, where each 1 marks the home of someone in the group.
- 53. Open EndedBurst balloon problem:
- 54. Open EndedLongest common Subsequence between 2 input strings
- 55. Open EndedFibonacci number
- 56. Open EndedMaximum subsequent sum
- 57. Open EndedBuying and Selling Stock (more than once) (without cooldown) The cost of a stock on each day is given in an array, find the max profit that you can make by buying and selling in those days
- 58. Open EndedCalculate XOR from 1 to n.
- 59. Open EndedCount number of set bits in number
- 60. Open Endedmiddle index of array given start,end
- 61. Open EndedFind unique element in sorted array
- 62. Open EndedPrint tree in level order
- 63. Open EndedDaily temperature array, for each element, say the # of days until next warmer temperature
- 64. Open EndedFind duplicate in array of n+1 numbers [1,n]
- 65. Open EndedGiven a linked list, return the node where the cycle begins. If there is no cycle, return null.
- 66. Open EndedIterative inorder traversal (left, root, right) so basically leftmost onwards
- 67. Open EndedGenerate all combinations of N pairs of parentheses
- 68. Open EndedFirst unique character in sequence
- 69. Open EndedReverse a string
- 70. Open EndedReverse words in a given string (reverse a sentence)
- 71. Open EndedFind two nums that sum to X in an array
- 72. Open EndedMaximum Size Subarray Sum Equals k
- 73. Open EndedCompare version numbers
- 74. Open EndedRemove Nth Node From End of List
- 75. Open EndedTime complexity of building a heap
- 76. Open EndedSplit array with positives on 1 side and negatives on the other
- 77. Open EndedFind LCA given pointers to root and nodeA, nodeB
- 78. Open EndedFind min number of coins to make a sum V
- 79. Open EndedMerge K sorted lists
- 80. Open EndedPigeonhole sort
- Answer choicesTagsAnswer choicesTags