All jobs / AI engineer / LLM APIs
AI engineer interview question · 0–1 years
Your chat feature sends only the user’s newest message to the model API, and follow-up questions get confused replies. What is going on, and what do you change?
The strongest answer
Each API request stands alone — the model sees only what that request contains, so my code must send the earlier turns (or a stored-conversation reference, where the provider offers one) every time
Why it works
Exactly — the model holds nothing between calls. Whatever it should know, this request has to carry, which is also why long chats cost more per turn.
What a good answer covers
- Every request stands alone.
- Send the turns the model needs.
- History is input — you pay for it.
- Read your payload before blaming the provider.
Answers that fall short
- Close, but not the strongest: I would store the conversation in our database so that it is not lost between messages
Storing the turns is half of it; the model still sees nothing until you send them back with each request. - Weak: The model’s memory is too short; I would switch to one with a bigger context window
A bigger window does not help when the history was never sent. The window is something you fill, not something the model remembers into. - Red flag: It is a fault on the provider’s side, so I would retry the call until the reply makes sense
Retrying an identical request reaches the same blind model, and blaming the provider before reading your own payload worries an interviewer.
Who gets asked this
More LLM APIs questions
- How do you choose which model to call for a new feature?
- What is missing between the model’s reply and your order object?
- You turned on prompt caching for an assistant with a long system prompt and a dozen tools, but the provider’s…
- At peak your service starts getting HTTP 429 from the model provider. What should the client do?
- You switch the assistant to streaming. What changes for your backend beyond “the text appears sooner”?
- Traffic to the assistant grew by a tenth this month and the model bill doubled. How do you find out why, and…
- A nightly job classifies the day’s support tickets through the same synchronous endpoint and API key as the…
- What are your levers, in what order, and what do you promise?