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
Git & GitHubHard
What does `git bisect run` use to decide whether each commit is good or bad?
git bisect start HEAD v2.1.0
git bisect run python manage.py test billing
aThe commit message
bWhether the files changed
cThe exit code of the command: 0 is good, non-zero is bad
dThe author of the commit
Explanation: bisect run treats exit code 0 as good and most non-zero codes as bad (125 means skip).
Large Language ModelsHard
When is fine-tuning the most justified choice?
aTo teach the model this morning's stock levels
bBefore trying any prompt changes
cWhen evaluations show prompting and RAG cannot achieve a required consistent format or narrow skill at scale
dTo stop prompt injection completely
Explanation: Fine-tuning changes behaviour and style; it is costly and poor for fresh facts, so use it after cheaper options fall short.
Machine LearningHard
You `joblib.dump` a fitted pipeline with scikit-learn 1.5 and load it in production. What is the safest practice?
aLoad it with any newer scikit-learn version
bConvert it to CSV first
cPin the same library versions in production and only load files from trusted sources
dRe-fit the pipeline on each request
Explanation: Pickled models are version-sensitive and unpickling can execute code, so pin versions and trust the source.
MatplotlibHard
You plot daily sales where the date column holds strings like '05-04-2025'. Ticks are crowded and the spacing ignores missing days. What is the best fix?
aRotate the labels 90 degrees
bConvert with pd.to_datetime(col, dayfirst=True) and sort before plotting
cUse a bar chart instead
dSet plt.xticks([]) to hide labels
Explanation: Strings are treated as categories; real datetimes give correct spacing and let date locators work.
NumPyHard
After `v = a.reshape(2, 6)` on a contiguous 12-element array `a`, you run `v[0, 0] = 99`. What happens to `a[0]`?
aIt stays unchanged because reshape copies
bIt raises an error because views are read-only
cIt becomes NaN
dIt also becomes 99 because v is a view sharing memory
Explanation: reshape returns a view when possible, so writes through v change a.
PandasHard
Which statement about `df[df['city'] == 'Pune']['amount'] = 0` is correct?
aIt reliably sets Pune amounts to 0
bIt raises a SyntaxError
cIt deletes Pune rows
dIt may modify a temporary copy, leaving df unchanged; use df.loc[mask, 'amount'] = 0
Explanation: This is chained assignment; a single .loc call assigns to the original DataFrame.
Power BIHard
On 12 September, `Total Sales` covers 12 days but `SAMEPERIODLASTYEAR` returns all 30 days of last September, making YoY look awful. What is the correct fix?
aRestrict the prior-year measure to the same number of elapsed days, e.g. by adding a filter up to EDATE(MAX(Sales[InvoiceDate]), -12)
bReplace SAMEPERIODLASTYEAR with PREVIOUSYEAR
cSet the date table's end date to today so future days disappear
dChange the relationship to bi-directional so filters flow back to the date table
Explanation: Like-for-like comparison means truncating last year's window to the same elapsed period; the other options do not align the two periods.
PythonHard
What does this print?
def add(item, bucket=[]):
bucket.append(item)
return bucket
add(1)
print(add(2))
a[2]
b[1, 2]
c[1]
d[]
Explanation: Default values are evaluated once, so the same list is shared between calls; use `None` as the default instead.
SQL / MySQLHard
With `SUM(revenue) OVER (PARTITION BY branch ORDER BY month)` and no explicit frame, what is computed?
aTotal revenue of the branch on every row
bRevenue of the current month only
cA running total from the branch's first month up to the current month
dTotal revenue across all branches
Explanation: With ORDER BY and no frame, the default frame is RANGE from UNBOUNDED PRECEDING to CURRENT ROW, giving a running total.
StatisticsHard
A test planned a 50/50 split but recorded 51,800 vs 48,200 users. What should you do first?
aInvestigate a sample ratio mismatch before trusting any result
bDeclare the larger group the winner
cReweight the results and continue
dIgnore it; splits never match exactly
Explanation: A split this far from 50/50 on large traffic is very unlikely by chance and usually signals a randomisation or logging bug.