Can You Answer This ₹40 LPA AI Engineer Interview Question? LLM vs AI Agent
Understand the difference between an LLM and an AI agent, who executes tool calls, how the agent loop works, and what interviewers expect in a production-ready answer.

Interviewer👨💼 :“What is the difference between an LLM and an AI agent?”
Candidate🙋♀️ : “An LLM generates responses, while an agent can perform actions.”
The interviewer does not move to the next topic.
The follow-up questions reveal whether the candidate understands real systems or only definitions.
Question 1: What does an LLM actually do?
Candidate: An LLM generates output using the context available to it. It can explain an error, summarize supplied logs, or produce structured data. It cannot independently open our private database merely because we asked it to.
Interviewer: Then how can an AI support assistant check a live transaction?
Candidate: For that we need tools and application code.
Question 2: How does the system use a tool?
Imagine a customer reports:
“My payment succeeded, but the order was not created.”
Our backend exposes narrow functions such as:
getPaymentStatus(transactionId)
getOrderStatus(transactionId)
createSupportTicket(details)The application sends their descriptions and parameter schemas with the conversation. The model might respond with:
{
name: "getPaymentStatus",
arguments: { transactionId: "txn_123" }
}Interviewer: Did the model just call the payment service?
Candidate: No. It generated a structured request to use a tool. Nothing has been executed yet.
Question 3: Who executes the API call?
Candidate: Our backend does.
The real flow is:
- The application sends the prompt and tool definitions.
- The model returns a tool name and arguments.
- The backend validates the input and permissions.
- It executes the approved function.
- The result returns to the model as new context.
- The model requests another tool or gives the final answer.

The LLM proposes. The application owns execution, credentials, and access control.
Question 4: What makes the complete system an agent?
The candidate writes this on the whiteboard:
AI Agent = LLM + Instructions + Tools + State + Execution LoopAn agent observes its state, selects a step, receives the result, and reassesses.
Observe → Decide → Request Tool → Execute → Observe Result → Continue or StopInterviewer: Who stops the loop?
Candidate: The model may return a final response, but the application must enforce boundaries. It should stop on a turn limit, timeout, unrecoverable error, or approval requirement.
Question 5: Should multiple tools run together?
It depends on their data dependency.
Payment status and order status can be fetched in parallel when both require only the transaction ID:
const [payment, order] = await Promise.all([
getPaymentStatus(transactionId),
getOrderStatus(transactionId)
]);But suppose the payment response contains a gateway reference required by the next call:
const payment = await getPaymentStatus(transactionId);
const gateway = await getGatewayDetails(payment.gatewayRef);The second operation must wait. A strong answer identifies whether calls are independent.
Question 6: Would you let the agent issue a refund?
Candidate: Not merely because the model requested it. The backend must verify the customer, transaction ownership, eligibility, and limits. The write needs an idempotency key and audit log. High-value refunds may require human approval.
A system prompt saying “refund only for valid transactions” is guidance It is not considerd authorization.
LLM vs AI agent: the interview summary

Interviewer’s feedback
The opening answer was too shallow for a senior role. It never explained who executes actions, holds credentials, or prevents unsafe operations.
Verdict: A strong answer after follow-up questions. To make the first response senior-level, the candidate should mention the application boundary and agent loop immediately.
From Tech By Neha Gupta
- 👏 Enjoyed the article? Don’t forget to leave a clap.
- 💬 Have thoughts or questions? Share them in the comments.
Before you go
- Please take a moment to like the post and follow the writer!
- Did you know that over 400,000 developers share what they’re building, learning, and discovering across our platforms every month? Learn how you can contribute here