Algorithm questions reward precision about the type of speed-up (exponential, quadratic, query-only) and about the assumptions behind it. Know one algorithm well enough to walk through on a whiteboard.
12 questions. Reviewed December 2026. Answers are model answers to adapt, not scripts to memorise.
1 · Beginner
What problem does Grover’s algorithm solve, and how fast is it?
Unstructured search: find a marked item among N using an oracle that recognises it. Grover needs about (π/4)√N oracle calls, against about N/2 on average for a classical search. The speed-up is quadratic and provably optimal for this problem. For N = 1,000,000 that is about 785 iterations.
Likely follow-up: What happens if you run too many iterations?
Common mistake: Calling it exponential, or forgetting the oracle must be implemented as a circuit.
Go deeper: Grover’s algorithm · Grover’s Builder
2 · Beginner
Why is Shor’s algorithm important?
It factors an integer in polynomial time on an ideal quantum computer, whereas the best known classical algorithms are sub-exponential but super-polynomial. Since RSA security relies on factoring being hard, a large enough fault-tolerant machine would break it. That threat is the main driver of the move to post-quantum cryptography.
Likely follow-up: Does Shor’s algorithm break AES?
Go deeper: Shor’s algorithm · Shor’s Lab
3 · Intermediate
Describe the structure of Shor’s algorithm.
Factoring N reduces to finding the order r of a random a modulo N. The quantum part is period finding: prepare a superposition, compute a^x mod N into a second register, apply the QFT to the first register, and measure to get a value near a multiple of 2ⁿ/r. A continued-fraction step recovers r. Then, if r is even and a^(r/2) ≠ −1 mod N, gcd(a^(r/2) ± 1, N) gives factors. For N = 15 and a = 7 the order is 4, giving gcd(48, 15) = 3 and gcd(50, 15) = 5.
Likely follow-up: What if r is odd?
Go deeper: Shor’s Lab
4 · Intermediate
How does Grover’s algorithm work geometrically?
The state lives in a two-dimensional plane spanned by the marked state and the uniform superposition of unmarked states. The oracle reflects about the unmarked axis, and the diffusion operator reflects about the uniform state. The two reflections compose to a rotation by 2θ, where sin θ = √(M/N). Each iteration moves the state about 2θ toward the marked state, so about π/(4θ) iterations are needed.
Likely follow-up: What if you do not know M, the number of marked items?
Go deeper: Grover’s Builder
5 · Intermediate
What is the Deutsch–Jozsa problem and what does it show?
A function f on n bits is promised to be constant or balanced. Classically a deterministic solution may need 2^(n−1)+1 queries; the quantum algorithm needs one. It shows a separation between exact quantum and deterministic classical query complexity, but the problem is artificial, and a randomised classical algorithm solves it with a few queries and tiny error probability, so it is not evidence of practical advantage.
Likely follow-up: Why does a randomised classical algorithm weaken the claim?
Common mistake: Presenting it as proof that quantum computers are exponentially faster in general.
6 · Intermediate
What do Bernstein–Vazirani and Simon’s algorithms do?
Bernstein–Vazirani finds a hidden bit string s from an oracle f(x) = s·x using one query, where a classical algorithm needs n. Simon’s algorithm finds a hidden period s with f(x) = f(x⊕s), using about n queries where any classical algorithm needs exponentially many. Simon’s problem inspired Shor’s algorithm.
Likely follow-up: What does a measurement in Simon’s algorithm return?
7 · Intermediate
What is the quantum Fourier transform and how big is its circuit?
The QFT applies the discrete Fourier transform to the amplitudes of an n-qubit state. It can be built from Hadamards and controlled phase rotations, with n(n+1)/2 such gates in the textbook version (about n²/2), plus swaps. For n = 8 that is 36 gates against the FFT’s cost on 256 numbers. You cannot read out all amplitudes, so the QFT is only useful inside larger algorithms.
Likely follow-up: Why is the QFT not a faster FFT for general data?
Go deeper: Quantum Fourier transform
8 · Intermediate
Explain quantum phase estimation.
Given a unitary U and an eigenstate |u⟩ with eigenvalue e^{2πiφ}, phase estimation finds φ to n bits using n counting qubits. Controlled-U^(2^k) operations kick the phase into the counting register, and an inverse QFT converts it into a bit string. It is the engine inside Shor’s algorithm, HHL and quantum chemistry energy estimation.
Likely follow-up: What accuracy do you get per extra counting qubit?
9 · Advanced
What are the caveats of the HHL algorithm?
HHL prepares a quantum state proportional to the solution of Ax = b in time polylogarithmic in the dimension, under conditions: A must be sparse and well conditioned, the vector b must be loadable efficiently, and you get a quantum state, not the vector, so reading out all entries erases the gain. Dequantisation results show that some related machine-learning speed-ups can be matched classically.
Likely follow-up: What is dequantisation?
Common mistake: Saying HHL solves linear systems exponentially faster, with no caveats.
10 · Advanced
Why does amplitude amplification generalise Grover’s algorithm?
Given any algorithm A that succeeds with probability p, amplitude amplification boosts success to near 1 using about 1/√p repetitions rather than 1/p. Grover is the special case where A prepares a uniform superposition. It underlies quantum counting and many quadratic speed-ups for search-like subroutines.
Likely follow-up: Give another use of the same trick.
11 · Advanced
What is the BQP complexity class and how does factoring relate to it?
BQP is the set of decision problems solvable in polynomial time by a quantum computer with bounded error. Factoring (as a decision problem) is in BQP via Shor and is not known to be in P or to be NP-complete. Most researchers expect NP-complete problems to lie outside BQP, but that is not proven.
Likely follow-up: Is BQP known to be larger than P?
Go deeper: Complexity and advantage
12 · Advanced
Which algorithms give exponential speed-ups and which only polynomial ones?
Exponential, with strong evidence: Shor’s factoring and discrete logarithms, and simulating quantum systems (Hamiltonian simulation). Polynomial: Grover search (quadratic), amplitude estimation, and many related results. Many other claimed speed-ups depend on input assumptions or have been matched by improved classical algorithms. A good answer names which category a proposed application falls into.
Likely follow-up: Where does optimisation fit?
Go deeper: Algorithms library