-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathquestion.json
123 lines (123 loc) · 4.05 KB
/
question.json
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
{
"easy": [
{
"question": "What is the time complexity of accessing an element in an array?",
"options": ["O(1)", "O(n)", "O(log n)", "O(n log n)"],
"correctAnswer": "O(1)"
},
{
"question": "Which data structure uses LIFO (Last In, First Out) order?",
"options": ["Queue", "Stack", "Array", "Linked List"],
"correctAnswer": "Stack"
},
{
"question": "What data structure is typically used to implement recursion?",
"options": ["Queue", "Stack", "Tree", "Graph"],
"correctAnswer": "Stack"
},
{
"question": "Which of the following is a linear data structure?",
"options": ["Tree", "Graph", "Stack", "Heap"],
"correctAnswer": "Stack"
},
{
"question": "What is the primary operation of a queue data structure?",
"options": ["Push", "Pop", "Enqueue", "Dequeue"],
"correctAnswer": "Enqueue"
},
{
"question": "Which data structure would you use for implementing a priority queue?",
"options": ["Queue", "Heap", "Stack", "Array"],
"correctAnswer": "Heap"
}
],
"medium": [
{
"question": "What is the primary advantage of a hash table over an array?",
"options": [
"Faster search times",
"More memory usage",
"Supports dynamic resizing",
"Simpler implementation"
],
"correctAnswer": "Faster search times"
},
{
"question": "In a binary search tree, which node can have the largest value?",
"options": [
"The leftmost node",
"The rightmost node",
"The root node",
"Any node can have the largest value"
],
"correctAnswer": "The rightmost node"
},
{
"question": "What is the time complexity of inserting an element into a balanced binary search tree?",
"options": ["O(1)", "O(n)", "O(log n)", "O(n log n)"],
"correctAnswer": "O(log n)"
},
{
"question": "Which data structure is used for breadth-first search (BFS) traversal?",
"options": ["Queue", "Stack", "Array", "Hash Table"],
"correctAnswer": "Queue"
},
{
"question": "What is the space complexity of an adjacency matrix representation of a graph?",
"options": ["O(V)", "O(E)", "O(V^2)", "O(E log V)"],
"correctAnswer": "O(V^2)"
},
{
"question": "Which algorithm is used to find the shortest path in a weighted graph with non-negative weights?",
"options": [
"Dijkstra's Algorithm",
"Bellman-Ford Algorithm",
"Floyd-Warshall Algorithm",
"Kruskal's Algorithm"
],
"correctAnswer": "Dijkstra's Algorithm"
}
],
"hard": [
{
"question": "What is the space complexity of a recursive solution for calculating Fibonacci numbers?",
"options": ["O(n)", "O(log n)", "O(1)", "O(n^2)"],
"correctAnswer": "O(n)"
},
{
"question": "Which of the following sorting algorithms is not a comparison-based sort?",
"options": ["Merge Sort", "Heap Sort", "Quick Sort", "Radix Sort"],
"correctAnswer": "Radix Sort"
},
{
"question": "What is the time complexity of the worst-case scenario for quicksort?",
"options": ["O(n)", "O(n log n)", "O(n^2)", "O(log n)"],
"correctAnswer": "O(n^2)"
},
{
"question": "In a doubly linked list, which pointer is used to traverse the list in reverse?",
"options": [
"Next pointer",
"Previous pointer",
"Head pointer",
"Tail pointer"
],
"correctAnswer": "Previous pointer"
},
{
"question": "What is the worst-case time complexity of inserting a new element into an AVL tree?",
"options": ["O(1)", "O(log n)", "O(n)", "O(n log n)"],
"correctAnswer": "O(log n)"
},
{
"question": "Which of the following algorithms is used for finding the Minimum Spanning Tree (MST) of a graph?",
"options": [
"Kruskal's Algorithm",
"Dijkstra's Algorithm",
"Prim's Algorithm",
"A* Search Algorithm"
],
"correctAnswer": "Kruskal's Algorithm"
}
]
}