Interview Ready Flashcards

1
A
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
A
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
A

function isAlphanumeric(char) {
return /^[0-9a-zA-Z]+$/.test(char);
}

let formatted = s.toLowerCase().split(“”).filter(isAlphanumeric);

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
A

A) maxProfit = prices[i] - minPrice;

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
A
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
A
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
A
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
A
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
A
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
A

T

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
A
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
A
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
13
A
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
14
A
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
15
A
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
16
Q
A
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
17
A
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
18
A
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
19
A
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
20
A
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
21
A
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
22
A
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
23
A
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
24
A
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
25
A
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
26
A
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
27
A
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
28
A
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
29
A
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
35
A
37
A
40
A
43
A
44
A
46
A
48
A
51
A
56
A
57
A
67
Q

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)

A

D

68
Q

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)

A

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
Q

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)

A

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).

71
Q

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)

A

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
Q

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.

A

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
A