0% found this document useful (0 votes)
8 views

memory_based_questions

The document outlines various case studies on smart city technologies, including WasteClassifier for waste management using CNN, DroneNav for drone navigation using matrices, MedScan AI for disease detection using SVM and KNN, a Smart Traffic Signal System utilizing Markov Chains, and PCA for traffic pattern analysis. Each case study describes the challenges faced, the machine learning techniques employed, and the outcomes achieved. Additionally, the document includes multiple-choice questions and numerical problems related to the concepts presented in each case study.

Uploaded by

arjun kumar
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
8 views

memory_based_questions

The document outlines various case studies on smart city technologies, including WasteClassifier for waste management using CNN, DroneNav for drone navigation using matrices, MedScan AI for disease detection using SVM and KNN, a Smart Traffic Signal System utilizing Markov Chains, and PCA for traffic pattern analysis. Each case study describes the challenges faced, the machine learning techniques employed, and the outcomes achieved. Additionally, the document includes multiple-choice questions and numerical problems related to the concepts presented in each case study.

Uploaded by

arjun kumar
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 29

MEMORY BASED QUESTIONS - MOCK​



Case Study: WasteClassifier — Smart City Waste
Recognition Using CNN

In the fast-growing Smart City of Ecotown, waste management was becoming a big
challenge. The city wanted to promote recycling but faced one major problem —
people were often confused about where to throw waste items like bottles, plastic
wrappers, food waste, and cans.

To solve this, a young ML engineer named Rehan developed WasteClassifier — an


image-based waste detection system using Convolutional Neural Networks (CNN).
This system was installed near smart dustbins in the city.

Rehan trained the CNN model to classify waste into 5 categories:​


→ Plastic, Metal, Organic, Glass, and Paper.

The input to the model was a 128x128 RGB image of the waste item captured by a
small camera. The first convolution layer of his model used 32 filters of size 3x3,
followed by pooling layers to reduce size, and ReLU activations to introduce
non-linearity. The output layer used Softmax activation to predict the probability of
each class.

The model had about 896 parameters in the first Conv Layer and used a Flatten layer
before the final output.

During testing, Rehan realized that the model worked great on training images but
not so well on real-world images, indicating overfitting. To fix this, he used Data
Augmentation and Transfer Learning techniques to improve performance on unseen
data.
Rehan’s WasteClassifier model is now a part of Ecotown’s smart waste management
system, making the city cleaner and greener.

MCQs based on the Case Study:

1. What is the input size of Rehan’s WasteClassifier CNN model?

a) 64x64x1​
b) 128x128x3​
c) 128x128x1​
d) 256x256x3

2. How many output classes does the model predict?

a) 3​
b) 5​
c) 2​
d) 10

3. What is the purpose of using filters in the Conv Layer?

a) Storing image data​


b) Extracting features like edges, patterns​
c) Increasing image brightness​
d) Reducing accuracy

4. Calculate the number of parameters in the first Conv Layer with 32


filters of size 3x3x3.
a) 288​
b) 864​
c) 896​
d) 32

5. Which activation function did Rehan use in hidden layers?

a) Softmax​
b) ReLU​
c) Sigmoid​
d) Linear

6. The purpose of the Flatten Layer is:

a) Convert image to grayscale​


b) Convert 2D output to 1D vector​
c) Increase image size​
d) Apply pooling

7. If Rehan’s model performs well on training data but poorly on test


data, it is called:

a) Underfitting​
b) Overfitting​
c) Data Leakage​
d) Transfer Learning

8. What technique did Rehan use to handle this problem?


a) Data Augmentation​
b) Increase Image Size​
c) Reduce Dataset​
d) Gradient Descent

9. Which layer of the CNN model uses Softmax Activation?

a) First Layer​
b) Hidden Layer​
c) Last Layer​
d) Pooling Layer

10. CNN models are best suited for:

a) Tabular Data​
b) Image Data​
c) Text Data​
d) Audio Data

Case Study: DroneNav — Smart Drone Navigation


using Matrices & Vectors

In TechCity, a startup named AeroMind developed an AI-powered drone navigation


system called DroneNav for search and rescue operations in disaster zones.

Drones had to:

●​ Rotate to correct direction.​


●​ Scale their speed based on obstacles.​

●​ Translate coordinates to reach the exact location.​

●​ Detect wind disturbance vectors.​

●​ Use transformation matrices to adjust position in real-time.​

The system used:

●​ Rotation Matrices for direction control.​

●​ Translation Vectors for movement.​

●​ Scaling Matrices for speed adjustment.​

●​ Eigenvalues & Eigenvectors for stability analysis during wind disturbances.​

Whenever the drone faced strong wind, DroneNav calculated the Eigenvalues of the
environment force matrix to detect instability.

Rotation of 90°, 180°, or any arbitrary angle was handled by multiplying the drone's
direction vector with the appropriate Rotation Matrix.

The entire navigation was optimized using Linear Algebra principles.

MSQ (Multiple Select Questions)

Q1. Which of the following are properties of Rotation Matrices?

a) Determinant is 1​
b) Orthogonal matrix​
c) Non-invertible​
d) Used for scaling

Q2. In drone navigation, translation vector is used for:

a) Changing direction​
b) Moving to new coordinates​
c) Changing speed​
d) Rotating along Z-axis

Q3. Eigenvalues of a matrix help in:

a) Detecting instability​
b) Reducing matrix dimension​
c) Finding rotation angles​
d) Identifying scaling factors

Q4. Which of the following matrices are Scaling Matrices?

a) [[2 , 0]​
[0 , 3]]

b) [[0 , -1]​
[1 , 0]]

c) [[k , 0]​
[​0 , k​]]

d) [[1 , 0]​
[​1 , 1​]]
Q5. Which operations involve matrices in drone movement?

a) Rotation​
b) Translation​
c) Speed Control​
d) Signal Transmission

Numerical Type Questions

Q6. Rotate point (3, 2) by 90° anti-clockwise using rotation matrix.


Give new coordinates.

Q7. Multiply matrix


A = [[1 , 2]​
[3 , 4]]​

with vector
v= [[ 2 ]​
[ 1 ]]

and give the result.

Q8. Find determinant of matrix


B= [[4 , 2]​
[​7 , 6]​]

Q9. Find the Eigenvalues of the matrix


C= [[3 , 0]​
[​0 , 5​]]

Q10. If a drone wants to scale its speed in X by 2 and Y by 3, what will


be the scaling matrix?

Bonus question -

Q11.

Given the matrix

D=[[4 , 0]​
[​0 , 9]​]

Find the product of:

1.​ Determinant of its Eigenvectors matrix (Assume it is an identity matrix for


simplicity).​

2.​ Product of its Eigenvalues.​

Give the final product value.

Hint for solving:

●​ Eigenvalues of a diagonal matrix are the diagonal elements (4 and 9).​

●​ Eigenvectors can form an identity matrix (since the matrix is already


diagonal).​
●​ Determinant of identity matrix = 1.​

●​ Product of Eigenvalues = 4 × 9 = 36.​

●​ Final Product = 1 × 36 = 36.

Case Study: MedScan AI — Smart Disease Detection


using SVM & KNN

In the city of Healthopolis, doctors were facing a serious challenge — patients were
coming in with mixed symptoms of different diseases like Diabetes, Heart Problems,
and Thyroid Disorders. The traditional diagnosis method required multiple tests and
days of waiting for accurate results.

To solve this problem, a healthcare startup named MedScan AI decided to build an


intelligent system using Machine Learning algorithms — Support Vector Machine
(SVM) and K-Nearest Neighbors (KNN). Their goal was to predict the risk level of a
patient (High Risk / Low Risk) based on health features like Blood Pressure, Glucose
Level, Cholesterol, Age, BMI, and Heart Rate.

The dataset contained 2000 patient records, with 6 input features per patient.​
The MedScan system used SVM for clear linear separable cases (like Diabetes or
Thyroid, where symptoms had clear boundaries) and KNN for non-linear or
overlapping cases (like heart disease where data patterns were not obvious).

SVM Model used:

●​ Kernel: Linear​

●​ Support Vectors Selected: 50​

●​ Accuracy Achieved: 92%​

KNN Model used:


●​ Value of K: 5​

●​ Distance Metric: Euclidean​

●​ Accuracy Achieved: 89%​

This hybrid model helped doctors to quickly screen new patients based on their
medical history and suggest further tests only when necessary, reducing diagnosis
time by 60%.

MCQs (Single Correct Answer)

Q1.

Support Vectors in SVM primarily influence:​


A) The accuracy of the model on the training data​
B) The position of the decision boundary​
C) The speed of prediction​
D) The number of features selected

Q2.

If the value of K in KNN is very large (close to total data points), the model will mostly:​
A) Memorize noise in data​
B) Predict majority class always​
C) Increase variance​
D) Create a complex decision boundary

Q3.
Which of the following would make SVM with RBF kernel perform poorly?​
A) Feature scaling not applied​
B) Data with clear linear separation​
C) Optimal gamma value​
D) Low-dimensional feature space

Q4.

KNN will fail to perform well if:​


A) Distance metric is poorly chosen​
B) Data is high-dimensional​
C) Features are not normalized​
D) All of the above

Q5.

If SVM finds that 80% of training points are support vectors, it means:​
A) Data is highly linearly separable​
B) Model is likely overfitting​
C) Kernel used is inappropriate​
D) Margin found is very large

MSQs (Multiple Select)

Q6.

Increasing the C parameter in SVM will:​


A) Decrease margin width​
B) Increase tolerance to errors​
C) Increase model complexity​
D) Make model prone to overfitting

Q7.

Choosing a very small value of K in KNN will lead to:​


A) High Bias​
B) High Variance​
C) Model sensitivity to noise​
D) Stable decision boundary

Q8.

SVM is preferred over KNN when:​


A) Speed at prediction time is critical​
B) Memory usage is a concern​
C) Feature space is sparse and high-dimensional​
D) Dataset is highly dynamic and changing

Q9.

Which factors affect KNN performance?​


A) Feature scaling​
B) Curse of Dimensionality​
C) Distance Metric​
D) Learning Rate

Q10.
In SVM, the role of the kernel trick is to:​
A) Add regularization​
B) Transform non-linear data to a higher dimension​
C) Increase overfitting probability​
D) Avoid explicit computation of new features

Smart Traffic Signal System using Markov Chains

MetroCity has introduced a Smart Traffic Signal System (STSS) to manage traffic flow
efficiently at a busy 4-way junction. The system uses a Markov Chain model to
predict the next traffic signal state based on current conditions.

The four states of the traffic light are:​


S1 → Green for North-South​
S2 → Green for East-West​
S3 → All Red (Pedestrian Crossing)​
S4 → Emergency Mode (Ambulance Clearance)

The system records the transition probabilities between these states based on
real-time traffic data collected over months.

An example of a transition matrix (P) is:

From \ S1 S2 S3 S4
To

S1 0.1 0.7 0.1 0.1

S2 0.2 0.1 0. 0.1


6

S3 0.3 0. 0.2 0.1


4

S4 0.2 0.2 0.1 0.


5
The initial state distribution is given as:​
π₀ = [1, 0, 0, 0] — meaning the system always starts from S1.

The aim is to:

●​ Predict future states​

●​ Calculate the stationary distribution​

●​ Analyze the expected long-term behavior​

●​ Optimize signal timings based on steady-state probabilities.​

MCQs (Conceptual)

Q1.

A Markov Chain is called memoryless because:​


A) It forgets past states​
B) Transition depends only on the current state​
C) Transition depends on all past states​
D) It resets after every transition

Q2.

In the given scenario, the stationary distribution represents:​


A) The most visited road​
B) The initial state of traffic​
C) The long-term probability of being in each signal state​
D) The probability of sudden emergency
Q3.

The sum of probabilities in any row of the transition matrix must be:​
A) 0​
B) 1​
C) Between 0 and 1​
D) Equal to the number of states

Q4.

If state S4 has high stationary probability, it indicates:​


A) Emergency happens rarely​
B) Emergency occurs frequently​
C) Pedestrian crossing is frequent​
D) Traffic signal is stuck

Q5.

Which of the following is true for a regular Markov Chain?​


A) It reaches absorbing state always​
B) There exists a stationary distribution​
C) Some rows of transition matrix can sum to less than 1​
D) Transitions depend on past 2 states

Numerical Type Questions

(Write only numerical answers)


Q6.

What is the probability of reaching S2 from S1 in exactly one step?

Q7.

What is the probability of being in S3 after 2 steps starting from S1?

(Hint: Multiply P twice and check value at (S1 to S3))

Q8.

Calculate the sum of all stationary probabilities.

Q9.

If the system stays in S3, calculate the expected number of steps before moving to
any other state.​
(Hint: Expected steps = 1 / (1 - P(S3 → S3)))

Q10.

If eigenvalue λ = 1 corresponds to stationary distribution, calculate the product of


determinant of P and sum of all eigenvalues of P.

Case Study: PCA for Traffic Pattern Analysis in Smart


City
In the rapidly growing city of Technopolis, traffic management has become one of
the biggest challenges. With hundreds of traffic cameras, sensors, and signal
systems deployed at various junctions, a huge volume of real-time data is being
generated — including vehicle counts, average speed, congestion levels, time of the
day, weather conditions, and road types.

The Smart City Department wanted to develop a system that could analyze traffic
patterns efficiently and predict congestion zones based on historical traffic data.
However, the dataset had many highly correlated features, making the model
complex and slow.

A data scientist proposed using Principal Component Analysis (PCA) to reduce the
dimensionality of the dataset while preserving maximum variance. PCA helped
compress the original 20-dimensional dataset into 3 principal components that
retained 95% of the total variance. These transformed features were then used to
develop faster predictive models for traffic management and signal optimization.

MCQs (Single Correct unless mentioned)

1.​ The primary objective of PCA is to:​


a) Reduce noise completely​
b) Create new dependent features​
c) Transform correlated features into uncorrelated components​
d) Perform classification directly​

2.​ PCA can improve machine learning models by:​


a) Increasing overfitting​
b) Reducing dimensionality and multicollinearity​
c) Ignoring important features​
d) Adding new labels​
3.​ In PCA, the first principal component:​
a) Explains minimum variance​
b) Explains maximum variance​
c) Is a non-linear function​
d) Always corresponds to a specific feature​

4.​ The main mathematical operation involved in PCA is:​


a) Convolution​
b) Matrix Multiplication​
c) Covariance Calculation​
d) Fourier Transform​

5.​ Which type of data is most suitable for PCA?​


a) Data with highly correlated features​
b) Unstructured text data​
c) Label data only​
d) Data with missing values only​

6.​ Which of the following is true about principal components? (MSQ)​


a) They are orthogonal to each other​
b) They are linear combinations of original features​
c) They retain all original features​
d) They are dependent on original scaling of data​
7.​ PCA can lead to information loss if:​
a) Too many components are retained​
b) Too few components are retained​
c) Data is properly standardized​
d) Data is highly correlated​

8.​ PCA transforms data into a:​


a) Lower dimensional correlated space​
b) Higher dimensional uncorrelated space​
c) Lower dimensional uncorrelated space​
d) Random feature space​

9.​ PCA was applied on a traffic dataset with 50 features, and only 5 components
were selected explaining 90% variance. What does this indicate?​
a) Remaining 45 features are not useful​
b) Remaining 45 features add very little new information​
c) Data was not suitable for PCA​
d) PCA failed to compress​

10.​ Which of the following is essential before applying PCA? (MSQ)​


a) Mean centering the data​
b) Standardizing features​
c) Adding noise to data​
d) Label encoding the target variable

Case Study: LibraryBot — The Smart Bookkeeper


In the peaceful town of Codetopia, a small community library struggled with its daily
operations. The library still used old registers to manage its books — writing down the
Book Name, Author, and Status (Available or Borrowed) manually.

This system worked when there were fewer books, but now with hundreds of
members and frequent borrowing and returning of books, the register became
messy. Searching for a book’s record took a long time, and sometimes the
handwriting wasn’t readable.

To solve this problem, a young coder named Aarya built LibraryBot — an intelligent
program written in Python that used simple file handling techniques to manage all
book records.

LibraryBot maintained a .txt file where every line stored one book's details in this
format:

CopyEdit
BookID, BookName, AuthorName, Status

For example:

rust
CopyEdit
101, Python Programming, John Zelle, Available
102, Data Science Basics, Cathy O'Neil, Borrowed

Whenever a new book was purchased, Aarya added it to the file without disturbing
the existing records.

If a user wanted to search for a book by its name or author, LibraryBot quickly
scanned the file and returned matching records.

When a book was borrowed or returned, LibraryBot updated the status accordingly in
the file.
It could also count the number of available and borrowed books, and display all the
records in a clean and readable way.

This smart solution made the library fast, error-free, and easy to manage — all by
using simple file operations in Python.

MCQs based on the Case Study:

1.​ Which file mode should be used to add a new book without deleting existing
data?​
a) 'r'​
b) 'w'​
c) 'a'​
d) 'r+'​

2.​ Which method is suitable to search for a book in the file?​


a) write()​
b) readlines()​
c) writelines()​
d) truncate()​

3.​ What data structure would speed up searching the book records in memory?​
a) Tuple​
b) List​
c) Dictionary​
d) Set​
4.​ What error occurs if LibraryBot tries to open a non-existing file in 'r' mode?​
a) File will be created​
b) FileNotFoundError​
c) File gets overwritten​
d) No Error​

5.​ What is the correct method to update the status of a book in the text file?​
a) Overwrite using write() directly​
b) Read all data, modify, and rewrite file​
c) Append at the end of the file​
d) Use truncate() method​

6.​ What are advantages of using a .txt file in LibraryBot? (MSQ)​


a) Easy to use​
b) Human-readable​
c) Best for huge databases​
d) No external library needed​

7.​ Which string method removes \n from each line read from the file?​
a) strip()​
b) split()​
c) join()​
d) find()​
8.​ What is the correct mode for both reading and writing without deleting the file
content?​
a) 'w'​
b) 'r+'​
c) 'a+'​
d) 'x'​

9.​ How should LibraryBot count the available books?​


a) Count all lines in the file​
b) Count lines where Status is 'Available'​
c) Count lines where BookID exists​
d) Use os.count()​

10.​ Which method in Python automatically closes the file after use?​
a) close()​
b) with open(...) as f​
c) exit()​
d) os.close()

Case Study:

Library Book Management System — Optimizing Book Arrangement


Using Sorting Techniques

Background:

Pixel Town Library is one of the largest libraries in Codetopia. It maintains thousands
of books across various sections like:
●​ Science
●​ History
●​ Fiction
●​ Comics
●​ Technology​

Every year during the Annual Book Fair or when New Book Arrivals come in bulk, the
library faces a major challenge — arranging and displaying books quickly and
efficiently.

Manually arranging these books based on titles, authors, or genres is slow,


error-prone, and inconsistent.

Problem Statement:

To overcome this challenge, the library decided to automate its book arrangement
process using Sorting Algorithms in their Library Management System (LMS).

With sorting, the system can:

●​ Allow readers to search and browse books faster.​

●​ Display books based on different sorting orders: alphabetical, author-wise,


published year-wise, etc.​

●​ Handle large datasets of books with better performance.​

MCQs (Single Correct Answer):

1. Which of the following sorting algorithms is comparison-based?


a) Counting Sort​
b) Bubble Sort​
c) Radix Sort​
d) Bucket Sort

2. Which sorting technique is considered the most efficient for sorting


large datasets?

a) Bubble Sort​
b) Selection Sort​
c) Merge Sort​
d) Linear Search

3. What is the worst-case time complexity of Quick Sort?

a) O(n²)​
b) O(n log n)​
c) O(n³)​
d) O(log n)

4. In which sorting algorithm does the largest element "bubble up" to


the end in each pass?

a) Merge Sort​
b) Insertion Sort​
c) Bubble Sort​
d) Heap Sort
5. Which sorting algorithm uses a "Divide and Conquer" approach?

a) Selection Sort​
b) Merge Sort​
c) Insertion Sort​
d) Bubble Sort

MSQs (Multiple Correct Answers):

6. Sorting is useful in LMS for:

a) Fast searching of books​


b) Displaying books in an ordered manner​
c) Reducing file size​
d) Improving book issuing speed

7. Stable Sorting Algorithms preserve:

a) Original Order of Equal Elements​


b) Memory Space​
c) Speed​
d) Data Integrity

8. Which sorting algorithms are In-Place?

a) Bubble Sort​
b) Merge Sort​
c) Insertion Sort​
d) Quick Sort
9. In which situations is Insertion Sort efficient?

a) Small Dataset​
b) Nearly Sorted Data​
c) Large Random Data​
d) Already Sorted Data

10. Merge Sort is preferred over Bubble Sort because:

a) Faster on large data​


b) Better space efficiency​
c) Divide and Conquer strategy​
d) Uses less memory

Scenario-Based — Suitable Sorting Techniques:

Choose the most suitable sorting technique for the given scenario.

Scenario 1:

Library wants to sort a small list of newly arrived books (less than 20 books).​
→ Suitable Algorithm: ________

(Options: Insertion Sort / Merge Sort / Quick Sort / Heap Sort)

Scenario 2:
Library needs to sort very large dataset of books (more than 10,000 books) based on
Book Titles.​
→ Suitable Algorithm: ________

(Options: Merge Sort / Insertion Sort / Selection Sort / Bubble Sort)

Scenario 3:

Library wants to sort books where the data is already nearly sorted.​
→ Suitable Algorithm: ________

(Options: Insertion Sort / Quick Sort / Merge Sort / Heap Sort)

Scenario 4:

Library wants stable sorting where the order of equal elements should not change
(example: same author books should maintain original order).​
→ Suitable Algorithm: ________

(Options: Merge Sort / Quick Sort / Heap Sort / Bubble Sort)

Scenario 5:

Library wants best average-case performance for sorting large books data.​
→ Suitable Algorithm: ________

(Options: Quick Sort / Bubble Sort / Selection Sort / Insertion Sort)

( For answer sheet, send an email on [email protected] )


Special Thanks to :
●​ Ajeet Rana
●​ Harshal
●​ Avanish Ojha
●​ Shalini Mittal
●​ Isha Jha
●​ Nikhil
●​ Rahul Prajapat
●​ Aditi​

In case of any help, contact Prakhar Gupta (student batch 1) on +91 955 565 8787 or
[email protected]

Thank You!

You might also like