Coding rounds usually ask for a small circuit or a short classical routine around one. Knowing one framework well is better than skimming five.
15 questions. Reviewed December 2026. Answers are model answers to adapt, not scripts to memorise.
1 · Beginner
Write a circuit that makes a Bell pair and measures it. What counts do you expect?
H on qubit 0, CNOT from 0 to 1, measure both. Over many shots you expect roughly half 00 and half 11 and essentially no 01 or 10 on a simulator; on hardware a few percent of the odd outcomes come from noise. The same circuit appears in all seven frameworks on this site’s comparison pages.
Likely follow-up: How would you add a third qubit for a GHZ state?
Go deeper: Frameworks compared · Circuit Builder
2 · Beginner
Which quantum framework would you pick for a first project, and why?
A reasonable answer names one and justifies it by the task: Qiskit for IBM hardware and a broad ecosystem, Cirq for Google-style circuit control, PennyLane for variational and machine-learning work with automatic differentiation, Q# for resource estimation, Braket for multi-vendor cloud access, pytket for compilation, CUDA-Q for GPU-accelerated simulation. There is no single best.
Likely follow-up: What would make you switch?
Go deeper: Head-to-head comparisons
3 · Intermediate
Why do bitstrings look reversed between frameworks?
Qubit ordering conventions differ: some frameworks treat qubit 0 as the least significant bit and print it on the right, others as the leftmost. The same circuit can therefore print “01” in one and “10” in another. Always check the convention before comparing results or converting circuits.
Likely follow-up: How would you detect this in a test?
Go deeper: Circuit Converter
4 · Intermediate
How would you write a simple statevector simulator?
Store 2ⁿ complex amplitudes. To apply a single-qubit gate to qubit k, loop over index pairs differing in bit k and mix them with the 2×2 matrix; for a CNOT, swap pairs where the control bit is 1. Memory is 2ⁿ·16 bytes in double complex, so about 16 GiB at 30 qubits. Sampling: draw from the probabilities |amplitude|².
Likely follow-up: How would you handle measurement collapse?
5 · Intermediate
What is transpilation, and what could go wrong?
Rewriting a circuit to a device’s native gates and connectivity. Possible problems: depth blow-up from SWAPs, accuracy loss from approximate synthesis, global phase dropped (harmful if the circuit is later controlled), and optimisations that assume ideal gates. Compare the transpiled circuit’s output to the original on a simulator.
Likely follow-up: How would you verify equivalence?
Go deeper: Qiskit
6 · Intermediate
How would you test a quantum program?
Use small cases with known answers on a statevector simulator, assert on probabilities with a tolerance rather than exact equality, check invariants (normalisation, symmetries), use property-based tests, and keep separate hardware tests that account for noise through statistical bounds on counts.
Likely follow-up: How many shots do you need for a given tolerance?
7 · Intermediate
Coding task: implement the oracle and diffusion for 2-qubit Grover marking |11⟩.
Prepare H on both qubits. Oracle: a controlled-Z between the qubits flips the sign of |11⟩. Diffusion: H on both, X on both, controlled-Z, X on both, H on both. For N = 4 with one marked item, one iteration finds |11⟩ with certainty, because sin θ = ½ gives θ = π/6 and (2·1+1)θ = π/2. Verify with a simulator. Code samples on this site are not executed by us, so run yours.
Likely follow-up: How many iterations for 3 qubits and one marked item?
Go deeper: Grover’s Builder
8 · Advanced
How can a simulator go beyond 50 qubits?
Exact statevectors need 2ⁿ amplitudes, about 16 PiB at 50 qubits, so larger simulations use structure: tensor networks for low-entanglement or shallow circuits, stabiliser methods for Clifford-dominated circuits, Pauli propagation, or sampling methods. They trade generality for scale and can fail when entanglement or non-Clifford content grows.
Likely follow-up: When does a matrix-product-state simulator fail?
9 · Advanced
How would you design an API for running circuits on several hardware vendors?
Define an intermediate representation for circuits (for example OpenQASM), separate the device description (native gates, connectivity, noise data) from the circuit, compile per backend, and return results in a common format. Handle job queues asynchronously, record backend calibration data with each result for reproducibility, and surface convention differences like qubit order explicitly.
Likely follow-up: What would you store with each result?
Go deeper: Circuit Converter
10 · Beginner
What is OpenQASM and why is it used?
A text format for describing quantum circuits that many tools can read and write. It lets you move a circuit between frameworks, store it, and send it to hardware. Versions differ (2 and 3), and not every tool supports every feature, so check the version.
Likely follow-up: What might be lost in conversion?
Go deeper: Circuit Converter
11 · Beginner
How many shots should you run, and why does it matter?
Each probability is estimated from counts, with standard error about √(p(1−p)/shots). For p = 0.5 and 1,000 shots the error is about 1.6 percentage points; for 10,000 shots about 0.5. Choose shots from the precision you need.
Likely follow-up: How many shots for ±0.1 percentage points at p = 0.5?
12 · Intermediate
Write the steps to implement a quantum random number generator.
Put each qubit in |+⟩ with a Hadamard, measure, and concatenate the bits. On an ideal simulator each bit is unbiased. On real hardware noise causes bias, so you would test the output statistically and apply a randomness extractor before use in security. A simulator’s pseudo-randomness is not true randomness.
Likely follow-up: Why is a simulator output not suitable for key generation?
13 · Intermediate
How would you debug a circuit that gives wrong probabilities?
Reduce it to the smallest failing case, check against hand-computed amplitudes on a statevector simulator, inspect gate order and qubit ordering conventions, verify the measurement mapping, and only then consider noise. Bisect the circuit by measuring after intermediate layers.
Likely follow-up: What is the most common cause you have seen?
14 · Intermediate
What is parameter binding and why does it matter for variational code?
Building the circuit once with symbolic parameters and assigning numbers at run time avoids rebuilding and re-transpiling it for each optimiser step. It saves large amounts of time when thousands of evaluations are needed.
Likely follow-up: What else can you cache?
Go deeper: PennyLane
15 · Advanced
How would you estimate the resources of a fault-tolerant algorithm?
Count logical qubits and T gates (or rotations), choose a code and distance from the target logical error, compute physical qubits per logical qubit, add magic-state factories, and divide total operations by the cycle time. Tools like Q#’s resource estimator automate this. The result depends strongly on the assumptions, so report them.
Likely follow-up: Which assumption moves the answer the most?
Go deeper: Q#