Sample Technical Interview Questions - Set 31 (20 Questions) (Pages 142)

• Q1: Jewels and Stones.
• Q2: Word Ladder 2 - given the begin and the end word and a list of words in a dictionary, find all shortest transformation sequence(s) from beginWord to endWord.
• Q3: Remove invalid parentheses - remove the minimum number of parentheses in order to make the input string valid.
• Q4: Meeting rooms 2 - given an array of meeting time intervals consisting of start and end times, find the minimum number of conference rooms required.
• Q5: Alien dictionary: derive the order of the letters in a new language (toplogical sorting)
• Q6: Reconstruct itinerary (Euler path for directed graph)
• Q7: Max area of island.
• Q8: Merge two binary trees
• Q9: Integer to English words
• Q10: Max stack - design a max stack that supports the operations push, pop, top, peekMax and popMax. PeekMax() should retrieve the maximum element on the stack. PopMax() should retrieve the max element on the stack and remove it.
• Q11: Exclusive time of funtions: given the running logs of 'n' functions that are executed in a non-preemptive single threaded CPU, find the exclusive time of these functions.
• Q12: Binary tree maximum sum path
• Q13: Sliding window median (solution using multiset)
• Q14: Network delay time - given times, a list of travel times as directed edges times[i] = (u, v, w) where 'u' is the source node, 'v is the target node, and 'w' is the time it takes for a signal to travel from source to target. When you send a signal from a certain node 'k', how long will it take for the signal to reach all other nodes? (application of dijkstra's shortest path algorithm).
• Q15: k-closest points to origin
• Q16: Most common word - given a paragraph and a list of banned words, return the most frequent word that is not in the list of banned words.
• Q17: Snakes and Ladders problem (application of bfs)
• Q18: Find k-pairs with smallest sum - you are given two integer arrays nums1 and nums2 sorted in ascending order and integer 'k'. Find k-pairs (u1,v1), (u2, v2), ... with the smallest sums (where one number of pair should be from array1 and the other should be from array2)
• Q19: Maximum frequency stack - push(int x) should push an integer 'x' on to the stack and pop() should remove the most-frequent element on the stack.
• Q20: k-th largest element in the stream

Sample Technical Interview Questions - Set 32 (20 Questions) (Pages 143)

• Q1: Peeking Iterator (284): given an iterator with methods `next()` and `hasNext()`, design and implement a peeking-iterator.
• Q2: Design search auto-complete system (application of trie data structure)
• Q3: Word Search II: given a 2D board and a list of words from the dictionary, find all the words in the board.
• Q4: Find K closest elements: given a sorted array, find k closest elements to a given element 'x' in the array.
• Q6: Backspace string compare
• Q7: Divide two integers: given two integers `dividend` and `divisor`, divide them without using multiplication, division and mode operator.
• Q8: Guess the word: find the secret word from the list of words by guessing a given number of times.
• Q9: Most stones removed with same row or column
• Q10: Maximize distance to closest person
• Q11: Logger rate limiter
• Q12: Sum root to leaf numbers (on a binary tree consisting of digits from 0-9 on each node)
• Q13: Rotate string
• Q14: Serialize and Deserialize N-ary tree
• Q15: Random pick with weight (weighted/stratified sampling problem)
• Q16: Text justification
• Q17: Palindromic substring
• Q18: Knight Dialer
• Q19: Unique Paths II
• Q20: Reverse Linked List II: reverse a linked list from position m to n (in one pass)

Sample Technical Interview Questions - Set 33 (20 Questions) (Pages 117)

• Q1: Sort list (148)
• Q2: Reverse words in a string III (557)
• Q3: Reverse only letters (917)
• Q4: Plus One linked list (369)
• Q5: Next greater node in linked list (1019)
• Q6: Daily Temperatures (739)
• Q7: Subdomain visit count (811)
• Q8: Coin change 2 (518)
• Q9: Arranging coins (441)
• Q10: Verifying alien dictionary (953)
• Q11: Maximum gap (164)
• Q12: Range Max query (segment tree)
• Q13: Odd even linked list (328)
• Q14: Map sum pairs (677)
• Q15: Replace words (648)
• Q16: All nodes dstance K in binary tree (863)
• Q17: Best time to buy and sell stocks III (123)
• Q18: Distance between bus stops (1184)
• Q19: Max consecutive ones III (1004)
• Q20: Longest Repeating character replacement (424)

Sample Technical Interview Questions - Set 34 (20 Questions) (Pages 134)

• Q1: Accounts Merge (721)
• Q2: LFU (Least Frequently Used) Cache (460)
• Q3: Delete Nodes and Return Forest (1110)
• Q4: Find object in a grid
• Q5: Magic Squares in grid (840)
• Q6: Largest Unique Number (1133)
• Q7: Find function arguments
• Q8: Minimum Domino Rotations for equal row (1007)
• Q9: Campus Bikes (1057)
• Q10: Shortest way to form string (1055)
• Q11: Compare strings by frequency of the smallest character (1170)
• Q12: Minimum area Rectangle (939)
• Q13: Split array largest sum (410)
• Q14: Longest consecutive sequence (128)
• Q15: Cracking the safe (753)
• Q16: Time based key-value store (981)
• Q17: Construct a binary tree from preorder and postorder traversal (889)
• Q18: String compression (443)
• Q19: Stream of characters (1032)
• Q20: Minimum cost to hire K workers (857)

Sample Technical Interview Questions - Set 35 (20 Questions) (Pages 134)

• Q1: Brace expansion (1087)
• Q2: Minimum Window Subsequence (72)
• Q3: Implement Logger
• Q4: Minimum step to reach the state.
• Q5: Open the lock (752)
• Q7: Sliding Puzzle (773)
• Q8: System design for online ticket booking system
• Q9: Number of Islands II (305)
• Q10: Surrounded Regions (130)
• Q11: My Calendar I (729)
• Q12: My Calendar II (731)
• Q13: My Calendar III (732)
• Q14: Busy Traffic
• Q15: Interval List Intersections (986)
• Q16: Capacity to ship packages within D days (1011)
• Q17: Split array into consecutive subsequences (659)
• Q18: Confusing number (1056)
• Q19: Car Fleet (853)
• Q20: Max chunks to make sorted (769)

Sample Technical Interview Questions - Set 36 (20 Questions) (Pages 158)

• Q1: Minimum Height Trees (310)
• Q2: Longest string chain (1048)
• Q3: Design Snake game (353)
• Q4: Search in a sorted array of unknown size (702)
• Q5: Find the smallest letter greater than target. (744)
• Q6: Hand of Straights. (846)
• Q7: Reorganize string (767)
• Q8: Path with Maximum gold (1219)
• Q9: Exam room (855)
• Q10: Reveal cards in increasing order (950)
• Q11: Subarray product less than k (713)
• Q12: Single element in a sorted array (540)
• Q13: Design Circular queue (622)
• Q14: Check completeness of a binary tree (958)
• Q15: Flatten a multi-level doubly linked list (430)
• Q16: Longest Arithmetic Sequence (1027)
• Q17: LOngest Common Subsequence (1143)
• Q18: Image Overlap (835)
• Q19: Is Graph Bipartite (785)
• Q20: Find and Replace string (833)

Sample Technical Interview Questions - Set 37 (20 Questions) (Pages 134)

• Q1: Guess Number Higher or Lower (374)
• Q2: Sentence Similarity (734)
• Q3: Sentence Similarity II (737)
• Q4: Snapshot Array (1146)
• Q5: Recover Binary Search Tree (99)
• Q6: Split BST (776)
• Q7: Flip Equivalent Binary Trees (951)
• Q8: Similar String Groups (839)
• Q9: Binary Tree Coloring Game (1145)
• Q11: Print in Order (1114)
• Q12: Find Duplicate Subtrees (652)
• Q13: All Paths From Source to Target (797)
• Q14: Invalid Transactions (1169)
• Q15: Next Greater Element I (496)
• Q16: Next Greater Element I (503)
• Q17: Elimination Game (390)
• Q18: Candy Crush (723)
• Q19: Cousins in Binary Tree (993)
• Q20: Maximum Length of Pair Chain (646)

Sample Technical Interview Questions - Set 38 (20 Questions) (Pages 132)

• Q1: Remove All Adjacent Duplicates In String (1047)
• Q2: Maximum Width of Binary Tree (662)
• Q3: Missing Element in Sorted Array (1060)
• Q4: Longest Turbulent Subarray (978)
• Q5: Data Structure design question: Insert O(1), Delete O(1), Lookup O(1) & should be able to traverse the added elements in the order in which they were inserted.
• Q6: Min number of steps to generate n from 1 (asked in Bloomberg Interview)
• Q7: Candy Crush 1D - removing consecutive identical characters (Bloomberg Interview)
• Q8: Palindrome Number (9)
• Q9: Index Pairs of a String (1065)
• Q10: Index Pairs of a String (1029)
• Q11: Most active stocks
• Q12: Count Univalue Subtrees (250)
• Q13: Critical Connections in a Network (1192)
• Q14: Minimize Malware Spread (924)
• Q15: Swap Adjacent in LR String (777)
• Q16: Shortest Bridge (934)
• Q17: Keys and Rooms (841)
• Q18: Find Eventual Safe States (802)
• Q19: Combinations (77)