KatInterview

Designing Reliable Benchmarks and Regression Tests on Shared Clusters

System DesignModel answer
MediumModel answerSystem Designqabenchmarkingregression-testing

Last updated

Describe how to run performance benchmarks and functional regression tests as separate tracks, and how to cut a benchmark's shared-cluster footprint while keeping results comparable.

You own quality for a software product whose test effort has two parts: a performance benchmark suite and a functional regression suite. The benchmark jobs are heavy and run on a shared high-performance computing (HPC) cluster, where they consume a large share of the allocation.

Describe how you would handle both kinds of testing, and how you would lower the benchmark's resource footprint while keeping its results meaningful.

No test framework, hardware, or performance target is given. State any assumptions, and list the questions you would ask first, for example:

  • What does the benchmark measure, and must results be comparable across software versions or across machines?
  • Which resources do jobs reserve, and which do they actually use?
  • Which product behaviors does the regression suite protect, and how are failures triaged today?

Do not invent measured improvements or details of a past project. Describe a method and the evidence you would gather.

Part 1: Two test tracks. Contrast the goals of benchmarking and functional regression testing. For each, describe the inputs, the expected results or baselines, the execution conditions, and the failure signals. Explain how you would fix a noisy benchmark or a flaky regression test without hiding a real defect. Cover how a found defect becomes a permanent regression case, and how a performance change is investigated before any baseline is updated.

Part 2: Reducing HPC usage. Explain how you would find where resources are wasted, choose changes, and show that lower usage has not made the benchmark unrepresentative or incomparable with earlier runs.

Hints

Hint 1

Functional tests assert exact, deterministic outcomes; benchmarks produce distributions that you compare statistically against a baseline. Design each one's pass/fail rule accordingly.

Hint 2

Separate what a job requested (cores, memory, wall-time) from what it used (CPU utilization, peak memory, I/O wait) and from queue wait time. Waste usually appears as the gap between requested and used.

Hint 3

Any optimization should be tied to a measured bottleneck and validated by running old and new configurations on a preserved, representative workload under the same conditions, with the environment changes recorded.