wayground logo

Free Printable Worksheets

NEW

Font size

S
M
L
XL
Worksheets

Section A — Machine Learning & Data Science (1–15)

Total questions: 50

Worksheet time: 25mins

Name
Class
Date
1.

In K-Means clustering, which statement is TRUE regarding cluster initialization?

a)

Random initialization always gives optimal clusters

b)

K-Means++ improves initialization by spreading out centroids

c)

K-Means++ is slower than random initialization by O(n²)

d)

K-Means++ requires PCA beforehand

2.

When using TF-IDF for text features, IDF helps to:

a)

Increase weight of common words

b)

Reduce weight of rare words

c)

Reduce weight of frequent words

d)

Remove the need for tokenization

3.

In a Random Forest classifier, increasing the number of trees generally leads to:

a)

More variance

b)

Higher bias

c)

Lower variance

d)

Poor generalization

4.

What is the computational complexity of training K-Means (Lloyd’s algorithm)?

a)

O(k)

b)

O(n)

c)

O(nkd)

d)

O(n²d)

5.

PCA is used in a Human Activity Recognition pipeline mainly to:

a)

Reduce overfitting by increasing features

b)

Reduce dimensionality and noise

c)

Increase variance in input features

d)

Improve K-Means centroid accuracy directly

6.

Cosine similarity is preferred over Euclidean distance in TF-IDF because:

a)

Euclidean distance is scale independent

b)

Cosine similarity ignores magnitude and focuses on orientation

c)

Cosine similarity requires dense vectors

d)

TF-IDF cannot use Euclidean distance

7.

In a movie recommendation system, Pickle is used primarily to:

a)

Train models

b)

Visualize similarity scores

c)

Serialize vectorizers/models for faster loading

d)

Reduce dataset size

8.

In Naive Bayes sentiment analysis, “naive” refers to the:

a)

Strong dependence between features

b)

Assumption of feature independence

c)

Lack of training data

d)

Simplification of target labels

9.

A major drawback of TF-IDF in NLP is:

a)

It considers word order

b)

It generates dense matrices

c)

It ignores semantic meaning

d)

It cannot be used with sparse matrices

10.

Logistic Regression uses which function for output?

a)

ReLU

b)

Softmax

c)

Sigmoid

d)

TanH

11.

In unsupervised activity recognition, clustering performance is measured using:

a)

Accuracy

b)

Silhouette score

c)

RMSE

d)

MAE

12.

When training ML on big data using Spark MLlib, data is stored as:

a)

Lists

b)

Pandas DataFrames

c)

RDDs or Spark DataFrames

d)

Datasets

13.

The elbow method in K-Means looks for:

a)

Maximum inertia

b)

Optimal k where inertia sharply drops

c)

Minimum Silhouette Score

d)

Cluster purity

14.

In sentiment analysis, stemming helps by:

a)

Expanding vocabulary

b)

Reducing inflectional forms to a root

c)

Converting vectors to one-hot encoding

d)

Eliminating stopwords automatically

15.

Random Forest reduces overfitting compared to Decision Trees by:

a)

Pruning nodes

b)

Bagging + feature randomness

c)

Gradient boosting

d)

Cross-entropy optimization

16.

In Pandas, df.apply() is slower than vectorized operations because:

a)

A. It uses NumPy internally

b)

B. It applies Python functions row-by-row

c)

C. It converts data to strings

d)

D. It requires parallel processing

17.

In NumPy, broadcasting works when:

a)

Arrays have the same shape

b)

Smaller array can expand along size-1 dimensions

c)

Arrays must be reshaped manually

d)

Arrays must be 2D

18.

Scikit-learn’s Train/Test Split shuffles data to:

a)

Reduce variance

b)

Ensure random distribution and avoid ordering bias

c)

Make training faster

d)

Increase dataset size

19.

Matplotlib’s plt.show() does:

a)

Saves the figure

b)

Sends the figure to GPU

c)

Renders the figure

d)

Creates a subplot layout

20.

In Rasa, the NLU pipeline mainly:

a)

Stores conversation history

b)

Converts user input into structured intent + entities

c)

Handles database connections

d)

Deploys chatbots on cloud

21.

Streamlit reruns the entire script on interaction because:

a)

It compiles code

b)

It uses a reactive architecture

c)

It stores UI in session state

d)

It reloads external CSS

22.

Gradio is mainly used for:

a)

Backend logic

b)

Training deep learning models

c)

Fast interactive ML model demos

d)

Cloud hosting

23.

Pickle files can be dangerous because:

a)

They get corrupted easily

b)

They execute arbitrary code when loaded

c)

They use too much memory

d)

They need internet access

24.

In Python, multiprocessing is preferred over multithreading for ML because:

a)

A. ML is I/O bound

b)

B. Python's GIL limits CPU-bound threading

c)

C. Multiprocessing is slower

d)

D. Multithreading cannot use NumPy

25.

In Scikit-learn pipelines, transformers must implement:

a)

.fit() only

b)

.predict() only

c)

.transform()

d)

.compile()

26.

In embedding-based recommenders, cosine similarity is used because embeddings are:

a)

Dense and magnitude-sensitive

b)

Sparse

c)

Direction-sensitive

d)

One-hot vectors

27.

27. Word embeddings like Word2Vec capture:

a)

Grammar only

b)

Contextual semantic relationships

c)

Frequency alone

d)

Character-level dependencies

28.

In mood-based audio classification, spectral features like MFCC help because they:

a)

Capture pitch, tone & patterns of sound

b)

Represent lyrics

c)

Remove background noise completely

d)

Are language independent

29.

In sentiment analysis, the bag-of-words model fails at:

a)

Counting word frequency

b)

Capturing order & negation

c)

Converting text into numbers

d)

Tokenization

30.

A major limitation of cosine similarity recommenders is:

a)

Cannot scale beyond 100 users

b)

Cannot handle cold-start problems

c)

Requires deep learning

d)

Does not work with TF-IDF

31.

Logistic Regression works well in sentiment analysis because:

a)

It handles non-linear relationships

b)

It performs well on high-dimensional sparse text

c)

It needs large GPU clusters

d)

It is unsupervised

32.

In clustering Spotify songs by mood, the K in K-Means represents:

a)

Features

b)

Audio signals

c)

Number of clusters

d)

Training epochs

33.

TF-IDF creates which kind of matrix?

a)

Dense matrix

b)

Sparse matrix

c)

Normalized confusion matrix

d)

PCA matrix

34.

Stopword removal helps sentiment analysis by:

a)

Removing useful adjectives

b)

Removing common, low-information words

c)

Increasing vocabulary

d)

Improving word order

35.

PCA transforms data by:

a)

Maximizing dimensionality

b)

Finding directions of maximum variance

c)

Compressing labels

d)

Performing clustering

36.

In AWS, which service is best suited for hosting a scalable ML API?

a)

S3

b)

Lambda

c)

EC2

d)

CloudFront

37.

37. In SQL, the best index for searching text patterns is:

a)

Full-text index

b)

Primary key index

c)

Unique index

d)

Clustered index

38.

Firebase uses which model for backend data?

a)

Relational

b)

Document-based NoSQL

c)

Graph

d)

Columnar

39.

In Git, git rebase is used to:

a)

Merge branches with linear commit history

b)

Delete history

c)

Clone repositories

d)

Push tags

40.

JavaScript’s event loop manages:

a)

CPU-bound threads

b)

Asynchronous callbacks and promises

c)

HTML rendering

d)

Only frontend network calls

41.

In REST APIs, POST is used to:

a)

Retrieve resources

b)

Update resources partially

c)

Create a new resource

d)

Delete a resource

42.

Deploying a Streamlit app on Render requires specifying:

a)

Python version

b)

NodeJS version

c)

Manifest.json

d)

Webpack config

43.

PostgreSQL is preferred over MySQL for ML pipelines because:

a)

It supports JSONB & advanced indexing

b)

It is slower

c)

It does not support joins

d)

It is NoSQL

44.

In web deployment, CORS is required when:

a)

API and frontend are hosted on different domains

b)

JavaScript code is too long

c)

CSS is missing

d)

Database fails

45.

In Node.js, async/await is primarily used to:

a)

Speed up CPU tasks

b)

Make asynchronous code easier to read

c)

Spawn threads

d)

Connect to databases automatically

46.

A 500 Internal Server Error indicates:

a)

Bad request format

b)

Authentication failure

c)

Server-side processing failure

d)

Resource not found

47.

GitHub Actions is used for:

a)

Local debugging

b)

CI/CD automation

c)

Database indexing

d)

Writing unit tests

48.

Which SQL command removes duplicate rows?

a)

SELECT *

b)

GROUP BY only

c)

DISTINCT

d)

HAVING

49.

In a full-stack project, frontend authentication tokens are stored securely in:

a)

Local storage (not secure)

b)

Session storage

c)

Encrypted HTTP-only cookies

d)

URL parameters

50.

AWS S3 buckets are best used for:

a)

Storing ML models, static files, datasets

b)

Running Python scripts

c)

Deploying applications

d)

Executing SQL queries