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
Artificial IntelligenceEasy
On an unweighted graph, which search always returns a path with the fewest steps?
aDepth-first search
bGreedy best-first search
cBreadth-first search
dRandom restart
Explanation: BFS explores level by level, so the first time it reaches the goal it has used the fewest edges.
Artificial IntelligenceEasy
In an expert system, which component decides which rules fire and in what order?
aWorking memory
bInference engine
cKnowledge base
dUser interface
Explanation: The knowledge base stores rules and working memory stores facts; the inference engine applies them.
Artificial IntelligenceEasy
Which task suits a generative model rather than a traditional classifier?
aDrafting a personalised apology reply to a complaint
bPredicting tomorrow's units sold
cFlagging a transaction as fraud or not
dGrouping customers into five segments
Explanation: The other three produce a label or a number, which supervised models handle cheaply and reliably.
Artificial IntelligenceEasy
Which of these is a computer vision task?
aSentiment analysis of reviews
bMachine translation
cSpeech-to-text transcription
dDetecting helmets in CCTV footage
Explanation: Detection works on image pixels; the other three operate on text or audio.
Artificial IntelligenceMedium
With this heuristic, A* on a weighted graph behaves exactly like which algorithm?
h = lambda node: 0
path, cost = a_star(graph, start, goal, h)
aUniform-cost search (Dijkstra)
bDepth-first search
cGreedy best-first search
dBidirectional search
Explanation: With h = 0 the priority becomes just g(n), which is exactly uniform-cost search.
Artificial IntelligenceMedium
How many facts does `forward_chain` end with here?
RULES = [
({"supplies_goods", "turnover_above_40l"}, "must_register_for_gst"),
({"must_register_for_gst"}, "files_monthly_returns"),
]
case = {"supplies_goods", "turnover_above_40l"}
print(len(forward_chain(case, RULES)))
a2
b3
c4
dIt loops forever
Explanation: Both rules fire in turn, adding two derived facts to the two starting facts.
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.
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.
Artificial IntelligenceHard
A routing heuristic uses straight-line distance multiplied by 1.5 to allow for detours. Why can A* now return a sub-optimal route?
aMultiplication makes the priority queue slower
bThe heuristic becomes negative for nearby nodes
cThe heuristic may overestimate the remaining cost, so it is no longer admissible
dA* only accepts integer heuristics
Explanation: Optimality requires an admissible heuristic that never overestimates; scaling it up breaks that guarantee.
Artificial IntelligenceHard
Which change most reduces the risk of an agent taking a harmful, irreversible action?
aIncreasing the temperature so it explores more options
bRequiring human approval for write tools while read-only tools run automatically
cGiving it more tools so it always has an alternative
dEnlarging the context window
Explanation: Least privilege plus approval on irreversible actions limits damage far more than any prompt wording.