Question bank
Pick an answer to see if you're right — with an explanation.
All topicsPythonSQL / MySQLData ScienceNumPyPandasMatplotlibMachine LearningDeep LearningArtificial IntelligenceLarge Language ModelsDjangoAPIsGit & GitHubPower BIExcelStatistics
Machine LearningMedium
Precision answers which question?
aHow many of the actual positives did the model find?
bOf the cases predicted positive, how many really are positive?
cHow close are predictions to the average?
dHow quickly does the model train?
Explanation: Precision is TP / (TP + FP); recall is the metric that measures how many actual positives were found.
DjangoMedium
Which setting does `collectstatic` copy files into for production?
aSTATICFILES_DIRS
bMEDIA_ROOT
cSTATIC_URL
dSTATIC_ROOT
Explanation: collectstatic gathers app and project static files into STATIC_ROOT, the single directory the web server serves.
Large Language ModelsMedium
In a RAG pipeline, why is a long document split into chunks before embedding?
aChunks make the embedding files smaller
bSo retrieval returns small, focused passages that fit in the prompt
cBecause models cannot embed PDFs
dTo randomise the order of the text
Explanation: One vector for a whole document blurs its topics; chunking keeps each vector specific and the retrieved context short.
Artificial IntelligenceMedium
A bank must explain every rejected loan application to the customer and the regulator. Which approach fits best?
aAn LLM that writes a free-text decision for each applicant
bA documented rule set or interpretable model, with the deciding factors logged
cA deep network chosen purely for highest accuracy
dA clustering model that groups similar applicants
Explanation: Regulated decisions need auditable, reproducible logic; generation can phrase the explanation but should not make the call.
APIsMedium
What does FastAPI return if this endpoint receives `{"qty": "abc"}`?
class Item(BaseModel):
qty: int
@app.post('/items')
def add(item: Item):
return item
a500 Internal Server Error
b200 with qty set to 0
c422 with details of the validation error
d400 with an empty body
Explanation: Pydantic validation fails and FastAPI automatically responds with 422 and a list of field errors.
Data ScienceMedium
A chart titled "Sales by month" would be better titled…
a"Figure 1"
b"Monthly sales data (₹)"
c"Sales fell 18% after March in Lucknow"
d"Chart of sales"
Explanation: An insight title tells the reader the message instead of making them search for it.
Deep LearningMedium
What inputs does `nn.CrossEntropyLoss` expect for multi-class classification?
aSoftmax probabilities and one-hot float labels
bSigmoid outputs and float labels
cRaw logits and integer class indices
dLog-probabilities and string labels
Explanation: CrossEntropyLoss applies log-softmax internally, so pass raw logits and class indices.
DjangoMedium
Which call returns a single dictionary like `{'revenue': ...}` for the whole queryset?
aOrder.objects.aggregate(revenue=Sum('total'))
bOrder.objects.annotate(revenue=Sum('total'))
cOrder.objects.values('total')
dOrder.objects.only('total')
Explanation: `aggregate()` summarises the whole queryset; `annotate()` adds a value per row.
ExcelMedium
The LAMBDA below is saved in Name Manager as `GSTAmount`. What does `=GSTAmount(50000,18)` return?
=LAMBDA(taxable, rate, ROUND(taxable * rate / 100, 2))
a900
b59000
c#VALUE!
d9000
Explanation: 50000 x 18 / 100 = 9000; the LAMBDA is reusable once named.
Git & GitHubMedium
You need one bug-fix commit from `develop` on `release/2.3` without merging everything else. Use…
agit stash
bgit bisect
cgit rebase develop
dgit cherry-pick <sha>
Explanation: cherry-pick applies the changes of a specific commit onto the current branch as a new commit.
Large Language ModelsMedium
Which statement about LLM-as-judge evaluation is most accurate?
aIt is useful but should be calibrated against human ratings
bIt is always more accurate than humans
cIt needs no rubric
dIt removes the need for a test set
Explanation: Judge models have biases such as favouring longer answers, so spot-check them with human reviews.
Machine LearningMedium
Which splitter should you use when validating a weekly sales forecasting model?
aTimeSeriesSplit
bKFold(shuffle=True)
cStratifiedKFold
dLeaveOneOut
Explanation: TimeSeriesSplit always validates on later periods, matching how the model is used in the future.
MatplotlibMedium
Which formatter gives compact, non-repetitive multi-level date labels automatically?
amdates.ConciseDateFormatter
bticker.PercentFormatter
cmdates.DayLocator
dticker.NullFormatter
Explanation: ConciseDateFormatter shows the year once and months or days beneath it.
NumPyMedium
Why is `np.linalg.solve(A, b)` preferred over `np.linalg.inv(A) @ b`?
ainv() only works on integer matrices
bsolve() also returns eigenvalues
csolve() works on non-square matrices
dsolve() is faster and more numerically accurate
Explanation: Solving directly avoids forming an explicit inverse, reducing work and rounding error.
PandasMedium
Why does `df.to_csv('out.csv')` often produce an `Unnamed: 0` column when read back?
aCSV cannot store integers
bThe encoding is wrong
cThe index was written as a column; use index=False
dpandas adds a checksum column
Explanation: By default the index is saved, and it reappears as an unnamed column on reading.