KatInterview

Build a Regression-Testing Platform for LLM Agent Releases

System DesignModel answer
MediumModel answerSystem Designml-system-designllm-evaluationagents

Last updated

Design a platform where agent-building teams can test a new prompt or model against a baseline and see the effect on answer quality, tool usage, latency and cost before shipping.

Several product teams in your company build LLM-powered agents. One example is an agent that reads customer-support call transcripts and writes a structured summary report. These teams change their agents often: they edit the system prompt, swap in a different model, or modify the set of tools the agent can call. Today they judge such changes by eyeballing a handful of outputs, and regressions reach production.

Design a shared platform that lets a team evaluate an agent configuration and compare it with another one (for instance the current production version against a proposed change).

The comparison should cover at least:

  • Output quality (is the report correct, complete and faithful to the transcript?)
  • Tool use (did the agent call the right tools with the right arguments, and avoid needless calls?)
  • Speed (end-to-end latency and its tail) and, ideally, cost
  • The effect of changing the system prompt versus changing the model

In your answer, discuss:

  1. Clarifying questions and the assumptions you make
  2. Core data model and how versions are tracked
  3. How evaluations are executed at scale
  4. How outputs are scored, including cases with and without ground truth
  5. How two versions are compared in a statistically sound way
  6. The user-facing surface (APIs, reports, CI integration)
  7. Privacy, multi-tenancy, cost control and online evaluation

Hints

Hint 1

Treat an agent version as an immutable, hashable bundle (model, parameters, prompt, tool definitions). Everything else, such as datasets, runs and results, should reference versions by ID so any result can be reproduced.

Hint 2

LLM output is nondeterministic and datasets are small, so a single pass with an average score is misleading. Think about repeated runs, paired comparison on the same cases, and confidence intervals.

Hint 3

Separate cheap deterministic checks (schema validity, tool-call trajectory, latency) from expensive judgments (LLM judge with a rubric), and decide how you will check that the judge agrees with human reviewers.