
























































































Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
This page cannot be seen from the preview
Don't miss anything!

























































































Question 1. Which matrix property is essential for Principal Component Analysis (PCA) to reduce dimensionality? A) Orthogonality of rows B) Positive definiteness of the covariance matrix C) Sparsity of the data matrix D) Symmetry of the weight matrix Answer: B Explanation: PCA uses the eigenâdecomposition of the covariance matrix, which must be symmetric and positiveâdefinite to guarantee real, nonânegative eigenvalues representing variance. Question 2. In gradient descent, what does a learning rate that is too large typically cause? A) Faster convergence to the global minimum B) Divergence or oscillation around the minimum C) Elimination of all local minima D) No effect on the convergence speed Answer: B Explanation: An excessively large learning rate overshoots the optimum, leading to divergence or perpetual oscillation instead of stable convergence. Question 3. Which probability distribution is most appropriate for modeling the number of successes in a fixed number of independent Bernoulli trials? A) Gaussian distribution B) Poisson distribution C) Binomial distribution D) Exponential distribution Answer: C
Explanation: The binomial distribution describes the count of successes in a fixed number of independent trials with two outcomes (success/failure). Question 4. The time complexity of training a decision tree using the CART algorithm on a dataset with n samples and m features is closest to: A) O(n log n) B) O(m log n) C) O(n m log n) D) O(nÂČ m) Answer: C Explanation: At each split, the algorithm scans all m features for n samples, and there are O(log n) expected levels, yielding O(n m log n). Question 5. When performing oneâhot encoding on a categorical variable with k distinct categories, the resulting feature space dimensionality becomes: A) k â 1 B) k C) logâk D) âk Answer: B Explanation: Oneâhot encoding creates k binary columns, each representing one category. Question 6. Which loss function is most appropriate for binary classification using logistic regression? A) Mean Squared Error B) Hinge loss C) Binary CrossâEntropy
B) Reduce dimensionality while maintaining local neighbor relationships C) Perform linear projection onto principal components D) Cluster data into predefined groups Answer: B Explanation: tâSNE emphasizes preserving local structure, mapping similar highâdimensional points close together in low dimensions. Question 10. In Random Forests, what technique is used to decorrelate individual decision trees? A) Gradient boosting B) Bagging with replacement and random feature selection at each split C) Pruning of deep branches D) Using a single deterministic tree per forest Answer: B Explanation: Random Forests combine bagging (sampling with replacement) and random subset of features per split, reducing correlation among trees. Question 11. Which of the following is a key advantage of Gradient Boosted Trees over Random Forests? A) Parallel training of all trees B) Higher resistance to overfitting without hyperâparameter tuning C) Ability to sequentially correct errors of previous trees, often achieving higher accuracy D) Simpler interpretability of individual trees Answer: C Explanation: Gradient boosting builds trees sequentially, each focusing on residuals of the prior model, typically yielding superior predictive performance.
Question 12. In a multilayer perceptron (MLP), which activation function suffers from vanishing gradients for large positive inputs? A) ReLU B) Sigmoid C) Leaky ReLU D) ELU Answer: B Explanation: The sigmoidâs derivative approaches zero as inputs become large, causing vanishing gradients during backpropagation. Question 13. The convolution operation in CNNs is primarily used to: A) Increase the dimensionality of the input data B) Capture spatial hierarchies by applying learnable filters over local regions C) Perform matrix inversion efficiently D) Encode sequential dependencies Answer: B Explanation: Convolutional filters slide over an image, extracting local patterns and building hierarchical feature representations. Question 14. Which layer type is typically used in CNNs for reducing spatial resolution while retaining important features? A) Fully connected layer B) Dropout layer C) MaxâPooling layer D) Batch normalization layer Answer: C
D) Generate image captions directly Answer: B Explanation: Bidirectional LSTMs process the sequence forward and backward, providing each time step with information from both directions. Question 18. Generative Adversarial Networks (GANs) consist of two networks that: A) Share the same weights during training B) Compete, where the generator creates data and the discriminator evaluates realism C) Operate sequentially, first generating then classifying data D) Are both discriminators that vote on data authenticity Answer: B Explanation: In a GAN, the generator tries to produce realistic samples while the discriminator learns to distinguish real from fake, forming a minimax game. Question 19. In a Variational Autoencoder (VAE), the loss function combines reconstruction loss with: A) L1 regularization B) KLâdivergence between the approximate posterior and the prior C) Crossâentropy between input and output D) Euclidean distance between latent vectors Answer: B Explanation: VAEs optimize a variational lower bound that includes a KLâdivergence term encouraging the latent distribution to match a chosen prior (usually Gaussian). Question 20. Which preprocessing step converts raw text into a fixedâsize numerical vector by counting term frequencies and scaling by inverse document frequency? A) Tokenization
B) Stemming C) TFâIDF vectorization D) Oneâhot encoding Answer: C Explanation: TFâIDF weights each term by its frequency in a document and inversely by its frequency across the corpus, yielding informative fixedâsize vectors. Question 21. Word2Vecâs âskipâgramâ model is designed to: A) Predict surrounding context words given a target word B) Predict the target word from its surrounding context C) Generate word embeddings by autoencoding the entire document D) Cluster words into semantic groups without supervision Answer: A Explanation: Skipâgram learns embeddings by maximizing the probability of context words conditioned on a central target word. Question 22. Which transformer component allows each token to attend to every other token in the same sequence? A) Positional encoding B) Feedâforward network C) Selfâattention mechanism D) Layer normalization Answer: C Explanation: Selfâattention computes pairwise attention scores among all tokens, enabling global context modeling.
Question 26. RetrievalâAugmented Generation (RAG) combines a language model with: A. A reinforcement learning agent B. An external knowledge base accessed via similarity search C. A convolutional neural network for image inputs D. A ruleâbased grammar parser Answer: B Explanation: RAG retrieves relevant documents from a vector store and feeds them to the LLM, grounding generation in upâtoâdate information. Question 27. Which Python library provides the DataFrame structure most commonly used for data manipulation in AI pipelines? A. NumPy B. Pandas C. SciPy D. Matplotlib Answer: B Explanation: Pandas introduces the DataFrame, a tabular data structure with powerful indexing, filtering, and aggregation capabilities. Question 28. In NumPy, the operation np.dot(A, B) performs: A. Elementâwise multiplication B. Matrix multiplication (linear algebra dot product) C. Concatenation of arrays D. Computation of the Kronecker product Answer: B
Explanation: np.dot computes the dot product of two arrays, which for 2âD arrays corresponds to matrix multiplication. Question 29. Scikitâlearnâs Pipeline class is primarily used to: A. Parallelize model training across GPUs B. Chain preprocessing steps and a final estimator into a single object C. Visualize decision boundaries D. Perform hyperparameter optimization automatically Answer: B Explanation: Pipeline encapsulates a sequence of transforms (e.g., scaling, encoding) followed by an estimator, ensuring consistent application during training and inference. Question 30. Which Keras callback helps prevent overfitting by stopping training when validation loss stops improving? A. ModelCheckpoint B. EarlyStopping C. ReduceLROnPlateau D. TensorBoard Answer: B Explanation: EarlyStopping monitors a metric (e.g., validation loss) and halts training when no improvement is observed for a specified patience. Question 31. In PyTorch, the function torch.autograd.backward() is used to: A. Compute forward passes only B. Perform gradient backpropagation for tensors with requires_grad=True C. Initialize model weights randomly
B. O(n log n) C. O(nÂł) D. O(2âż) Answer: C Explanation: The naĂŻve algorithm computes each of the nÂČ output entries via n multiplications, yielding O(nÂł) operations. Question 35. Which of the following statements about eigenvalues of a covariance matrix is true? A. They can be negative because variance can be negative. B. They always sum to zero. C. They are always nonânegative, reflecting variance along principal components. D. They are complex numbers in realâvalued data. Answer: C Explanation: A covariance matrix is symmetric and positive semiâdefinite; its eigenvalues represent variances and are therefore nonânegative. Question 36. When applying L2 regularization (Ridge) to linear regression, the penalty term added to the loss function is: A. λ · â|wᔹ| B. λ · âwᔹÂČ C. λ · âwᔹ³ D. λ · âlog|wᔹ| Answer: B Explanation: L2 regularization adds λ times the sum of squared weights, encouraging smaller but nonâzero coefficients.
Question 37. Which evaluation metric is most appropriate for imbalanced binary classification where the positive class is rare? A. Accuracy B. Mean Squared Error C. Area Under the ROC Curve (AUCâROC) D. RÂČ score Answer: C Explanation: AUCâROC assesses the tradeâoff between trueâpositive and falseâpositive rates across thresholds, remaining informative under class imbalance. Question 38. In kâfold crossâvalidation with k = 5, each model is trained on what proportion of the data? A. 20% B. 40% C. 60% D. 80% Answer: D Explanation: In 5âfold CV, each iteration holds out 1/5 (20%) for validation and trains on the remaining 4/5 (80%). Question 39. Which of the following is a common technique to address overfitting in deep neural networks? A. Increasing the number of hidden layers indefinitely B. Adding dropout layers that randomly deactivate neurons during training C. Removing activation functions D. Using a larger batch size only Answer: B
C. Guarantees translation invariance D. Adds nonâlinearity without activation functions Answer: B Explanation: Stride > 1 skips positions during convolution, producing a smaller output map (downsampling). Question 43. Which data augmentation technique is most suitable for improving robustness of image classifiers to lighting variations? A. Random cropping B. Horizontal flipping C. Color jitter (brightness/contrast adjustments) D. Rotation by 90 degrees Answer: C Explanation: Color jitter modifies brightness, contrast, saturation, helping the model generalize across lighting conditions. Question 44. In reinforcement learning, the Bellman equation relates: A. Policy gradients to loss functions B. The value of a state to the expected return of subsequent states C. The gradient of the reward function to the action space D. Exploration rate to exploitation rate Answer: B Explanation: The Bellman equation expresses a stateâs value as the immediate reward plus the discounted value of the next state under a policy. Question 45. Which of the following best describes âtransfer learningâ in deep learning?
A. Training a model from scratch on a new dataset B. Fineâtuning a preâtrained model on a related downstream task C. Sharing weights between unrelated architectures D. Converting a supervised model to unsupervised mode Answer: B Explanation: Transfer learning reuses knowledge from a source task (preâtrained weights) and adapts it to a target task, often with limited data. Question 46. In the context of LLMs, âfewâshot promptingâ means: A. Providing the model with only a few training epochs B. Supplying a small number of example inputâoutput pairs within the prompt C. Using a tiny model architecture with few parameters D. Training the model on a few thousand tokens Answer: B Explanation: Fewâshot prompting includes a handful of demonstrations in the prompt to guide the modelâs behavior without gradient updates. Question 47. Which loss function is commonly used to train a GANâs discriminator? A. Mean Absolute Error B. Binary CrossâEntropy C. Hinge loss D. Wasserstein loss (Earth Moverâs Distance) Answer: B Explanation: Traditional GANs use binary crossâentropy to classify real versus generated samples; Wasserstein GANs use a different loss.
Explanation: ETL describes the process of extracting raw data, transforming it into a usable format, and loading it into storage or a model. Question 51. Which statistical test is appropriate for comparing the means of two independent groups when the data are normally distributed? A. Chiâsquare test B. Paired tâtest C. Independent twoâsample tâtest D. MannâWhitney U test Answer: C Explanation: The independent twoâsample tâtest assesses mean differences between two unrelated groups under normality assumptions. Question 52. In Bayesian inference, the posterior distribution is proportional to: A. Prior Ă Likelihood B. Prior Ă· Likelihood C. Likelihood Ă· Prior D. Prior + Likelihood Answer: A Explanation: Bayesâ theorem states Posterior â Prior Ă Likelihood, updating beliefs after observing data. Question 53. Which regularization technique randomly zeroes out entire feature maps in a convolutional layer during training? A. Dropout B. DropConnect C. Spatial Dropout
D. Batch Normalization Answer: C Explanation: Spatial Dropout drops whole channels (feature maps) rather than individual activations, encouraging robustness across filters. Question 54. In a sequenceâtoâsequence model with attention, the attention weights are computed by: A. Averaging the encoder hidden states B. Applying a softmax over similarity scores between decoder state and each encoder state C. Concatenating encoder and decoder states directly D. Using maxâpooling over encoder outputs Answer: B Explanation: Attention scores (e.g., dotâproduct) are passed through softmax to produce a distribution over encoder positions, guiding the decoder. Question 55. Which of the following is a deterministic alternative to stochastic gradient descent that uses secondâorder information? A. Newtonâs method B. Adam C. RMSprop D. Momentum SGD Answer: A Explanation: Newtonâs method leverages the Hessian (secondâorder derivatives) to compute exact update directions, unlike firstâorder stochastic methods. Question 56. When fineâtuning a BERT model for a classification task, which layer is typically added on top of the preâtrained transformer?