Q. In which scenario would you prefer using Dijkstra's algorithm over A* search algorithm?
A.
When you need to find the shortest path in a grid
B.
When the heuristic is not available
C.
When the graph has negative weights
D.
When you need to find all paths
Show solution
Solution
Dijkstra's algorithm is preferred when there is no heuristic available, as A* relies on heuristics to guide its search.
Correct Answer:
B
— When the heuristic is not available
Learn More →
Q. In which scenario would you prefer using Dijkstra's algorithm over the Bellman-Ford algorithm?
A.
When the graph has negative weights
B.
When the graph is dense
C.
When the graph has non-negative weights
D.
When you need to find all pairs shortest paths
Show solution
Solution
Dijkstra's algorithm is preferred when the graph has non-negative weights, as it is more efficient in such cases compared to Bellman-Ford.
Correct Answer:
C
— When the graph has non-negative weights
Learn More →
Q. In which scenario would you prefer using linear regression over other algorithms?
A.
When the relationship between variables is non-linear
B.
When you need to classify data into categories
C.
When you want to predict a continuous outcome with a linear relationship
D.
When the data is unstructured
Show solution
Solution
Linear regression is preferred when predicting a continuous outcome variable that has a linear relationship with the independent variables.
Correct Answer:
C
— When you want to predict a continuous outcome with a linear relationship
Learn More →
Q. In which scenario would you prefer using LSTMs over traditional RNNs?
A.
When the input data is static.
B.
When the sequences are very short.
C.
When the sequences have long-term dependencies.
D.
When computational resources are limited.
Show solution
Solution
LSTMs are preferred when dealing with sequences that have long-term dependencies due to their ability to remember information over time.
Correct Answer:
C
— When the sequences have long-term dependencies.
Learn More →
Q. In which scenario would you prefer using Support Vector Machines over other algorithms?
A.
When the dataset is very large
B.
When the data is linearly separable
C.
When the data has a high dimensionality
D.
When interpretability is crucial
Show solution
Solution
Support Vector Machines are particularly effective in high-dimensional spaces, making them suitable for datasets with many features.
Correct Answer:
C
— When the data has a high dimensionality
Learn More →
Q. In which scenario would you prefer using SVM over decision trees?
A.
When interpretability is crucial
B.
When the dataset is very large
C.
When the data is high-dimensional and sparse
D.
When the data is categorical
Show solution
Solution
SVM is preferred in high-dimensional and sparse datasets, as it can effectively find the optimal hyperplane in such spaces.
Correct Answer:
C
— When the data is high-dimensional and sparse
Learn More →
Q. In which scenario would you prefer using SVM over logistic regression?
A.
When the dataset is small
B.
When the classes are linearly separable
C.
When the dataset has a high number of features
D.
When interpretability is crucial
Show solution
Solution
SVMs are particularly effective in high-dimensional spaces, making them suitable for datasets with many features.
Correct Answer:
C
— When the dataset has a high number of features
Learn More →
Q. In which scenario would you prefer using SVM over other algorithms?
A.
When the dataset is very large
B.
When the data is linearly separable
C.
When the data has a high dimensionality
D.
When the data is highly imbalanced
Show solution
Solution
SVM is particularly effective in high-dimensional spaces, making it suitable for datasets with many features.
Correct Answer:
C
— When the data has a high dimensionality
Learn More →
Q. In which scenario would you prefer using SVM over other classification algorithms?
A.
When the dataset is very large
B.
When the data is linearly separable
C.
When the data has a high dimensionality
D.
When the data is highly imbalanced
Show solution
Solution
SVM is particularly effective in high-dimensional spaces, making it suitable for datasets with many features.
Correct Answer:
C
— When the data has a high dimensionality
Learn More →
Q. In which scenario would you prefer using the Matthews correlation coefficient?
A.
When dealing with binary classification problems
B.
When evaluating multi-class classification problems
C.
When the dataset is highly imbalanced
D.
All of the above
Show solution
Solution
The Matthews correlation coefficient is a robust metric that can be used for both binary and multi-class classification, especially in imbalanced datasets.
Correct Answer:
D
— All of the above
Learn More →
Q. In which scenario would you prioritize recall over precision?
A.
When false positives are more costly than false negatives
B.
When false negatives are more costly than false positives
C.
When the dataset is balanced
D.
When you need a high overall accuracy
Show solution
Solution
In scenarios where missing a positive case (false negative) is more critical, such as in medical diagnoses, recall should be prioritized over precision.
Correct Answer:
B
— When false negatives are more costly than false positives
Learn More →
Q. In which scenario would you typically use a CNN?
A.
Predicting stock prices
B.
Classifying images
C.
Analyzing text data
D.
Clustering customer segments
Show solution
Solution
CNNs are primarily used for classifying images due to their ability to capture spatial hierarchies in visual data.
Correct Answer:
B
— Classifying images
Learn More →
Q. In which scenario would you typically use a Convolutional Neural Network (CNN)?
A.
Time series prediction
B.
Image classification
C.
Text generation
D.
Reinforcement learning
Show solution
Solution
CNNs are specifically designed for processing structured grid data like images, making them ideal for image classification tasks.
Correct Answer:
B
— Image classification
Learn More →
Q. In which scenario would you use a binary tree for data storage?
A.
When data needs to be accessed in a sorted manner
B.
When data is static and does not change
C.
When data is accessed randomly
D.
When data is sequentially processed
Show solution
Solution
Binary trees are ideal for scenarios where data needs to be stored and accessed in a sorted manner, allowing for efficient searching.
Correct Answer:
A
— When data needs to be accessed in a sorted manner
Learn More →
Q. In which scenario would you use a binary tree to represent hierarchical data?
A.
File system structure
B.
Social network connections
C.
Web page links
D.
All of the above
Show solution
Solution
Binary trees can effectively represent hierarchical data structures such as file systems, where each node can represent a directory or file.
Correct Answer:
A
— File system structure
Learn More →
Q. In which scenario would you use a shadow deployment strategy?
A.
When you want to completely replace an old model
B.
When you want to test a new model without affecting users
C.
When you want to gather user feedback
D.
When you want to scale the model
Show solution
Solution
Shadow deployment allows testing a new model in production without affecting the user experience, as it runs alongside the existing model.
Correct Answer:
B
— When you want to test a new model without affecting users
Learn More →
Q. In which scenario would you use linear regression?
A.
Predicting customer churn
B.
Forecasting sales revenue based on advertising spend
C.
Classifying emails as spam or not spam
D.
Segmenting customers into different groups
Show solution
Solution
Linear regression is suitable for forecasting sales revenue based on advertising spend, as it involves predicting a continuous variable.
Correct Answer:
B
— Forecasting sales revenue based on advertising spend
Learn More →
Q. In which scenario would you use reinforcement learning?
A.
When you have labeled data for training
B.
When the model needs to learn from interactions with an environment
C.
When you want to cluster data points
D.
When you need to predict a continuous outcome
Show solution
Solution
Reinforcement learning is used when a model learns from interactions with an environment, optimizing actions based on rewards.
Correct Answer:
B
— When the model needs to learn from interactions with an environment
Learn More →
Q. In which scenario would you use unsupervised learning for embeddings?
A.
When labeled data is available
B.
When you want to classify text
C.
When you want to discover patterns in unlabeled text
D.
When you need to evaluate model performance
Show solution
Solution
Unsupervised learning is used to discover patterns in unlabeled text, such as clustering or generating embeddings.
Correct Answer:
C
— When you want to discover patterns in unlabeled text
Learn More →
Q. In which traversal method are nodes visited in ascending order for a binary search tree?
A.
Pre-order
B.
In-order
C.
Post-order
D.
Level-order
Show solution
Solution
In In-order traversal of a binary search tree, nodes are visited in ascending order.
Correct Answer:
B
— In-order
Learn More →
Q. In which traversal method are nodes visited in the order of left child, root, right child?
A.
Pre-order
B.
Post-order
C.
In-order
D.
Level-order
Show solution
Solution
In In-order traversal, nodes are visited in the order of left child, root, and then right child.
Correct Answer:
C
— In-order
Learn More →
Q. In which traversal method are nodes visited in the order of left subtree, root, right subtree?
A.
In-order
B.
Pre-order
C.
Post-order
D.
Level-order
Show solution
Solution
In In-order traversal, nodes are visited in the order of left subtree, root, and then right subtree.
Correct Answer:
A
— In-order
Learn More →
Q. In which traversal method are nodes visited level by level?
A.
In-order
B.
Post-order
C.
Pre-order
D.
Level-order
Show solution
Solution
Level-order traversal visits nodes level by level, starting from the root.
Correct Answer:
D
— Level-order
Learn More →
Q. In which traversal method do you visit the left subtree, then the root, and finally the right subtree?
A.
Pre-order
B.
In-order
C.
Post-order
D.
Level-order
Show solution
Solution
In In-order traversal, the left subtree is visited first, followed by the root node, and then the right subtree.
Correct Answer:
B
— In-order
Learn More →
Q. What assumption is made about the residuals in linear regression?
A.
They should be normally distributed
B.
They should be correlated with the predictors
C.
They should have a non-constant variance
D.
They should be positive
Show solution
Solution
One of the key assumptions of linear regression is that the residuals (errors) should be normally distributed.
Correct Answer:
A
— They should be normally distributed
Learn More →
Q. What color is the root node of a Red-Black tree?
A.
Red
B.
Black
C.
It can be either
D.
None of the above
Show solution
Solution
The root node of a Red-Black tree is always black, which helps maintain the properties of the tree.
Correct Answer:
B
— Black
Learn More →
Q. What condition must be met for Dijkstra's algorithm to work correctly?
A.
All edge weights must be positive
B.
The graph must be a tree
C.
All nodes must be connected
D.
The graph must be directed
Show solution
Solution
Dijkstra's algorithm requires that all edge weights be non-negative to ensure that the shortest path is correctly identified.
Correct Answer:
A
— All edge weights must be positive
Learn More →
Q. What data structure is commonly used to implement Dijkstra's algorithm efficiently?
A.
Array
B.
Linked List
C.
Priority Queue
D.
Stack
Show solution
Solution
A priority queue is used in Dijkstra's algorithm to efficiently retrieve the next node with the smallest tentative distance.
Correct Answer:
C
— Priority Queue
Learn More →
Q. What data structure is commonly used to implement Dijkstra's algorithm?
A.
Array
B.
Stack
C.
Priority Queue
D.
Linked List
Show solution
Solution
A priority queue is commonly used in Dijkstra's algorithm to efficiently retrieve the next node with the smallest tentative distance.
Correct Answer:
C
— Priority Queue
Learn More →
Q. What data structure is commonly used to implement the priority queue in Dijkstra's algorithm?
A.
Array
B.
Linked List
C.
Binary Heap
D.
Stack
Show solution
Solution
A binary heap is commonly used to implement the priority queue in Dijkstra's algorithm, allowing efficient extraction of the minimum element.
Correct Answer:
C
— Binary Heap
Learn More →
Showing 661 to 690 of 3237 (108 Pages)