0% found this document useful (0 votes)
376 views5 pages

National AI Olympiad Sample Questions

The National Artificial Olympiad scheduled for June 1, 2024, will cover various topics including Programming, Machine Learning, and Deep Learning, with a total of 30 MCQs and 9 subjective questions. Sample questions are provided to illustrate the types of knowledge and skills being assessed. The document outlines specific question formats and expected answers related to programming and machine learning concepts.

Uploaded by

Aavash Tiwari
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)
376 views5 pages

National AI Olympiad Sample Questions

The National Artificial Olympiad scheduled for June 1, 2024, will cover various topics including Programming, Machine Learning, and Deep Learning, with a total of 30 MCQs and 9 subjective questions. Sample questions are provided to illustrate the types of knowledge and skills being assessed. The document outlines specific question formats and expected answers related to programming and machine learning concepts.

Uploaded by

Aavash Tiwari
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

National Artificial Olympiad - June 1, 2024

Question Coverage

Topics as per syllabus Coverage

Programming 30%

Machine Learning 15%

Deep Learning 15%

NLP 10%

Transformer 10%

Generative Modeling 10%

Computer Vision 10%

MCQ Samples

There will be 30 MCQs covering all the topic of syllabus

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?

A. The data is not rescaled


B. The learning rate is too high
C. The learning rate is too low (Correct)
D. There is not enough data

Q: What is the model representation used by KNN ?


A. set of linear equations
B. A decision tree
C. The entire training dataset (Correct)
D. A neural network architecture

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

Q: What is a Generative Adversarial Network (GAN)?


A. A network for data analysis
B. A type of neural network architecture for generative modeling (Correct)
C. A network for fast data processing
D. A network for data encryption
Subjective Questions

There will be 9 Subjective Questions covering all the topics of the syllabus.

Sample Questions are as follows.

Q: Complete the following code so that we can print the missing values using the
‘is_null()’ function.
print("\nMissing Values:")

print( ...................................... )

# Display class distribution of the species feature.


print("\nClass Distribution:")
print(iris_df['species'].value_counts())

Answer:
print(iris_df.is_null().sum())

Q: You are given a list of dictionaries representing employees in a company. Each


dictionary contains the employee's name and their salary. You need to create a new
list that contains the names of all employees who earn more than $50,000. Use a list
comprehension to accomplish this task.

# List of dictionaries representing employees

employees = [ {'name': 'John Doe', 'salary': 60000},


{'name': 'Jane Smith', 'salary': 48000},
{'name': 'Emily Davis', 'salary': 52000},
{'name': 'Michael Brown', 'salary': 45000},
{'name': 'Jessica Taylor', 'salary': 70000}
]

# List comprehension to get names of employees earning more than $50,000

high_earners = .........

# Output the result

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']

# List of corresponding product prices


product_prices = [1000, 800, 300, 150, 200]

# List comprehension to merge the two lists into a list of dictionaries


products = [{'name': name, 'price': price} for name, price in
zip(product_names, product_prices)]

# Output the result


print(products)

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.

def create_student_grade(names, grades):


# write code below

# List of student names


names = ['Alice', 'Bob', 'Charlie', 'David', 'Eve']

# List of corresponding student grades


grades = ['A', 'B', 'C', 'B+', 'A-']

student_grade_dictionary = create_student_grade(names, grades)

# Output the result


print(student_grade_dictionary)

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 = [Link]([ [1, 2, 3],
[4, 5, 6],
[7, 8, 9]]
)
# Flatten the matrix into a 1D array
flattened_array = [Link]()

# Output the result


print(flattened_array)

Common questions

Powered by AI

The primary difference between NumPy and Pandas libraries lies in their data structures and operations they each optimize. NumPy provides support for high-performance operations on arrays and matrices, focusing on mathematical functions and linear algebra, thus being optimal for numerical computations. In contrast, Pandas extends NumPy by introducing the DataFrame, a 2D labeled data structure that facilitates manipulations such as selection, labeling, and handling missing data, which makes it more suitable for data analysis and manipulation tasks in relation to real-world datasets .

Flattening a 2D matrix to a 1D array using NumPy's flatten method can be beneficial in scenarios where consistent sequential access to all elements is needed, and matrix row or column structure is irrelevant. For example, when performing data serialization or feeding data into algorithms that require linear input forms, such as certain machine learning algorithms or graphic processing tasks, flattening ensures that all data points are processed consecutively without the need for additional indexing layers .

Using Pandas to read large CSV files into a DataFrame facilitates data processing in Python due to its high-performance capabilities for handling and analyzing large data sets. Pandas DataFrames enable the use of vectorized operations for batch data processing, which significantly enhances the computing speed and efficiency compared to traditional row-wise iteration. Additionally, DataFrames provide a diverse set of functionalities for filtering, aggregating, and transforming data, making it a flexible and powerful tool for data analysis tasks .

When choosing between low bias and low variance in a predictive model, it is crucial to consider the specific context and goals of the modeling task. Low bias often implies a model that can capture complex data patterns but may lead to high variance, making it sensitive to noise and potentially overfitting. Conversely, low variance indicates a model that generalizes well to unseen data but may suffer from high bias, lacking adaptiveness to intricacies in the data. The ideal scenario is typically achieving a balance between bias and variance, where the model has sufficient complexity to learn the essential data characteristics while generalizing effectively on new data .

Applying a minimum instance count for stopping criteria in CART (Classification and Regression Trees) helps prevent overfitting by ensuring that the tree does not grow overly complex. Overly complex trees can memorize noise in the training data, leading to poor generalization on unseen data. By stopping tree growth when the node size falls below a specified minimum, the model remains simpler and retains better predictive accuracy on new data, thus reducing overfitting .

If the learning rate in gradient descent is set too high, the algorithm can overshoot the minimum of the cost function, causing divergence or oscillating values rather than convergence to the minimum. This happens because each step updates the parameters too aggressively, skipping over the optimal point. Consequently, the cost function may actually increase instead of decreasing after each iteration, hindering successful training of the model .

The K-Nearest Neighbors (KNN) algorithm utilizes the entire training dataset as its model representation. This non-parametric method means that KNN does not summarize its data into a model but instead stores all available cases and determines predictions based on the proximity of stored data points. Consequently, the computational cost during the prediction phase is high, as each prediction requires calculating the distance between the query and all data points in the training set to identify the nearest neighbors, making it inefficient with large datasets .

In a binary classification problem, the sigmoid function is more appropriate than ReLU for the last layer because it outputs a probability between 0 and 1, which aligns with the interpretation of the output as a probability of class membership. The sigmoid function compresses inputs to a range between 0 and 1, making it suitable for binary outcomes (1 or 0). ReLU, on the other hand, outputs a range that starts at 0 and goes to infinity, which is not helpful for probability bounds .

The National Artificial Olympiad syllabus allocates 30% to programming, which is the highest coverage in comparison to other topics. Machine Learning and Deep Learning each cover 15%, NLP, Transformer, and Generative Modeling each account for 10%, and Computer Vision also makes up 10% of the syllabus .

List comprehensions in Python are efficient because they allow for the construction of a new list by applying an expression to each element in a sequence, all within a single, concise line of code. This improves readability and often execution speed compared to traditional loops as it reduces the need for explicitly appending elements to a list, thus optimizing the performance especially when dealing with large data sets, as seen in the task of filtering employee names based on salary .

You might also like