cost
Applied AI interview questions tagged cost, across every topic.
17 questions · 2 unlocked for you
Concepts behind "cost"
The curriculum that explains the ideas these questions test.
Foundational
The LLM GatewayAn LLM gateway is a single proxy layer between your application and one or more model providers. It centralizes the cross-cutting concerns every LLM app needs: routing and fallback across models/providers, caching, rate limiting, authentication, cost tracking, observability, and guardrails. It also prevents vendor lock-in by abstracting providers behind one interface. Applied-AI interviews probe it because it is the backbone of a production LLM platform and the place most operational controls live.⚙️ System Design for AI in Production
Foundational
LLM Cost OptimizationLLM systems get expensive fast, and the cost model is mostly tokens and number of model calls. The levers, in rough order of impact: route easy queries to cheaper/smaller models, cache repeated and similar requests, trim context (fewer, better chunks), use cheaper retrieval/reranking, and for agents cut unnecessary steps. The discipline is measuring cost per request and attacking the dominant contributor. Applied-AI interviews probe it because cost is a primary production constraint and most teams overspend by defaulting to the biggest model on everything.⚙️ System Design for AI in Production
Core
Small vs Large Models and RoutingBigger is not always better in production: small models are far cheaper and faster, and for many tasks they are good enough, especially when fine-tuned or given retrieval. The mature pattern is routing, send easy queries to a small/cheap model and reserve large or reasoning models for genuinely hard ones, often with a cascade that escalates on low confidence. Applied-AI interviews probe it because picking and routing models is where most of the cost and latency budget is won or lost.🧠 Foundations of LLMs & GenAISign in
Core
Retrieval vs Long ContextWhen you can fit a whole document in a model's large context window, should you, or should you retrieve only the relevant chunks? Long context is simpler but expensive (quadratic attention), slower, and unevenly used (lost in the middle); retrieval is cheaper, faster, updates without retraining, and surfaces only what matters. The answer is usually retrieval for large, changing, or partially-relevant corpora, and long context for small, cohesive inputs. Applied-AI interviews probe it because 'just use the big context window' is a common, costly oversimplification.🤖 Retrieval & AgentsSign in
Core
Prompt and Semantic CachingCaching is one of the cheapest, highest-impact LLM optimizations. Prefix (prompt) caching reuses the computed attention state for a shared prompt prefix (a long system prompt or document), cutting prefill cost and latency. Semantic caching serves a stored answer for a query that is similar (not identical) to a past one, by embedding the query and matching nearest neighbors. Applied-AI interviews probe it because repetitive traffic is everywhere, and caching turns expensive recomputation into near-free lookups, with a correctness caveat for semantic caching.⚙️ System Design for AI in ProductionSign in
