Skip to content
Tech Interview Prep
Technical interview guide

Quantum Programming Frameworks

The practical toolchain a quantum software engineer works in day to day (Qiskit, Cirq, and PennyLane) and the difference between simulators and real hardware backends.

Read
53 min
Practice MCQs
25
Interview Q&A
25
Edition
v2
Editorial status
Reviewed

Scope: Qiskit current; Cirq current; PennyLane 0.45; Amazon Braket current; OpenQASM 3; QIR current documentation reviewed 2026-09-04.

Curated: · Written: · Reviewed:

25 questions

MCQ-4An engineer builds a circuit on three line qubits, appending gates one at a time with Cirq's default insertion strategy: ```python q0, q1, q2 = cirq.LineQubit.range(3) c = cirq.Circuit() c.append(cirq.X(q0)) c.append(cirq.Y(q1)) c.append(cirq.Z(q0)) c.append(cirq.H(q1)) c.append(cirq.CNOT(q0, q2)) ``` Which statement correctly describes the moments of `c`?
MCQ-2A team builds a 4-qubit `QuantumCircuit`: `H` and `CX` gates, then a mid-circuit `measure` on qubit 1 whose classical bit conditions a later `X` on qubit 3, and a `reset` on qubit 0. They call `Operator(qc)` to extract a unitary matrix and it raises a `QiskitError`, while `qc.depth()` and `qc.count_ops()` return normally. What is the correct diagnosis?
MCQ-8A team runs a 50-iteration variational loop as one Amazon Braket Hybrid Job, submitting a parameterized circuit to the IonQ Aria QPU each iteration. Iteration 37 returns a bad expectation value, and they need to re-fetch only that run's results and attribute its per-shot cost. Which Braket object carries the ARN, the shot count, and the S3 result location for that single submission?
MCQ-3A team needs ⟨H⟩ for H = 0.6·Z₀Z₁ + 0.8·X₀X₁ on a 2-qubit circuit. They submit the circuit once to Sampler with shots=4096, average the (+1/−1) products of the returned bitstrings, multiply by 0.6, and report 0.58. Re-running with 40,960 shots gives 0.58 again. What accounts for the result?
MCQ-16A team ports a 3-qubit Qiskit circuit to Cirq. One operation is a custom 2-qubit gate `U` defined in Qiskit by a 4x4 unitary matrix; it acts on qubits 0 and 2. Cirq has no gate named `U` but does have `cirq.MatrixGate`. The port must preserve the circuit's action up to global phase. What should the translation do with `U`?
MCQ-5A team submits a 12-qubit, depth-40 circuit to a 27-qubit transmon device whose native gate set is {RZ, SX, CZ}. The current calibration snapshot reports a CZ error of 0.4% on edge (3,5), 1.2% on edge (5,8), a readout error of 0.1% on qubit 7 and 0.1% on qubit 12, and a worst edge anywhere on the device of 5.0%. The circuit applies CZ on (3,5) and (5,8) and measures qubits 7 and 12. The submission pipeline rejects any circuit that touches an edge or qubit whose reported error exceeds 1.0%. What does the pipeline return?
MCQ-18A team needs a reference for the ideal output distribution of a 30-qubit circuit before running it on hardware. Their statevector simulator holds one complex128 amplitude (16 bytes) per basis state and runs on a node with 64 GiB RAM, 60 GiB usable; the plan is 100,000 shots. Which assessment of the simulator as the reference oracle is correct?
MCQ-11A team compiles 40 Q# operations into one QIR module and runs it on their simulator. The same module fails to load on a new trapped-ion QPU: the loader reports unresolved symbols for several `__quantum__rt__*` functions that the simulator's runtime supplied. `llvm-as` and `opt` accept the module unchanged. What is the most likely explanation?
MCQ-10A team compiles a 3-qubit OpenQASM 3 program that places `delay[100 ns] q[0];` between two `sx` gates, then runs it on a backend whose compiler reports no parse errors. The executed schedule shows the two `sx` gates back to back, with no 100 ns gap. The same file, run through a second toolchain that advertises pulse-level support, reproduces the gap. What does the first toolchain's behavior indicate?
MCQ-12A team serializes trained Qiskit `QuantumCircuit` objects to disk so a nightly job can reload them and append calibration-aware gates before submitting to hardware. They currently export to OpenQASM 3 text. On reload, custom `Instruction` subclasses that carry per-qubit pulse calibrations come back as opaque `Instruction` objects with no calibration data, and the appended gates fail to schedule. Which change addresses the root cause?
MCQ-9A service transpiles each circuit once with `transpile(circuit, coupling_map=LINEAR_8, basis_gates=['cx','rz','sx','x'])`, stores the QPY, and submits that same artifact to a simulator and to a 127-qubit QPU. The simulator returns counts. The QPU job is rejected: the artifact places a two-qubit gate on physical pair (6,7), which the QPU's target does not list, and it is written in `cx`, while the target's two-qubit entry is `ecr`. Which change makes the QPU submission run?
MCQ-25A five-qubit circuit with six CX gates between logical qubits 0 and 4 is transpiled at optimization_level=3 for a device whose coupling map is the line 0–1–2–3–4. The transpiled circuit reports 14 CX gates and depth 21, and the sampled distribution is visibly broadened relative to the ideal. Which statement accounts for the reported counts and the fidelity loss?
MCQ-7A team trains the same 8-parameter variational circuit with the same optimizer and 1024 shots per evaluation, first on a statevector simulator using adjoint differentiation, then on a superconducting QPU whose SDK exposes only parameter-shift. The QPU burns far more circuit executions per gradient step. Why?
MCQ-6A team trains a 4-parameter circuit on `default.qubit` with `interface="auto"` and `diff_method="best"`, passing autograd tensors as parameters and using the same gradient-based optimizer throughout. The simulator run logs 100 executions and finishes in about 2 seconds. They keep the quantum function, the optimizer and `diff_method="best"` unchanged, but swap the device for a hardware backend plugin. The run now logs about 800 executions and takes hours. What explains the extra executions?
MCQ-1A team trains a 40-parameter VQE ansatz inside a PyTorch loop. At 4096 shots per circuit their finite-difference gradients are too noisy to converge, so they need analytic gradients evaluated on the QPU, and the same ansatz must be submitted to both an IBM superconducting device and an IonQ trapped-ion device. Which setup fits?
MCQ-22A team runs a 40-iteration variational loop, submitting one Estimator primitive call per iteration to the same QPU. They want the backend held between calls so each call reuses the same calibration and the queue wait is paid once, and they need to know what happens to iterations still queued if the reservation's time limit expires. Which statement describes the execution model they should rely on?
MCQ-24A team round-trips 24 small circuits through a hosted converter that returns only measurement counts for inputs you supply and never exposes the converted circuit. One circuit is CZ(0,1) followed by measurement of both qubits. The converter's counts match the original's for the inputs |00> and |11>, and the team suspects the converter drops the CZ's relative phase. Which input and measurement would expose the dropped phase?
MCQ-20A provider-neutral adapter ingests three backends into one record `{value: float, shots: int, histogram: dict|None}`: a sampler (bitstring counts over 1024 shots), an estimator (expectation 0.42 with a reported standard error of ±0.031 from a 4096-shot run), and a statevector backend (complex amplitudes, no shots). The dashboard computes every error bar as `1/sqrt(shots)`, so the estimator record shows ±0.0156 and the statevector record divides by zero. Which change makes the dashboard's error bars correct?
MCQ-19A team simulates a 12-qubit GHZ circuit on a density-matrix simulator using a noise model generated from the calibration data of a 127-qubit backend. They report a simulated fidelity of 0.81 and state only 'noise model: backend X'. A week later, a reviewer reruns the same circuit with the same backend name and simulator settings but obtains 0.74. The backend's calibration data has been refreshed in between. What should the team have included to make the first result reproducible?
MCQ-21Your service submits a 10,000-shot circuit to a quantum cloud provider. The provider charges $0.00035 per shot and enforces a 20-job daily quota per account. The submit call uses an idempotency key generated before the request and stored in your DB. After 30 s the HTTP client returns 504 Gateway Timeout; the provider's status endpoint is reachable. Your DB row has the idempotency key but no provider job ID. The provider API supports a lookup by idempotency key that returns 404 when no job exists. What should the retry path do?
MCQ-23A nightly job submits 200 circuits to a quantum backend. `requirements.txt` pins the SDK exactly (`sdk==1.1.0`) and its lockfile hash is unchanged all week; the hardware provider plugin is installed with no version. Monday: 200/200 submissions succeed. Thursday, with no source change: 200/200 fail inside the plugin's job-submission call with an unexpected-argument error, and the same circuit now transpiles to depth 61 instead of 42. Thursday's `pip freeze` shows `sdk==1.1.0` and `provider-plugin==0.11.0`, released Wednesday; Monday's showed `provider-plugin==0.10.0`. Which diagnosis fits the evidence?
MCQ-15A compiler team stores a parameterized circuit's free parameters in a table keyed by the parameter's name string. Two subroutines from a third-party library were written independently: each declares a parameter named `theta`, one used as `rx(theta)` on qubit 0 and the other as `ry(theta)` on qubit 1. The subroutines cannot be edited. A sweep runner binds values by looking up each name in the table and substituting. The team expects a two-dimensional sweep over the two angles. What does the runner actually produce, and what is the correct fix?
MCQ-17A team ports a dynamic error-detection circuit from target A to target B. The circuit measures an ancilla mid-circuit and applies a conditional X to the data qubit when the ancilla reads 1; the data qubit is then measured. On target A the measurement-to-conditional latency is 0.5 µs and the data qubit's T2 is 80 µs; the corrected logical error rate is 1.4%, versus 2.1% with the conditional removed. On target B the control stack reports a measurement-to-conditional latency of 15 µs and the data qubit's T2 is 6 µs. Running the identical source on target B gives a corrected logical error rate of 3.0%, versus 2.1% with the conditional removed. Both targets accept the source, report identical gate counts, and have the same ancilla readout fidelity (99%) and two-qubit gate fidelity (99.5%). What best explains target B's result?
MCQ-13A transpiler pass normalizes every single-qubit block in its IR to a rotation-only form. It rewrites the S gate, diag(1, i), as RZ(pi/2), diag(e^(-i*pi/4), e^(i*pi/4)), which equals S only up to the global phase e^(-i*pi/4), and it drops that phase instead of recording it as global-phase metadata. Standalone regression tests pass: the two forms give identical single-qubit measurement statistics on every input state. The converted block is then embedded as a controlled operation. The control is prepared in |+> = (|0> + |1>)/sqrt(2), the target in |1>, the block is applied, and the control is measured in the X basis, where P(X = +) = (1 + cos theta)/2 for a relative phase theta between the control's two branches. What should the team expect from the build that keeps the metadata, and from the build that drops it?
MCQ-14A firmware team's protocol tests encode each message with their own encoder and decode it with their own decoder; every round-trip passes. The protocol specifies a 4-byte big-endian length field. In the field, a host reports a length of 16,777,216 for a message the sender built with length 1 and drops the frame. Which test would have failed before shipping?