NEW
Font size
WorksheetsSection A — Machine Learning & Data Science (1–15)
Total questions: 50
Worksheet time: 25mins
In K-Means clustering, which statement is TRUE regarding cluster initialization?
Random initialization always gives optimal clusters
K-Means++ improves initialization by spreading out centroids
K-Means++ is slower than random initialization by O(n²)
K-Means++ requires PCA beforehand
When using TF-IDF for text features, IDF helps to:
Increase weight of common words
Reduce weight of rare words
Reduce weight of frequent words
Remove the need for tokenization
In a Random Forest classifier, increasing the number of trees generally leads to:
More variance
Higher bias
Lower variance
Poor generalization
What is the computational complexity of training K-Means (Lloyd’s algorithm)?
O(k)
O(n)
O(nkd)
O(n²d)
PCA is used in a Human Activity Recognition pipeline mainly to:
Reduce overfitting by increasing features
Reduce dimensionality and noise
Increase variance in input features
Improve K-Means centroid accuracy directly
Cosine similarity is preferred over Euclidean distance in TF-IDF because:
Euclidean distance is scale independent
Cosine similarity ignores magnitude and focuses on orientation
Cosine similarity requires dense vectors
TF-IDF cannot use Euclidean distance
In a movie recommendation system, Pickle is used primarily to:
Train models
Visualize similarity scores
Serialize vectorizers/models for faster loading
Reduce dataset size
In Naive Bayes sentiment analysis, “naive” refers to the:
Strong dependence between features
Assumption of feature independence
Lack of training data
Simplification of target labels
A major drawback of TF-IDF in NLP is:
It considers word order
It generates dense matrices
It ignores semantic meaning
It cannot be used with sparse matrices
Logistic Regression uses which function for output?
ReLU
Softmax
Sigmoid
TanH
In unsupervised activity recognition, clustering performance is measured using:
Accuracy
Silhouette score
RMSE
MAE
When training ML on big data using Spark MLlib, data is stored as:
Lists
Pandas DataFrames
RDDs or Spark DataFrames
Datasets
The elbow method in K-Means looks for:
Maximum inertia
Optimal k where inertia sharply drops
Minimum Silhouette Score
Cluster purity
In sentiment analysis, stemming helps by:
Expanding vocabulary
Reducing inflectional forms to a root
Converting vectors to one-hot encoding
Eliminating stopwords automatically
Random Forest reduces overfitting compared to Decision Trees by:
Pruning nodes
Bagging + feature randomness
Gradient boosting
Cross-entropy optimization
In Pandas, df.apply() is slower than vectorized operations because:
A. It uses NumPy internally
B. It applies Python functions row-by-row
C. It converts data to strings
D. It requires parallel processing
In NumPy, broadcasting works when:
Arrays have the same shape
Smaller array can expand along size-1 dimensions
Arrays must be reshaped manually
Arrays must be 2D
Scikit-learn’s Train/Test Split shuffles data to:
Reduce variance
Ensure random distribution and avoid ordering bias
Make training faster
Increase dataset size
Matplotlib’s plt.show() does:
Saves the figure
Sends the figure to GPU
Renders the figure
Creates a subplot layout
In Rasa, the NLU pipeline mainly:
Stores conversation history
Converts user input into structured intent + entities
Handles database connections
Deploys chatbots on cloud
Streamlit reruns the entire script on interaction because:
It compiles code
It uses a reactive architecture
It stores UI in session state
It reloads external CSS
Gradio is mainly used for:
Backend logic
Training deep learning models
Fast interactive ML model demos
Cloud hosting
Pickle files can be dangerous because:
They get corrupted easily
They execute arbitrary code when loaded
They use too much memory
They need internet access
In Python, multiprocessing is preferred over multithreading for ML because:
A. ML is I/O bound
B. Python's GIL limits CPU-bound threading
C. Multiprocessing is slower
D. Multithreading cannot use NumPy
In Scikit-learn pipelines, transformers must implement:
.fit() only
.predict() only
.transform()
.compile()
In embedding-based recommenders, cosine similarity is used because embeddings are:
Dense and magnitude-sensitive
Sparse
Direction-sensitive
One-hot vectors
27. Word embeddings like Word2Vec capture:
Grammar only
Contextual semantic relationships
Frequency alone
Character-level dependencies
In mood-based audio classification, spectral features like MFCC help because they:
Capture pitch, tone & patterns of sound
Represent lyrics
Remove background noise completely
Are language independent
In sentiment analysis, the bag-of-words model fails at:
Counting word frequency
Capturing order & negation
Converting text into numbers
Tokenization
A major limitation of cosine similarity recommenders is:
Cannot scale beyond 100 users
Cannot handle cold-start problems
Requires deep learning
Does not work with TF-IDF
Logistic Regression works well in sentiment analysis because:
It handles non-linear relationships
It performs well on high-dimensional sparse text
It needs large GPU clusters
It is unsupervised
In clustering Spotify songs by mood, the K in K-Means represents:
Features
Audio signals
Number of clusters
Training epochs
TF-IDF creates which kind of matrix?
Dense matrix
Sparse matrix
Normalized confusion matrix
PCA matrix
Stopword removal helps sentiment analysis by:
Removing useful adjectives
Removing common, low-information words
Increasing vocabulary
Improving word order
PCA transforms data by:
Maximizing dimensionality
Finding directions of maximum variance
Compressing labels
Performing clustering
In AWS, which service is best suited for hosting a scalable ML API?
S3
Lambda
EC2
CloudFront
37. In SQL, the best index for searching text patterns is:
Full-text index
Primary key index
Unique index
Clustered index
Firebase uses which model for backend data?
Relational
Document-based NoSQL
Graph
Columnar
In Git, git rebase is used to:
Merge branches with linear commit history
Delete history
Clone repositories
Push tags
JavaScript’s event loop manages:
CPU-bound threads
Asynchronous callbacks and promises
HTML rendering
Only frontend network calls
In REST APIs, POST is used to:
Retrieve resources
Update resources partially
Create a new resource
Delete a resource
Deploying a Streamlit app on Render requires specifying:
Python version
NodeJS version
Manifest.json
Webpack config
PostgreSQL is preferred over MySQL for ML pipelines because:
It supports JSONB & advanced indexing
It is slower
It does not support joins
It is NoSQL
In web deployment, CORS is required when:
API and frontend are hosted on different domains
JavaScript code is too long
CSS is missing
Database fails
In Node.js, async/await is primarily used to:
Speed up CPU tasks
Make asynchronous code easier to read
Spawn threads
Connect to databases automatically
A 500 Internal Server Error indicates:
Bad request format
Authentication failure
Server-side processing failure
Resource not found
GitHub Actions is used for:
Local debugging
CI/CD automation
Database indexing
Writing unit tests
Which SQL command removes duplicate rows?
SELECT *
GROUP BY only
DISTINCT
HAVING
In a full-stack project, frontend authentication tokens are stored securely in:
Local storage (not secure)
Session storage
Encrypted HTTP-only cookies
URL parameters
AWS S3 buckets are best used for:
Storing ML models, static files, datasets
Running Python scripts
Deploying applications
Executing SQL queries
