MauryaHub PYQ Practice

Data Science and AI Lab · Quiz 2 · May 2026

Data Science and AI Lab · Quiz 2 · May 2026

← Course papers · Start practice / exam

Questions and published explanations below are available without starting a test. Some questions may not have a published solution yet.

0 / 25 published solutions

Question 2 NAT · 2.0 marks

Given the following code snippet, how many **unique values** will be present in the column (Z) of the resulting DataFrame (df)?
Source diagram or notation

A published solution is not available for this question yet.

Report a correction for Q2

Question 3 NAT · 2.0 marks

What will be the output of the following code?
Source diagram or notation

A published solution is not available for this question yet.

Report a correction for Q3

Question 4 NAT · 2.0 marks

A binary classification model is evaluated on a test set of 10 images, classifying each as either Horse ('H') or Zebra ('Z'). The true labels and the predicted labels are provided below:
Source diagram or notation
What is the precision of the model for the "Horse" class?

A published solution is not available for this question yet.

Report a correction for Q4

Question 5 NAT · 2.0 marks

An agent's ReAct loop performs 1 initial reasoning step, then 3 more reasoning steps (one after each of 3 tool calls) — 4 reasoning steps total for one query. Each reasoning step consumes 250 input tokens + 150 output tokens. What is the **total number of tokens** consumed by reasoning alone for one query?

A published solution is not available for this question yet.

Report a correction for Q5

Question 6 MCQ · 2.0 marks

What will be the output of the following code?
Source diagram or notation
6406537134953.
[8.0, np.nan]
6406537134954.
[3.0, 8.0]
6406537134955.
[7.0, 6.0]
6406537134956.
[8.0, 6.0]
6406537134957.
Code will throw an Error

A published solution is not available for this question yet.

Report a correction for Q6

Question 7 MCQ · 2.0 marks

An ML practitioner is evaluating a classification model by plotting its training and validation loss over 100 epochs. Which of the following statements regarding model evaluation and overfitting is true?
6406537134960.
Overfitting is occurring if the validation loss strictly decreases alongside the training loss.
6406537134961.
An overfitted model typically exhibits high bias and low variance.
6406537134962.
Early stopping can mitigate overfitting by halting the training process before the model begins to memorize noise.
6406537134963.
Duplicating the training data points is an effective way to reduce model variance and improve generalization.

A published solution is not available for this question yet.

Report a correction for Q7

Question 8 MCQ · 2.0 marks

Which of the following describes the behavior of
Source diagram or notation
in PyTorch regarding the input activation function?
6406537134965.
It expects raw logits.
6406537134966.
It requires a Sigmoid output.
6406537134967.
It requires a Tanh output.
6406537134968.
It requires a Softmax output.

A published solution is not available for this question yet.

Report a correction for Q8

Question 9 MCQ · 2.0 marks

When defining a custom layer by subclassing
Source diagram or notation
, which method MUST be implemented to define the computation?
6406537134969.
step
6406537134970.
train
6406537134971.
forward
6406537134972.
backward

A published solution is not available for this question yet.

Report a correction for Q9

Question 10 MCQ · 2.0 marks

What is the effect of calling
Source diagram or notation
on a network containing
Source diagram or notation
layers?
6406537134973.
Clears the gradient buffer.
6406537134974.
Freezes all model weights.
6406537134975.
Disables the dropout layers.
6406537134976.
Increases dropout probability.

A published solution is not available for this question yet.

Report a correction for Q10

Question 11 MCQ · 2.0 marks

What is the primary function of the learnable
Source diagram or notation
token prepended to the input sequence in the original Vision Transformer architecture?
6406537134977.
Its final hidden state at the output of the transformer encoder serves as the global aggregate representation of the image for the classification task.
6406537134978.
It provides spatial coordinate data to allow the model to capture the relative distances and positions of the different image patches.
6406537134979.
It acts as a boundary separator to explicitly distinguish where one flattened 2D image patch ends and the next begins.
6406537134980.
It serves as a padding token to maintain a uniform sequence length when the model processes images of varying resolutions in a single batch.

A published solution is not available for this question yet.

Report a correction for Q11

Question 12 MCQ · 2.0 marks

Which LangChain component is responsible for converting raw LLM responses into structured Python objects?
6406537134995.Source diagram or notation
6406537134996.Source diagram or notation
6406537134997.Source diagram or notation
6406537134998.Source diagram or notation

A published solution is not available for this question yet.

Report a correction for Q12

Question 13 MCQ · 2.0 marks

Source diagram or notation
With the above configuration, how does the conversation history returned by
Source diagram or notation
get stored in
Source diagram or notation
variable?
6406537134999.
A summarized conversation as a string
6406537135000.
A summarized conversation as a list
6406537135001.
The complete conversation history as a formatted string
6406537135002.
The complete conversation history as a list of message objects

A published solution is not available for this question yet.

Report a correction for Q13

Question 14 MCQ · 2.0 marks

Choose the correct option with respect to the following code snippet:
Source diagram or notation
6406537135007.Source diagram or notation
should be
Source diagram or notation
.
6406537135008.Source diagram or notation
should be
Source diagram or notation
.
6406537135009.Source diagram or notation
is a list, so this should be
Source diagram or notation
.
6406537135010.
There is no issue. This code runs correctly.

A published solution is not available for this question yet.

Report a correction for Q14

Question 15 MCQ · 2.0 marks

Fix the broken chain:
Source diagram or notation
This throws a
Source diagram or notation
at runtime. What is the correct fix? (
Source diagram or notation
is a helper function to format documents.)
6406537135015.
The pipe order is reversed - it should be
Source diagram or notation
, since the retriever must run first (query → docs) before formatting (docs → string).
6406537135016.Source diagram or notation
should be removed entirely as the context is directly going to come from retriever.
6406537135017.Source diagram or notation
should be replaced with
Source diagram or notation
.
6406537135018.Source diagram or notation
should come before
Source diagram or notation
.

A published solution is not available for this question yet.

Report a correction for Q15

Question 16 MCQ · 2.0 marks

A legal-tech startup is building a tool that must always draft contracts using the firm's exact house style - specific clause phrasing, tone, and formatting conventions that must appear identically in every document, regardless of the underlying facts. The firm's knowledge (case law, templates) rarely changes. Which approach is the better primary fit, and why?
6406537135019.
RAG, because contracts count as "documents" and RAG works with any document type.
6406537135020.
Fine-tuning, because the requirement is about consistently reproducing a specific style/behavior in every output, not about injecting frequently-changing factual knowledge.
6406537135021.
RAG, because retrieving the firm's past contracts as context at generation time will reliably force the LLM to match their exact phrasing and formatting every time.
6406537135022.
Since the knowledge is mainly static, the team should skip both RAG and fine- tuning and just use a long, detailed system prompt with the house style rules.

A published solution is not available for this question yet.

Report a correction for Q16

Question 17 NAT · 3.0 marks

Consider the following Python code snippet that defines the true class labels and the predicted probabilities for a batch of four data points:
Source diagram or notation
What will be the output of the code snippet? (Round your answer to two decimal places)

A published solution is not available for this question yet.

Report a correction for Q17

Question 18 NAT · 3.0 marks

An RGB image of size
Source diagram or notation
is fed into a standard Vision Transformer (ViT). The image is divided into non-overlapping square patches with a side length of
Source diagram or notation
. Enter the final sequence length
Source diagram or notation
of the token embeddings that is input into the transformer encoder.

A published solution is not available for this question yet.

Report a correction for Q18

Question 19 NAT · 3.0 marks

Consider the following code:
Source diagram or notation
The training dataset contains 960 samples, and there is one GPU. How many optimizer update steps are performed during training (ignore gradient accumulation and assume
Source diagram or notation
)?

A published solution is not available for this question yet.

Report a correction for Q19

Question 20 MCQ · 3.0 marks

You run the following code using huggingface:
Source diagram or notation
What is the structure of the variable
Source diagram or notation
?
6406537134982.
A single dictionary containing overall sentiment for both sentences.
6406537134983.
A list of tupples containing the label and sentiment score for both sentences.
6406537134984.
A single list containing the final labels for both sentences.
6406537134985.
A list of dictionaries, one for each input sentence, each containing a label and a score.

A published solution is not available for this question yet.

Report a correction for Q20

Question 21 MCQ · 3.0 marks

What is the output of the following code?
Source diagram or notation
6406537134986.
The code Raises an error
6406537134987.
[1,2,3,4,2,4,6,8]
6406537134988.
[2,4,6,8]
6406537134989.
[1,2,3,4]

A published solution is not available for this question yet.

Report a correction for Q21

Question 22 MCQ · 3.0 marks

Source diagram or notation
Using the default f-string template formatter shown above, what happens if the following line is executed?
Source diagram or notation
6406537135003.
It prompts the user to enter the missing value.
6406537135004.
It substitutes an empty string.
6406537135005.
It returns the template with
Source diagram or notation
unchanged.
6406537135006.
It raises a
Source diagram or notation

A published solution is not available for this question yet.

Report a correction for Q22

Question 23 MCQ · 3.0 marks

Consider the following LangGraph router for an email assistant. The graph should: • Send **high priority** emails to
Source diagram or notation
• Send **low priority** emails to
Source diagram or notation
• Send all other emails to
Source diagram or notation
Source diagram or notation
Which of the following options correctly fills **all six blanks**?
6406537135030.
(1)
Source diagram or notation
(2)
Source diagram or notation
(3)
Source diagram or notation
(4)
Source diagram or notation
(5)
Source diagram or notation
(6)
Source diagram or notation
6406537135031.
(1)
Source diagram or notation
(2)
Source diagram or notation
(3)
Source diagram or notation
(4)
Source diagram or notation
(5)
Source diagram or notation
(6)
Source diagram or notation
6406537135032.
(1)
Source diagram or notation
(2)
Source diagram or notation
(3)
Source diagram or notation
(4)
Source diagram or notation
(5)
Source diagram or notation
(6)
Source diagram or notation
6406537135033.
(1)
Source diagram or notation
(2)
Source diagram or notation
(3)
Source diagram or notation
(4)
Source diagram or notation
(5)
Source diagram or notation
(6)
Source diagram or notation

A published solution is not available for this question yet.

Report a correction for Q23

Question 24 MSQ · 2.0 marks

Consider the following code and select the correct statement:
Source diagram or notation
Which of the following will be contained in
Source diagram or notation
?
6406537134990.
input_ids
6406537134991.
attention_mask
6406537134992.
token_type_ids
6406537134993.
padding_id

A published solution is not available for this question yet.

Report a correction for Q24

Question 25 MSQ · 3.0 marks

A student justifies their chunking choice like this: "I will set
Source diagram or notation
and
Source diagram or notation
so I get fewer, bigger chunks - that way retrieval is faster since there's less to search through, and I never lose any context since overlap does not matter if chunks are big enough." What is wrong with this reasoning? (Select all that apply)
6406537135011.
Nothing is wrong - this is a sound strategy
6406537135012.
Bigger chunks reduce the number of vectors to compare, but at that size a chunk likely mixes multiple unrelated topics, hurting the precision of what gets retrieved.
6406537135013.Source diagram or notation
risks splitting a relevant idea exactly at a chunk boundary
6406537135014.Source diagram or notation
is invalid and will throw an error

A published solution is not available for this question yet.

Report a correction for Q25

Question 26 MSQ · 4.0 marks

Examine the code below, which is meant to build a LangGraph agent: the
Source diagram or notation
node decides whether to call a
Source diagram or notation
or finish, based on
Source diagram or notation
.
Source diagram or notation
Which of the following statements about this code are **correct**? (Select all that apply)
6406537135024.
Replacing
Source diagram or notation
with the string
Source diagram or notation
in the conditional edge mapping would still terminate the graph correctly.
6406537135025.
Replacing
Source diagram or notation
with
Source diagram or notation
would preserve the same behavior.
6406537135026.
If
Source diagram or notation
returned
Source diagram or notation
instead of
Source diagram or notation
without changing the mapping, execution would fail at runtime.
6406537135027.Source diagram or notation
is called incorrectly because the mapping dictionary should come before the routing function.
6406537135028.
The graph would behave the same if
Source diagram or notation
were replaced with
Source diagram or notation
.
6406537135029.
The graph correctly loops between
Source diagram or notation
and
Source diagram or notation
until
Source diagram or notation
returns
Source diagram or notation
.

A published solution is not available for this question yet.

Report a correction for Q26