Q. In a graph, if you want to check if there is a path between two nodes, which traversal method would be more suitable?
A.
BFS
B.
DFS
C.
Both are equally suitable
D.
Neither is suitable
Show solution
Solution
Both BFS and DFS can be used to check if there is a path between two nodes, but BFS is generally preferred for finding the shortest path.
Correct Answer:
C
— Both are equally suitable
Learn More →
Q. In a graph, if you want to find the shortest path in an unweighted graph, which traversal method would you use?
A.
DFS
B.
BFS
C.
Dijkstra's Algorithm
D.
A* Search
Show solution
Solution
BFS is used to find the shortest path in an unweighted graph because it explores all nodes at the present depth before moving on.
Correct Answer:
B
— BFS
Learn More →
Q. In a graph, which traversal method uses a queue data structure?
A.
DFS
B.
BFS
C.
Both DFS and BFS
D.
Neither DFS nor BFS
Show solution
Solution
BFS (Breadth-First Search) uses a queue to keep track of the next vertex to visit.
Correct Answer:
B
— BFS
Learn More →
Q. In a K-means clustering algorithm, if you have 5 clusters and 100 data points, how many centroids will be initialized?
Show solution
Solution
In K-means clustering, the number of centroids initialized is equal to the number of clusters. Therefore, if there are 5 clusters, 5 centroids will be initialized.
Correct Answer:
A
— 5
Learn More →
Q. In a level-order traversal, which data structure is typically used to keep track of nodes?
A.
Stack
B.
Queue
C.
Array
D.
Linked List
Show solution
Solution
A queue is used in level-order traversal to keep track of nodes at the current level.
Correct Answer:
B
— Queue
Learn More →
Q. In a linear regression case study, what does multicollinearity refer to?
A.
High correlation between the dependent variable and independent variables
B.
High correlation among independent variables
C.
Low variance in the dependent variable
D.
The presence of outliers in the data
Show solution
Solution
Multicollinearity refers to a situation where independent variables in a regression model are highly correlated with each other, which can affect the model's estimates.
Correct Answer:
B
— High correlation among independent variables
Learn More →
Q. In a linear regression model, what does a negative coefficient for an independent variable indicate?
A.
A positive relationship with the dependent variable
B.
No relationship with the dependent variable
C.
A negative relationship with the dependent variable
D.
The variable is not significant
Show solution
Solution
A negative coefficient indicates that as the independent variable increases, the dependent variable tends to decrease.
Correct Answer:
C
— A negative relationship with the dependent variable
Learn More →
Q. In a linear regression model, what does the slope coefficient represent?
A.
The intercept of the regression line
B.
The change in the dependent variable for a one-unit change in the independent variable
C.
The total variance in the dependent variable
D.
The correlation between the independent and dependent variables
Show solution
Solution
The slope coefficient indicates how much the dependent variable is expected to increase (or decrease) when the independent variable increases by one unit.
Correct Answer:
B
— The change in the dependent variable for a one-unit change in the independent variable
Learn More →
Q. In a linear regression model, what does the slope of the regression line represent?
A.
The predicted value of the dependent variable
B.
The change in the dependent variable for a one-unit change in the independent variable
C.
The correlation between the independent and dependent variables
D.
The intercept of the regression line
Show solution
Solution
The slope indicates how much the dependent variable is expected to increase or decrease as the independent variable increases by one unit.
Correct Answer:
B
— The change in the dependent variable for a one-unit change in the independent variable
Learn More →
Q. In a linked list, what is the time complexity of inserting an element at the beginning?
A.
O(n)
B.
O(log n)
C.
O(1)
D.
O(n log n)
Show solution
Solution
Inserting at the beginning of a linked list is a constant time operation, hence O(1).
Correct Answer:
C
— O(1)
Learn More →
Q. In a multi-class classification problem, which metric can be used to evaluate the performance across all classes?
A.
Micro F1 Score
B.
Mean Absolute Error
C.
Precision
D.
Recall
Show solution
Solution
Micro F1 Score aggregates the contributions of all classes to compute the average metric, suitable for multi-class evaluation.
Correct Answer:
A
— Micro F1 Score
Learn More →
Q. In a multi-class classification problem, which metric can be used to evaluate the model's performance across all classes?
A.
Macro F1 Score
B.
Mean Squared Error
C.
Accuracy
D.
Log Loss
Show solution
Solution
Macro F1 Score calculates the F1 Score for each class independently and then takes the average, providing a balanced evaluation across all classes.
Correct Answer:
A
— Macro F1 Score
Learn More →
Q. In a network with a subnet mask of 255.255.255.128, how many hosts can be accommodated?
A.
126
B.
128
C.
254
D.
256
Show solution
Solution
A subnet mask of 255.255.255.128 corresponds to /25, which allows for 2^(32-25) = 2^7 = 128 total addresses. Subtracting 2 for the network and broadcast addresses leaves 126 usable hosts.
Correct Answer:
A
— 126
Learn More →
Q. In a neural network, what does the term 'activation function' refer to?
A.
A method to initialize weights
B.
A function that determines the output of a neuron
C.
A technique for data normalization
D.
A process for training the model
Show solution
Solution
The activation function determines the output of a neuron based on its input, playing a crucial role in the network's ability to learn complex patterns.
Correct Answer:
B
— A function that determines the output of a neuron
Learn More →
Q. In a neural network, what does the term 'backpropagation' refer to?
A.
The process of forward propagation of inputs
B.
The method of updating weights based on error
C.
The initialization of network parameters
D.
The evaluation of model performance
Show solution
Solution
Backpropagation is the algorithm used to update the weights of the network by calculating the gradient of the loss function.
Correct Answer:
B
— The method of updating weights based on error
Learn More →
Q. In a neural network, what is the purpose of the loss function?
A.
To measure the accuracy of predictions
B.
To calculate the gradient
C.
To evaluate model performance
D.
To quantify the difference between predicted and actual values
Show solution
Solution
The loss function quantifies how well the neural network's predictions match the actual target values.
Correct Answer:
D
— To quantify the difference between predicted and actual values
Learn More →
Q. In a neural network, what is the purpose of the output layer?
A.
To process input data
B.
To apply activation functions
C.
To produce the final predictions
D.
To adjust learning rates
Show solution
Solution
The output layer generates the final predictions of the neural network based on the processed information from previous layers.
Correct Answer:
C
— To produce the final predictions
Learn More →
Q. In a priority queue implemented with a binary heap, what is the time complexity for inserting an element?
A.
O(1)
B.
O(log n)
C.
O(n)
D.
O(n log n)
Show solution
Solution
Inserting an element into a binary heap takes O(log n) time due to the need to maintain the heap property after the insertion.
Correct Answer:
B
— O(log n)
Learn More →
Q. In a priority queue implemented with a binary heap, what is the time complexity of inserting an element?
A.
O(1)
B.
O(log n)
C.
O(n)
D.
O(n log n)
Show solution
Solution
Inserting an element into a priority queue implemented with a binary heap has a time complexity of O(log n) due to the need to maintain the heap property.
Correct Answer:
B
— O(log n)
Learn More →
Q. In a queue implemented using a linked list, what operation is performed to add an element?
A.
Push
B.
Enqueue
C.
Pop
D.
Dequeue
Show solution
Solution
The operation to add an element to a queue is called 'enqueue'.
Correct Answer:
B
— Enqueue
Learn More →
Q. In a queue implemented using a linked list, what operation is performed to remove an element?
A.
Pop
B.
Dequeue
C.
Shift
D.
Remove
Show solution
Solution
In a queue, the operation to remove an element is called 'dequeue', which removes the front element.
Correct Answer:
B
— Dequeue
Learn More →
Q. In a queue implemented using an array, what happens when the array is full?
A.
Overflow error
B.
Underflow error
C.
Elements are overwritten
D.
Queue shrinks
Show solution
Solution
When a queue implemented using an array is full, it results in an overflow error as no more elements can be added.
Correct Answer:
A
— Overflow error
Learn More →
Q. In a queue implemented using an array, what is the time complexity of enqueue operation in the worst case?
A.
O(1)
B.
O(n)
C.
O(log n)
D.
O(n^2)
Show solution
Solution
In the worst case, if the array is full and needs to be resized, the enqueue operation can take O(n) time.
Correct Answer:
B
— O(n)
Learn More →
Q. In a queue implemented using two stacks, what is the time complexity of the dequeue operation in the worst case?
A.
O(1)
B.
O(n)
C.
O(log n)
D.
O(n log n)
Show solution
Solution
In the worst case, the dequeue operation may require transferring all elements from one stack to another, resulting in O(n) time complexity.
Correct Answer:
B
— O(n)
Learn More →
Q. In a queue implemented using two stacks, what is the worst-case time complexity for the dequeue operation?
A.
O(1)
B.
O(n)
C.
O(log n)
D.
O(n^2)
Show solution
Solution
In the worst case, the dequeue operation may require transferring all elements from one stack to another, resulting in a time complexity of O(n).
Correct Answer:
B
— O(n)
Learn More →
Q. In a queue, what happens when an element is dequeued?
A.
It is removed from the front
B.
It is removed from the back
C.
It is moved to the front
D.
It is added to the back
Show solution
Solution
In a queue, the dequeue operation removes the element from the front, following the FIFO principle.
Correct Answer:
A
— It is removed from the front
Learn More →
Q. In a queue, what is the time complexity of dequeuing an element?
A.
O(1)
B.
O(n)
C.
O(log n)
D.
O(n^2)
Show solution
Solution
Dequeuing an element from a queue is done in constant time, O(1), when implemented using a linked list.
Correct Answer:
A
— O(1)
Learn More →
Q. In a queue, what is the time complexity of enqueue operation?
A.
O(1)
B.
O(n)
C.
O(log n)
D.
O(n^2)
Show solution
Solution
The enqueue operation in a queue can be performed in constant time, O(1).
Correct Answer:
A
— O(1)
Learn More →
Q. In a queue, what operation is used to remove an element?
A.
Push
B.
Pop
C.
Enqueue
D.
Dequeue
Show solution
Solution
The operation used to remove an element from a queue is called 'Dequeue'.
Correct Answer:
D
— Dequeue
Learn More →
Q. In a queue, which operation is performed in constant time?
A.
Enqueue
B.
Dequeue
C.
Peek
D.
All of the above
Show solution
Solution
All operations (enqueue, dequeue, and peek) can be performed in constant time O(1) in a properly implemented queue.
Correct Answer:
D
— All of the above
Learn More →
Showing 271 to 300 of 3237 (108 Pages)