When doing an estimation: how should the margin of safety be calculated?
It depends on the consequences of an incorrect estimation. For civil engineering, miscalculating the maximum load of a bridge has much more devastating consequences than miscalculating what time you will arrive at a friend's house.
Building bridges is a great way to explain the margin of safety. To build safely, engineers estimate more than twice the expected maximum capacity.
"The margin of safety is often sufficient when it can absorb double the worst-case scenarios."
— Shane Parrish
One of my biggest underestimations was integrating with an external system. After some research, it seemed easy, so I estimated it would take two weeks. Yet, it took two months to finish. Even a doubled worst-case estimate would have been wrong. I based my estimate on outdated documentation and did not know the external system well.
This mental model has applications in many domains. It serves as a buffer to provide safety, stability and helps achieve success each time.
Balancing Uncertainty — Engineering
It would be easy if we could time-travel to the future, see the outcome, and come back to adjust. Unfortunately, we can't do that, so we have to rely on our research skills and thought experiments to imagine possible futures.
Understanding the challenge well is key to estimating how much safety margin we need to get the desired outcome.
To be more certain about the future, we can:
Understand functional and non-functional requirements: how critical each part of the system is and what the required availability standards are.
Assess risks: list as many potential risks as we can and use a proper margin of safety to handle them.
Run pre-mortem sessions: imagine our project has failed and learn from this hypothetical situation.
To ensure a sufficient margin of safety, it is important for us to have a clear understanding of the requirements and to address potential risks.
Collaborative Planning — People
We work together to deliver solutions. To plan accurately, we need to know our team's capabilities, skills, and workload.
Important aspects from the team's perspective:
Communicate openly and be realistic: if there are many uncertainties, clearly state what is certain and what is uncertain. The more open you are, the more open your team will be with you.
Point out what is known and unknown: provide context so they can share their concerns. If you leave too many gaps unaddressed, people will fill them with their projections, which you cannot control.
Understanding the strengths and weaknesses of our team is crucial for determining the appropriate margin of safety. Use your knowledge of the team and gather insights from team members to accurately estimate the necessary margin of safety.
Expect Unexpected
No matter how many scenarios we simulate, there will be things that we did not predict.
Black swans exist, although Europeans did not know about that before going to Australia (ancient Roman people even used an expression stating that "black swans did not exist" to describe something impossible).
Sometimes, even the highest possible margin of safety will not work.
We don't have control over unexpected events, but we have control over our reactions to them.
Summary
The margin of safety is the distance between success and failure.
We can reduce this margin, but we must be aware of the consequences of failure. I wish you successful calculations.
Thanks for reading!
Michał
PS: My interest in mental models has been growing over the years thanks to Farnam Street. Their podcast, The Knowledge Project, and their books. FS covered the Margin of Safety using examples of jet engines and investing.
PPS: The three most important words in investing (according to Warren Buffet) are: 'Margin of Safety.'
Post Notes
Discover Weekly — Shoutouts
Articles that might help you explore new perspectives, which I have read recently:
"How to Deal with Salary Reviews 💰" from
— and wrote a comprehensive guide on how to deal with salary reviews from an engineering manager's perspective, including benchmarks from big-tech companies. (I found it aligned with 'Fairness at Work')Future-proofing Your Engineering Career: "Product Engineer's Path" from
— provided great commentary on the evolving role of an engineer."How to get promoted: Lessons from an ex-Amazon VP" from
— wrote a battle-tested guide on the promotion process (lessons from , ex-Amazon VP), stating, 'the gap between your current and future state is usually time, skills, or relationships.'"Don’t be a Spineless Leader: 3 Tips to Lead Better" from
— Being liked does not influence the quality of our decisions, and pleasing everyone does not lead to better results. wrote a great post corresponding to this.
I'm a big fan of these takeaways:
> Assess risks: list as many potential risks as we can and use a proper margin of safety to handle them.
> Run pre-mortem sessions: imagine our project has failed and learn from this hypothetical situation.
I also use ChatGPT to help me with this. The 4o model is a lot better than past ones. I tell it to act like a Principal Engineer and come up with as many risks and things that can go wrong as possible. Even if it doesn't know about the internals of your system, what it comes up with is helpful as a jumping off point.
Thanks for this article and the shout-out, Michał!
There are lessons learned from the Software Engineering books of "ye old days", the one that jumps to mind here is never give a point estimate. Always give a range. When the stakeholder/customer gets a range they don't fixate as much on the low or high, rather they ask "Why?" Then you have their attention to discuss risks, assumptions and known unknowns.