Guia de entrevista · AI / LLM Engineering

How do you optimize LLM cost and latency?

do caderno de estudos · atualizado em 2 de outubro de 2026
Para quem vai encarar entrevista de AI / LLM Engineering2 min

Resposta curta e em inglês, para ler, fechar e treinar em voz alta.

A resposta, como você fala na entrevista
  1. Routing: compare smaller models or deterministic code for suitable tasks, with a tested escalation policy.
  2. Prompt caching: supported providers may reuse computation for an eligible matching prefix. Keep stable content first where the provider requires it. Check minimum sizes, retention, hit rates, and pricing.
  3. Semantic caching: reuse only when the question's meaning, current permissions, source versions, and answer contract permit it. Similarity alone is not a safe cache hit.
  4. Streaming: expose incremental output to reduce waiting for visible progress. Measure time to first output and total duration separately. Streaming does not guarantee a faster complete answer.
  5. Token budgets: remove irrelevant context and choose output limits that still allow a complete result. Track retries and truncation as costs too.
  6. Batch processing: non-interactive work may fit a provider's asynchronous batch offering. Check its actual price, limits, and completion window instead of assuming a fixed discount.

Ler é o primeiro passo. No app, essa pergunta vira flashcard com repetição espaçada, e o módulo tem quiz e simulado para testar o que ficou.

Treinar essa pergunta no app