PRACTICE GUIDE HEADLANDS
Headlands C++ Problem: what the test is, and how to train for it
The Headlands c++ problem screen is 1 questions in 20 minutes - about 20 minutes each - written in a code editor and run against tests you cannot see. There is no negative marking, so leaving an item blank gains you nothing over guessing.
Where it sits: C++ round. The practice sitting on this page runs the same item count, the same clock and the same marking rule, with questions generated by Outcry rather than taken from Headlands Technologies.
Outcry is not affiliated with Headlands Technologies and has no access to their assessment content. This guide describes an assessment format that candidates report publicly; the questions here are generated by Outcry and are not Headlands Technologies’s own.
What it screens
A Chicago-based quantitative trading firm making markets in listed derivatives.
- ✓Reading concurrent code and pointing at the defective line
- ✓Order-book data structures: what happens on a cross, a cancel, a partial fill
- ✓Algorithmic complexity chosen for the input sizes stated in the problem
- ✓Monte Carlo methods and when a simulation beats a closed form
Where it sits at Headlands Technologies
This section does not arrive on its own. It is section C of 4, and the sitting around it runs 70 minutes and 17 items in total, with Statistics multiple choice, Free-response statistics and Multi-language problems on the same continuous clock. Candidates who prepare only for this round tend to be caught by the pacing of the rest.
There is no going back. You answer or skip, and the next item loads, which means the decision to leave an item is final at the moment you make it.
The format
These are the numbers the Headlands sitting on this site runs on, matching the format candidates report.
| Questions | 1 |
|---|---|
| Time | 20 minutes |
| Per question | 20 minutes |
| Negative marking | No |
| Answer style | Code editor, run against hidden tests |
| Where it sits | C++ round |
What it tests, with a worked example
Every example below is generated by Outcry, drawn from the same question generators the timed drills run. None of them is Headlands Technologies’s.
Complexity that is actually graded
Hidden tests sized so the naive solution times out. A correct answer that is too slow scores the same as a wrong one.
Reading someone else's code
A diff or a function with a bug in it, and the question is where.
Example
Position is accumulated in a double and the code tests `if (position == 0.0)` to detect flat. What goes wrong?
- Comparing doubles is undefined behaviour
- The compiler removes the comparison
- 0.0 and -0.0 compare unequal
- Accumulated rounding leaves a residue, so the test is false when the book is flat
Answer Accumulated rounding leaves a residue, so the test is false when the book is flat
Adding and subtracting fills in binary leaves a residue around 1e-15. Compare against a tolerance, or hold size in integer lots and never in a double.
Numerical and data handling
Floating point, aggregation and joins on data that does not fit the obvious shape.
Example
A price walks on the whole numbers 0 to N. Each step it moves +1 with probability p and -1 with probability 1 - p, independently. It stops the first time it touches 0 or N. N = 8 start = 4 p = 0.6 One question, six parts. Each part uses the part before it.
Part 3 of 6. Now use p = 0.6. What is the probability the walk stops at N?
Answer 0.8350515463917525
With drift the answer is (1 - r^start)/(1 - r^N) where r = (1-p)/p = 0.6667. That is (1 - 0.1975) / (1 - 0.039) = 0.8351. Part 1 gave 0.5, so the drift is worth 0.3351 here.
Edge cases
Empty input, one element, duplicates and overflow. The hidden tests always include them.
Statistics in code
Rolling windows, correlations and quantiles, implemented rather than imported.
Example
A population has standard deviation 8. What is the variance of the mean of 25 independent draws?
- 1600
- 64
- 2.56
- 0.32
Answer 2.56
Var(X̄) = σ²/n = 8²/25 = 64/25 = 2.56. The three wrong options are the population variance 64 left undivided, the standard deviation over n rather than the variance, and 1,600 - the variance multiplied by n instead of divided by it.
Reading a spec precisely
Return type, ordering and tie-breaking are graded, and are where most silent failures come from.
What a good score looks like
On a paper of 1 questions with no penalty for a wrong answer, the only thing an unanswered question can do is cost you. Coding screens are usually pass-fail on hidden tests rather than scored, and candidates commonly report that a solution passing every correctness test still fails on a timeout. Treat full marks as solving every problem inside the complexity bound, not merely solving it.
How to train for it
- 01State the complexity before you write. If it is worse than the input size allows, the approach is already wrong.
- 02Write the edge cases into your own tests first. That is where the hidden ones live.
- 03Practise without an autocomplete. The screens run in a bare editor, and the gap between writing code with help and without it is larger than most people expect.
TRAIN IT HERE
The drills that match each section
Concurrency Clash
Find the data race, name the fix - real C++ defect patterns, five levels.
Order Book
Matching-engine mechanics: crosses, cancels and partial fills.
Algorithm Lab
DP tables, Monte Carlo estimation and speed rounds at four difficulty tiers.
SIT THE FULL BATTERY
All the sections back to back on one clock, marked the way the real screen marks them, with a by-skill breakdown at the end. Included with any pass.
Also reported at Headlands Technologies
Common questions
- Is the Headlands c++ problem test multiple choice?
- Code editor, run against hidden tests. You write and run code against tests you cannot see.
- How long is the Headlands c++ problem test?
- 1 question in 20 minutes, which is about 20 minutes each.
- Is there negative marking on the Headlands c++ problem test?
- No. A wrong answer costs nothing beyond the mark you would have earned, so leaving an item blank is never better than guessing at it.
- How do I practise for it free?
- Every drill linked on this page is free to play, with no account, inside a daily run cap. Questions are generated fresh each run, so there is nothing to memorise between attempts. The full Headlands Quant Research Screen sitting puts the sections back to back on one clock.