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
Power BIMedium
A scheduled refresh of an Import model sourced from an on-premises SQL Server fails with a gateway error. What fixes it?
aInstall and configure the on-premises data gateway in standard mode and bind the data source to the model
bRepublish the .pbix from Desktop
cSwitch the workspace licence from Pro to Premium
dGive report users Build permission on the semantic model
Explanation: Cloud-to-on-premises refresh requires a gateway; republishing or changing licences does not create that connection.
PythonMedium
What is printed?
gen = (x * 2 for x in range(3))
print(sum(gen), sum(gen))
a6 6
b6 0
c0 6
dTypeError
Explanation: A generator is exhausted after one pass, so the second `sum` sees no items.
SQL / MySQLMedium
Which index can MySQL use for `WHERE status = 'PAID'` alone?
a(customer_id, status)
b(created_at, status)
c(customer_id, created_at, status)
d(status, created_at)
Explanation: By the leftmost-prefix rule, only an index starting with `status` helps a filter on status alone.
StatisticsMedium
What does this code estimate?
a = rng.beta(1 + 540, 1 + 11460, 100_000)
b = rng.beta(1 + 624, 1 + 11376, 100_000)
print((b > a).mean())
aThe p-value of a z-test
bThe required sample size
cThe posterior probability that B's conversion rate exceeds A's
dThe standard error of the difference
Explanation: Sampling from both Beta posteriors and counting how often B > A estimates P(B > A | data).
PythonMedium
How do you handle an exception?
acatch / throw
bif / error
ctry / except
dhandle / rescue
Explanation: Python uses try/except blocks.
SQL / MySQLMedium
In MySQL 8, how does `TRUNCATE TABLE orders` differ from `DELETE FROM orders`?
aTRUNCATE only removes rows added today
bTRUNCATE keeps the rows but hides them
cTRUNCATE drops and recreates the table, resets AUTO_INCREMENT and cannot be rolled back
dThere is no difference
Explanation: DELETE removes rows one by one inside a transaction, while TRUNCATE is a DDL statement that resets the table and its AUTO_INCREMENT counter.
PandasMedium
By default, which columns does `df.describe()` summarise?
aEvery column
bOnly object columns
cOnly the index
dOnly the numeric columns
Explanation: describe() reports count, mean, std and quartiles for numeric columns; pass include='all' to cover the rest.
Machine LearningMedium
A `city` column holds Pune, Delhi and Mumbai with no natural order. Which encoding fits?
aLabel encoding as 0, 1, 2
bDropping the column
cOne-hot encoding
dStandard scaling
Explanation: One-hot encoding creates a binary column per city so the model does not read a false ordering into the numbers.
DjangoMedium
Which call raises `Product.DoesNotExist` when nothing matches?
aProduct.objects.filter(pk=5)
bProduct.objects.get(pk=5)
cProduct.objects.all()
dProduct.objects.exclude(pk=5)
Explanation: `get()` returns exactly one object and raises DoesNotExist or MultipleObjectsReturned; `filter()` simply returns an empty queryset.
Large Language ModelsMedium
Which prompting technique does this use?
Classify the sentiment.
Review: 'Fast delivery, great packaging' -> positive
Review: 'Item arrived broken' -> negative
Review: 'Exactly as described' ->
aZero-shot prompting
bFine-tuning
cFew-shot prompting
dChain-of-thought prompting
Explanation: Showing a couple of worked examples inside the prompt is few-shot prompting, which pins down the output format as well as the task.
Artificial IntelligenceMedium
In a tool-calling agent, what happens immediately after the model returns a tool call?
if response.stop_reason == "tool_use":
result = run_tool(call.name, call.input)
messages.append({"role": "user", "content": tool_result(call.id, result)})
aThe loop ends and the tool result is shown to the user
bThe model executes the function inside itself
cThe tool result replaces the system prompt
dYour code runs the function and appends its result, then calls the model again
Explanation: The model only names the tool and arguments; your application executes it and feeds the result back for the next step.
APIsMedium
Which OAuth2 flow suits a backend service calling another API with no user involved?
aClient Credentials
bAuthorization Code with PKCE
cImplicit
dResource Owner Password
Explanation: Client Credentials is designed for machine-to-machine access.
Data ScienceMedium
What does this feature-engineering step create?
sales = sales.assign(
festive=lambda d: d["date"].between("2025-10-01", "2025-11-30")
)
aA string column with the festival name
bA boolean flag marking rows dated in Oct–Nov 2025
cA new DataFrame with only festive rows
dAn error, because assign cannot take lambdas
Explanation: `between` returns True/False per row, which assign stores as a new column.
Deep LearningMedium
You have 400 labelled images across 4 classes. What is the best first approach?
aTrain a deep CNN from scratch for 200 epochs
bUse an RNN over the pixel rows
cTrain a transformer from scratch
dUse a pretrained backbone, freeze it, and train a new classification head
Explanation: With little data, reusing pretrained features and training only the head gives strong accuracy and avoids overfitting.
DjangoMedium
Why should `success_url` on a class-based view use `reverse_lazy`?
areverse() is deprecated
bIt caches the URL for faster redirects
cIt works with POST only
dThe URLconf isn't loaded when the class attribute is evaluated at import time
Explanation: reverse_lazy defers resolution until the value is actually used.