Skip to content
Tech Interview Prep
Technical interview guide

Variational Algorithms & NISQ Computing

How hybrid classical-quantum loops like VQE and QAOA are designed to extract value from today's noisy, error-uncorrected hardware.

Minutes to read
4
Practice MCQs
25
Interview Q&A
25
Edition
v3
Editorial status
Reviewed

Scope: IBM Quantum current variational, VQE, Estimator, mitigation, runtime, and transpiler guidance; foundational VQE, QAOA, and barren-plateau literature reviewed 2026-09-04.

Overview

Curated: · Written: · Reviewed:

Variational Algorithms & NISQ Computing

In one line

A hybrid loop in which a shallow parameterized circuit prepares a trial state, the quantum device estimates a cost from finite shots, and a classical optimizer proposes new parameters. Reach for it when the problem is a ground-state energy or a combinatorial cost, and the device is too noisy and shallow for a deep algorithm with error correction.

Key definitions

  • Ansatz: the parameterized circuit. It sets which states the loop can reach, so it bounds the answer.
  • Pauli decomposition: H = Σᵢ cᵢPᵢ. The coefficient sum sets the measurement cost.
  • Qubit-wise commuting group: Pauli terms that can be read from one shared measurement basis setting.
  • Shot noise: the standard error on each estimate. Report it with every energy.
  • Barren plateau: gradient variance that falls exponentially with qubit count for deep, unstructured ansätze.
  • Error mitigation: removes bias from gate and readout error, and inflates variance in exchange.

Formulas and complexity

N=(∑i∣ci∣ϵ)2N=\left(\frac{\sum_i |c_i|}{\epsilon}\right)^2

Shots for one energy evaluation at standard error ε, with allocation proportional to |cᵢ|. Grouping reduces the effective sum to ∑g∑i∈gci2\sum_g \sqrt{\sum_{i\in g} c_i^2}

Parameter shift needs two circuit evaluations per parameter, so a 200-parameter ansatz costs 400 energy estimates per gradient step.

Reference figures: Σ|cᵢ| = 20 Ha at ε = 1.6 mHa (chemical accuracy) gives about 1.6 × 10⁸ shots per evaluation. A 10× tighter target costs 100× more shots.

How it works

Parameters θ go to the device. The device prepares the ansatz state and measures each commuting group. The estimates are combined into ⟨H⟩ with a standard error. The optimizer uses that noisy value to pick the next θ, and the loop repeats until the stopping rule fires.

no yes Parameters theta Prepare ansatz state on device Measure grouped Pauli terms Weighted sum: energy with standard error Classical optimizer step Stopping rule met? Report energy with SE and shot count

The optimizer sees a noisy, finite-shot function, not an exact landscape. Convergence of the optimizer is not evidence of a global or physical optimum.

When to use and when not to

SituationUse the variational loop?
Small instance, classical simulation fitsNo: simulate it exactly, and use it for debugging
Deep circuit needed to reach the answerNo: coherence limits the depth (T₂ near 100 µs, two-qubit gates near 100 ns)
Gradient variance collapses with qubit countNo, at that size: the run is unbudgetable
Shot budget closes at the target errorYes, if the budget and wall time are reported
A classical method solves it faster and exactlyNo
Ground-state energy with a need for an upper boundYes: the variational principle gives one

Traps interviewers probe

  1. Point estimate with no error bar. Fix: report the standard error and the shot count with every energy.
  2. Sign or qubit-ordering mismatch between Hamiltonian and ansatz. Fix: check that the reference state and Hamiltonian use the same encoding, for example Jordan–Wigner, and compare small cases to exact diagonalization.
  3. Dropping terms from the cost. Measuring only the diagonal terms and calling the result ⟨H⟩ gives a wrong energy. Fix: measure every term that contributes, including the X and Y terms. The identity offset is free to add back, not to drop.
  4. Blaming the optimizer for a flat landscape. Fix: sample gradient variance at random parameters for several qubit counts before choosing an optimizer or a deeper circuit.
  5. Claiming advantage against a weak baseline. Fix: compare against a tuned classical method on the same instances and the same wall-clock budget, not against Hartree–Fock or random assignment.

Interview tips

Opening: the loop exists because deep circuits decohere before they finish. Shallow circuits are parameterized, and a classical search does the rest.

Expected follow-ups:

  • Why not simulate it? For small sizes, you should. The loop only pays off where statevector simulation becomes exponential.
  • Which cost dominates runtime? Usually shot budget and queue latency, not gate count.
  • How would you cut the shot budget? Measurement grouping, coefficient-weighted allocation, a shallower ansatz. Each has a stated cost.
  • Why does the variational bound hold, and when is it loose? Expectation is at least the ground energy for any state. It is loose when the ansatz cannot reach the ground state.

30-second outline: Name the split: quantum device estimates a cost from shots, classical optimizer updates θ. Give the shot arithmetic for the target error. State the trap you are guarding against, such as a sign mismatch or an unmeasured baseline. Close with what you would report: energy, standard error, shots, wall time, and the classical comparison.

Feedback on this overview

Log in free to save your progress and keep bookmarks and notes for a quick revision before your interview.