Artificial Intelligence and ML questions

Learning types, algorithms, evaluation metrics and deep learning basics.

1. Machine learning is best described as:

  1. A programming language
  2. Robots that walk
  3. A type of database
  4. Systems that learn patterns from data instead of following only hand-written rules
Answer

D. Systems that learn patterns from data instead of following only hand-written rules ML models improve from data.

2. Which type of learning uses labelled data?

  1. Transfer learning only
  2. Unsupervised learning
  3. Reinforcement learning
  4. Supervised learning
Answer

D. Supervised learning Each training example has a known answer (label).

3. Grouping customers by similar buying habits without labels is an example of:

  1. Reinforcement learning
  2. Regression
  3. Clustering (unsupervised learning)
  4. Classification
Answer

C. Clustering (unsupervised learning) No labels are given, so it is unsupervised clustering.

4. Predicting house prices from size and location is a:

  1. Search problem
  2. Clustering problem
  3. Classification problem
  4. Regression problem
Answer

D. Regression problem The output is a continuous number.

5. Deciding whether an email is spam or not is a:

  1. Regression problem
  2. Sorting problem
  3. Clustering problem
  4. Classification problem
Answer

D. Classification problem The output is one of two classes.

6. In reinforcement learning, an agent learns by:

  1. Copying a teacher's code
  2. Reading labelled examples
  3. Clustering data
  4. Receiving rewards or penalties for its actions
Answer

D. Receiving rewards or penalties for its actions Agents maximise cumulative reward.

7. Overfitting means a model:

  1. Performs poorly on training data
  2. Is too simple
  3. Has too little data to load
  4. Performs well on training data but poorly on new data
Answer

D. Performs well on training data but poorly on new data It memorises noise instead of the general pattern.

8. Which technique helps reduce overfitting?

  1. Regularisation
  2. Using fewer validation checks
  3. Training longer without limits
  4. Removing the test set
Answer

A. Regularisation Regularisation penalises overly complex models.

9. Why is data split into training and test sets?

  1. To make training faster only
  2. To check how the model performs on unseen data
  3. Because models need two copies
  4. To double the data
Answer

B. To check how the model performs on unseen data The test set estimates real-world performance.

10. Precision is defined as:

  1. Correct predictions ÷ all predictions
  2. True positives ÷ (true positives + false positives)
  3. False positives ÷ all negatives
  4. True positives ÷ (true positives + false negatives)
Answer

B. True positives ÷ (true positives + false positives) Precision: of predicted positives, how many are right.

11. Recall is defined as:

  1. True positives ÷ (true positives + false positives)
  2. True negatives ÷ all predictions
  3. True positives ÷ (true positives + false negatives)
  4. False negatives ÷ all positives
Answer

C. True positives ÷ (true positives + false negatives) Recall: of actual positives, how many were found.

12. A model gets 90 of 100 test examples right. Its accuracy is:

  1. 0.09%
  2. 90%
  3. 10%
  4. 100%
Answer

B. 90% Accuracy = correct ÷ total.

13. Which algorithm predicts a class from the majority vote of the closest data points?

  1. k-Nearest Neighbours
  2. Linear regression
  3. Apriori
  4. k-Means
Answer

A. k-Nearest Neighbours k-NN looks at the k nearest neighbours.

14. k-Means is used for:

  1. Sorting
  2. Classification with labels
  3. Regression
  4. Clustering
Answer

D. Clustering k-Means groups data into k clusters.

15. A decision tree splits data based on:

  1. Feature values that best separate the classes
  2. The size of the file
  3. Alphabetical order
  4. Random numbers only
Answer

A. Feature values that best separate the classes Splits aim to make groups purer (e.g. by information gain).

16. Random Forest is:

  1. A single deep neural network
  2. A clustering method
  3. A type of database index
  4. An ensemble of many decision trees
Answer

D. An ensemble of many decision trees It averages many trees to improve accuracy.

17. Logistic regression is mainly used for:

  1. Clustering
  2. Image generation
  3. Predicting continuous values
  4. Binary classification
Answer

D. Binary classification It outputs a probability for a class.

18. What is a neural network loosely inspired by?

  1. Compilers
  2. Spreadsheets
  3. The human brain
  4. Relational databases
Answer

C. The human brain Layers of connected artificial neurons.

19. What does an activation function add to a neural network?

  1. More data
  2. Storage
  3. Non-linearity
  4. Labels
Answer

C. Non-linearity Without non-linear activations, stacked layers act like one linear layer.

20. Which activation outputs max(0, x)?

  1. Softmax
  2. Sigmoid
  3. ReLU
  4. Tanh
Answer

C. ReLU ReLU keeps positives and zeroes negatives.

21. Backpropagation is used to:

  1. Compute gradients to update the network's weights
  2. Label the data
  3. Deploy the model
  4. Collect more data
Answer

A. Compute gradients to update the network's weights It propagates the error backwards to adjust weights.

22. Which type of network is best known for image tasks?

  1. Decision tree
  2. Convolutional Neural Network (CNN)
  3. Recurrent Neural Network only
  4. k-Means
Answer

B. Convolutional Neural Network (CNN) Convolutions capture local image patterns.

23. Gradient descent tries to:

  1. Increase the data size
  2. Sort the features
  3. Maximise the loss function
  4. Minimise the loss function
Answer

D. Minimise the loss function It moves weights in the direction that reduces loss.

24. The learning rate controls:

  1. How many layers there are
  2. How much data is used
  3. How big each weight update step is
  4. The number of classes
Answer

C. How big each weight update step is Too high can overshoot; too low trains slowly.

25. An epoch is:

  1. One test example
  2. One weight update
  3. One full pass through the training data
  4. One layer of the network
Answer

C. One full pass through the training data Training usually runs several epochs.

26. Natural Language Processing (NLP) deals with:

  1. Understanding and generating human language
  2. Database indexing
  3. Processing images only
  4. Network routing
Answer

A. Understanding and generating human language Examples: translation, chatbots, sentiment analysis.

27. Tokenisation in NLP means:

  1. Encrypting text
  2. Deleting stop words only
  3. Translating text
  4. Splitting text into smaller units such as words or sub-words
Answer

D. Splitting text into smaller units such as words or sub-words Tokens are the basic units a model processes.

28. Sentiment analysis determines:

  1. The length of a text
  2. The author of a text
  3. Whether text expresses a positive, negative or neutral opinion
  4. The language of a text
Answer

C. Whether text expresses a positive, negative or neutral opinion It classifies opinion or emotion.

29. Which library is widely used for classical machine learning in Python?

  1. Pandas only for plotting
  2. Flask
  3. React
  4. scikit-learn
Answer

D. scikit-learn scikit-learn provides standard ML algorithms.

30. Which Python library is mainly used for data frames?

  1. NumPy only
  2. pandas
  3. Requests
  4. Matplotlib
Answer

B. pandas pandas offers the DataFrame.

31. Feature scaling (e.g. normalisation) is important because:

  1. Features on very different scales can distort many algorithms
  2. It adds labels
  3. It removes all outliers
  4. It makes data larger
Answer

A. Features on very different scales can distort many algorithms Distance-based and gradient methods are sensitive to scale.

32. Handling missing values by replacing them with the column mean is called:

  1. Augmentation
  2. Normalisation
  3. Imputation
  4. Regularisation
Answer

C. Imputation Imputation fills in missing data.

33. Bias in an AI system often comes from:

  1. Too many test cases
  2. Fast hardware
  3. Using Python
  4. Unrepresentative or skewed training data
Answer

D. Unrepresentative or skewed training data Models learn the patterns, including the biases, in their data.

34. Which is an example of AI in everyday life?

  1. Recommendations on a video streaming app
  2. A light switch
  3. A paper notebook
  4. A basic calculator
Answer

A. Recommendations on a video streaming app Recommendations come from learned user preferences.

35. The Turing Test checks whether:

  1. A computer is fast enough
  2. A machine's conversation is indistinguishable from a human's
  3. Code has no bugs
  4. A network is secure
Answer

B. A machine's conversation is indistinguishable from a human's Proposed by Alan Turing in 1950.

36. A confusion matrix shows:

  1. Training time
  2. The model's source code
  3. The network's layers
  4. Counts of true and false positives and negatives
Answer

D. Counts of true and false positives and negatives It summarises classification results.

37. Cross-validation is used to:

  1. Label data automatically
  2. Estimate model performance more reliably using several train/test splits
  3. Increase training speed
  4. Remove features
Answer

B. Estimate model performance more reliably using several train/test splits k-fold cross-validation rotates the test fold.

38. Transfer learning means:

  1. Training from scratch every time
  2. Reusing a model trained on one task as a starting point for another
  3. Copying code between projects
  4. Moving data between servers
Answer

B. Reusing a model trained on one task as a starting point for another It saves data and compute.

39. Dimensionality reduction technique PCA stands for:

  1. Primary Cluster Algorithm
  2. Partial Correlation Average
  3. Principal Component Analysis
  4. Predictive Classification Approach
Answer

C. Principal Component Analysis PCA finds directions of maximum variance.

40. Computer vision is the field that enables computers to:

  1. Store files
  2. Write SQL queries
  3. Interpret images and video
  4. Route network packets
Answer

C. Interpret images and video Examples: face detection, object recognition.

41. Which algorithm groups unlabelled data into k clusters?

  1. Naive Bayes
  2. Logistic regression
  3. Linear regression
  4. K-means
Answer

D. K-means K-means is unsupervised clustering.

42. Overfitting means a model:

  1. Has too little data to train
  2. Always generalises well
  3. Does poorly on training data
  4. Does well on training data but poorly on new data
Answer

D. Does well on training data but poorly on new data It has memorised noise in the training data.

43. Which technique reduces overfitting by randomly switching off neurons during training?

  1. Dropout
  2. Padding
  3. Pooling
  4. Batch size
Answer

A. Dropout Dropout forces the network not to rely on single neurons.

44. Precision is defined as:

  1. (TP + TN) / total
  2. TP / (TP + FN)
  3. TP / (TP + FP)
  4. FP / (FP + TN)
Answer

C. TP / (TP + FP) Of the predicted positives, how many were right.

45. Recall is defined as:

  1. TN / (TN + FP)
  2. TP / (TP + FN)
  3. TP / (TP + FP)
  4. (TP + TN) / total
Answer

B. TP / (TP + FN) Of the actual positives, how many were found.

46. Which activation function outputs max(0, x)?

  1. Tanh
  2. Sigmoid
  3. Softmax
  4. ReLU
Answer

D. ReLU ReLU passes positive values and zeroes negatives.

47. Splitting data into k parts and training k times, each time testing on a different part, is:

  1. Gradient descent
  2. Feature scaling
  3. K-fold cross-validation
  4. Bagging
Answer

C. K-fold cross-validation It gives a more reliable estimate of performance.

48. Which model is best known for image recognition?

  1. Apriori
  2. Decision stump
  3. Convolutional Neural Network (CNN)
  4. K-means
Answer

C. Convolutional Neural Network (CNN) CNNs learn spatial patterns with filters.

49. Random Forest is an example of:

  1. An ensemble of decision trees
  2. A clustering method
  3. A single linear model
  4. A reinforcement learning agent
Answer

A. An ensemble of decision trees It combines many trees trained on random samples.

50. In reinforcement learning, the agent learns from:

  1. Unlabelled clusters
  2. Rewards and penalties from its actions
  3. Labelled examples only
  4. Hand-written rules only
Answer

B. Rewards and penalties from its actions It maximises cumulative reward through trial and error.

51. Gradient descent is used to:

  1. Increase the learning rate forever
  2. Label data automatically
  3. Minimise a loss function by updating parameters
  4. Collect more data
Answer

C. Minimise a loss function by updating parameters It moves parameters in the direction that lowers the loss.

52. Which Python library is most widely used for classical machine learning?

  1. Flask
  2. Pygame
  3. Requests
  4. scikit-learn
Answer

D. scikit-learn scikit-learn offers regression, classification and clustering.

Mock test

More Technical MCQs topics