Next cohort starts January 9.Apply ›

Token budget

Python Token Budget Interview Questions

A token budget is the hard limit on how much text fits into one model call, and the work is deciding what to leave out. The instructions, the retrieved passages and the conversation so far all compete for the same window, so something has to be dropped on purpose rather than cut off at the end.

What token budget questions ask you to do

Across the questions here, these are the shapes that come up:

  • Fit the highest scoring passages into a fixed number of tokens
  • Drop the oldest turns of a conversation while keeping the instructions
  • Skip an item that does not fit and carry on to a smaller one
  • Reserve room for the answer as well as for the question
  • Count what a message costs rather than guessing from its length

Common mistakes with token budget

Stopping at the first item that does not fit, which throws away every smaller one behind it. The other is trimming a conversation from the front, which removes the instructions the model needs on every call and leaves it answering without them. Decide what must survive, subtract it first, and spend what is left.

Questions to practice

Questions last reviewed 19 October 2026.

Roles this comes up in

Companies these come from

Other topics