SampleQuestion- AIOL 2024
SampleQuestion- AIOL 2024
Question Coverage
Programming 30%
NLP 10%
Transformer 10%
MCQ Samples
Q: Emily is writing a Python script to automate her data processing tasks. She needs
to read a large CSV file into a DataFrame for analysis. Which library should she use?
A. NumPy
B. SciPy
C. Pandas (Correct)
D. Matplotlib
Q: Olivia is debugging her Python code and needs to print the type of a variable to
the console. Which function should she use?
A. type() (Correct)
B. isinstance()
C. id()
D. print()
Q: You want to build a model to predict stock prices. What's the ideal scenario
regarding bias and variance?
A. High Bias, High Variance
B. Low Bias, Low Variance (Correct)
C. High Bias, Low Variance
D. Low Bias, High Variance
Q: Imagine you're using gradient descent to find the pizza place with the highest
average rating based on user reviews. What's the equivalent of the "cost function" in
this scenario?
A. Number of User Reviews
B. Average Distance from Your Location
C. Total Price of Pizzas
D. Average User Rating (Correct)
Q: You're training a model to classify emails as spam or not spam using gradient
descent. The cost function isn't decreasing after each iteration. What could be the
problem?
Q: What is the purpose of using a minimum instance count for stopping criteria in
CART ?
A. To ensure all leaves have the same number of data points
B. To prevent the tree from becoming too complex and overfitting the data
(Correct)
C. To improve the accuracy of predictions on unseen data
D. To reduce the computational cost of training the tree
Q: You are working on a binary classification project of classifying if the given text is
spam or not. What activation function will you imply in the last layer of the Dense
layer?
A. ReLU
B. Tanh
C. Sigmoid (Correct)
D. Linear
There will be 9 Subjective Questions covering all the topics of the syllabus.
Q: Complete the following code so that we can print the missing values using the
‘is_null()’ function.
print("\nMissing Values:")
print( ...................................... )
Answer:
print(iris_df.is_null().sum())
high_earners = .........
print(............................)
Answer:
high_earners = [employee['name'] for employee in employees if
employee['salary'] > 50000]
print(high_earners)
Q: Write the Output of the code and explain.
# List of product names
product_names = ['Laptop', 'Smartphone', 'Tablet', 'Headphones',
'Smartwatch']
Output:
Explanation:
Answer:
[ {'name': 'Laptop', 'price': 1000}, {'name': 'Smartphone',
'price': 800}, {'name': 'Tablet', 'price': 300}, {'name':
'Headphones', 'price': 150}, {'name': 'Smartwatch', 'price': 200}]
Q: You are given two lists, one containing the names of students and the other
containing their corresponding grades. Write a Python function that uses the zip
method to create a dictionary where the student names are the keys and their
grades are the values.
Output:
Answer:
def create_student_grade(names, grades):
# write code below
student_grade_dict = dict(zip(names, grades)) \
return student_grade_dict
Q: You are given a 2D NumPy array representing a matrix of integers. Write a Python
script to flatten this matrix into a 1D array. Explain a use case where flattening a
matrix would be useful.
Code:
import numpy as np
# write your code below
Output:
Answer:
matrix = np.array([ [1, 2, 3],
[4, 5, 6],
[7, 8, 9]]
)
# Flatten the matrix into a 1D array
flattened_array = matrix.flatten()