Interview Ready Flashcards
(73 cards)
3
A
function isAlphanumeric(char) {
return /^[0-9a-zA-Z]+$/.test(char);
}
let formatted = s.toLowerCase().split(“”).filter(isAlphanumeric);
25
[remove-nth-node-from-end-of-list](https://leetcode.com/problems/remove-nth-node-from-end-of-list/)
26
[lowest-common-ancestor-of-a-binary-search-tree](https://leetcode.com/problems/lowest-common-ancestor-of-a-binary-search-tree/)
27
[linked-list-cycle](https://leetcode.com/problems/linked-list-cycle/)
28
[binary-tree-level-order-traversal](https://leetcode.com/problems/binary-tree-level-order-traversal/)
29
[validate-binary-search-tree](https://leetcode.com/problems/validate-binary-search-tree/)
30
[kth-smallest-element-in-a-bst](https://leetcode.com/problems/kth-smallest-element-in-a-bst/)
31
[construct-binary-tree-from-preorder-and-inorder-traversal](https://leetcode.com/problems/construct-binary-tree-from-preorder-and-inorder-traversal/)
32
[implement-trie-prefix-tree](https://leetcode.com/problems/implement-trie-prefix-tree/)
33
[design-add-and-search-words-data-structure](https://leetcode.com/problems/design-add-and-search-words-data-structure/)
34
[combination-sum](https://leetcode.com/problems/combination-sum/)
35
[word-search](https://leetcode.com/problems/word-search/)
36
[number-of-islands](https://leetcode.com/problems/number-of-islands/)
37
[clone-graph](https://leetcode.com/problems/clone-graph/)
38
[pacific-atlantic-water-flow](https://leetcode.com/problems/pacific-atlantic-water-flow/)
39
[course-schedule](https://leetcode.com/problems/course-schedule/)
40
[house-robber](https://leetcode.com/problems/house-robber/)
41
[longest-palindromic-substring](https://leetcode.com/problems/longest-palindromic-substring/)
42
[palindromic-substrings](https://leetcode.com/problems/palindromic-substrings/)
43
[decode-ways](https://leetcode.com/problems/decode-ways/)
44
[coin-change](https://leetcode.com/problems/coin-change/)
45
[maximum-product-subarray](https://leetcode.com/problems/maximum-product-subarray/)
46
[word-break](https://leetcode.com/problems/word-break/)
47
[longest-increasing-subsequence](https://leetcode.com/problems/longest-increasing-subsequence/)
48
[unique-paths](https://leetcode.com/problems/unique-paths/)
49
[longest-common-subsequence](https://leetcode.com/problems/longest-common-subsequence/)
50
[maximum-subarray](https://leetcode.com/problems/maximum-subarray/)
51
[jump-game](https://leetcode.com/problems/jump-game/)
52
[insert-interval](https://leetcode.com/problems/insert-interval/)
53
[merge-intervals](https://leetcode.com/problems/merge-intervals/)
54
[non-overlapping-intervals](https://leetcode.com/problems/non-overlapping-intervals/)
55
[meeting-rooms-ii](https://leetcode.com/problems/meeting-rooms-ii/)
56
[rotate-image](https://leetcode.com/problems/rotate-image/)
57
[spiral-matrix](https://leetcode.com/problems/spiral-matrix/)
58
[set-matrix-zeroes](https://leetcode.com/problems/set-matrix-zeroes/)
59
[sum-of-two-integers](https://leetcode.com/problems/sum-of-two-integers/)
60
[minimum-window-substring](https://leetcode.com/problems/minimum-window-substring/)
61
[merge-k-sorted-lists](https://leetcode.com/problems/merge-k-sorted-lists/)
62
[binary-tree-maximum-path-sum](https://leetcode.com/problems/binary-tree-maximum-path-sum/)
63
[serialize-and-deserialize-binary-tree](https://leetcode.com/problems/serialize-and-deserialize-binary-tree/)
64
[word-search-ii](https://leetcode.com/problems/word-search-ii/)
65
[find-median-from-data-stream](https://leetcode.com/problems/find-median-from-data-stream/)
66
[min-cost-to-connect-all-points](https://leetcode.com/problems/min-cost-to-connect-all-points/)
67
What is the Big O complexity of the Array.sort() method in Javascript?
A) O(1)
B) O(log n)
C) O(n)
D) O(n log n)
D
68
What is the time complexity of a Depth-First Search (DFS) algorithm on a graph with V vertices and E edges?
A) O(V)
B) O(E)
C) O(V + E)
D) O(V * E)
C) O(V + E)
The time complexity of Depth-First Search (DFS) on a graph with V vertices and E edges is typically O(V + E).
69
What is the time complexity of a Breadth-First Search (BFS) algorithm on a graph with V vertices and E edges?
A) O(V)
B) O(E)
C) O(V + E)
D) O(V * E)
C) O(V + E)
The time complexity of Breadth-First Search (BFS) on a graph with V vertices and E edges is typically O(V + E).
70
[climbing-stairs](https://leetcode.com/problems/climbing-stairs/)
71
What is the time complexity of Binary Search when searching for an element in a sorted array with n elements?
A) O(1)
B) O(log n)
C) O(n)
D) O(n log n)
B) O(log n)
Binary Search has a time complexity of O(log n) when searching for an element in a sorted array with n elements.
72
In which scenario should you consider using Topological Sort?
A) Calculating the shortest path in a weighted graph.
B) Finding the strongly connected components in a directed graph.
C) Detecting a cycle in an undirected graph.
D) Scheduling tasks with dependencies.
D) Scheduling tasks with dependencies.
Option C is incorrect because Topological Sort is not typically used for detecting cycles in undirected graphs. Instead, it is primarily used for directed acyclic graphs (DAGs).
73
[lru-cache](https://leetcode.com/problems/lru-cache/)