Next cohort starts January 9.Apply ›

Cost

Python Cost Interview Questions

Cost in an AI product is mostly settled before a model runs at all: which model the request goes to, how much of the conversation travels with it, and whether the same question gets paid for twice. These questions are the arithmetic behind those decisions. Prices are quoted per thousand tokens, separately for what you send and what comes back, and the context window has to hold both of them at once.

What cost questions ask you to do

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

  • Pick the cheapest model that can still hold a request
  • Price a conversation from its token counts
  • Keep a running spend under a cap
  • Decide when a long prompt earns a larger context window
  • Work out what caching repeated prompts saves

Common mistakes with cost

Pricing the prompt and forgetting the answer, when output usually costs several times what input does and is the half you cannot predict. The other is measuring a prompt against a context window without leaving room for the reply, which fails the call after the prompt has already been paid for.

Questions to practice

Questions last reviewed 19 October 2026.

Roles this comes up in

Companies these come from

Other topics