16 November 20264 min read

The coding mistake that taught me how to lead engineering

Early in my career, a query I wrote missed two order statuses, and a large US telecoms operator lost billing revenue as a result. Owning that coding mistake still shapes how I lead engineering.

By Srini Vankeepuram · Engineering and solution architecture leader

Most engineers I respect have a mistake they still think about. Mine came early in my career. It was a coding mistake: a query that missed two numbers. The consequence was a significant loss of billing revenue for a customer.

Two digits

In the early 2000s I was a young engineer with the consultancy I worked for, based onsite at a large US telecoms operator. It was my first time anywhere near billing. Orders moved through statuses numbered from 1 to 11, and I wrote a SQL query that needed to pick up orders across those statuses.

It captured statuses 1 to 9. It didn't capture 10 and 11, the only two-digit ones. Those orders slipped through, and the result was a significant loss of billing revenue for the telecom.

There was nothing clever or exotic about the bug. It was a boundary value, exactly the kind of edge case every testing guide warns about. I created the problem. But it should have been caught at testing, at peer review, at any stage, and it slipped through every one.

ORDER STATUSES1234567891011My queryCaptured statuses 1 to 9; missed the two-digit 10 and 11CapturedStatuses 1 to 9 handled as intendedMissedBilling revenuelost10 and 11 slipped through
The coding mistake: my query captured statuses 1 to 9 but missed the two-digit statuses, 10 and 11. The consequence was lost billing revenue.

Owning it

After a coding mistake like that, there's a moment when it's tempting to go quiet, or to explain why it wasn't really your fault. I put my hand up instead: it was my query, and I would fix it.

Correcting the query was the easy part. The harder part was the data: the orders that had already been missed. People had assumed that clean-up couldn't be done. I worked through it and got it done, and learned that bad data outlives the bug that made it.

Along the way I became known as the "problem creator and problem solver". I've always taken that as a fair summary, and a kind one.

What it taught me

  • Test the edges, not just the middle. Boundary values (the first, the last, the moment a number gains a digit) are where logic breaks.
  • Nothing should go out on one person's word. A second pair of eyes on every deliverable, whether it's a query, a code change, a data fix or a design, is cheap compared with what it protects.
  • Reconcile the output. If a process should handle a set of records, check independently that the counts and totals add up.
ONE PERSON'S FIXCoding mistakeA missed edge caseOwn itMy query; my fixFix itQuery and data clean-upMake it systemicSo it can't recurA TEAM'S GUARDRAILSBoundary testsFirst, last, two digitsPeer reviewOn every deliverableReconciliationOutputs add upBlameless reviewsFix the systemOwned go/no-goSomeone accountableThe aim: no single person's slip reaches a customer.
From one person's fix to a team's guardrails: the lessons only last when they're built into how the team works.

How it shapes the way I lead

Those lessons started as personal habits. Over the years they became how I run teams, because the real lesson wasn't "be more careful". People will always make mistakes; I still make them. The lesson was that one person's slip should never be able to reach a customer. So I keep sharpening how we review and test, to catch errors as early as possible.

So the teams I lead hold blameless reviews when something goes wrong. We look at how the system let the mistake through, not at who typed it, because people who fear blame hide problems, and hidden problems grow.

This applies to every deliverable, not just the ones that touch money: automated tests, boundary values included, peer review, and reconciliation of outputs wherever data moves. My teams have built test harnesses, simulators and test drivers, so we can push services through the awkward cases early. And we use feature flags to ship early and switch functionality on at a set date, rather than betting everything on one big release moment.

And someone has to own the decision to release. I've owned release go/no-go decisions from my consultancy years through to a global card network and a global insurer. Being accountable for that call is part of the job, and it keeps the safeguards honest.

Why it matters more with AI

More than twenty years on, more and more code is written with AI, SQL included. An AI assistant can make exactly the mistake I made, quickly and confidently, and at a scale I never could.

At a global card network, I defined the human-in-the-loop review process for AI-generated code: every AI-generated change was reviewed by a person. AI helped us move faster; people stayed accountable for what shipped. Automated tests catch a great deal, but edge cases can never be fully defined in advance. A person thinks differently, and asks the question the tests never imagined.

When customers rely on data being right, the checks have to be part of how the team works, whoever or whatever wrote the code. Speed and stability aren't opposites when the guardrails are built in, not bolted on at the end.

THEN (EARLY 2000s)NOWMy hand-written queryA coding mistake: missed 10 and 11TestingThe edge case slipped throughPeer reviewSlipped through againInto productionBilling revenue lostAI-assisted codeFast, confident, can miss edgesAutomated testsBoundary values includedReconciliationOutputs checked against inputsA person approvesHuman in the loop; owned go/no-go
Then, one query slipped past testing and peer review. Now, AI-assisted code meets layered checks: boundary tests, reconciliation, and an accountable person who approves the release.

The principle I lead by

Make it safe to own mistakes, and build systems so no single person's slip reaches a customer.

I learned both halves of that sentence from two digits, early in my career. I'm grateful for the lesson, even if a customer paid for it.

Contact

Let's talk.

I'm based in London, UK. If you're hiring a Head of Engineering or Head of Solution Architecture for a regulated data, payments or AI platform, I'd be glad to talk.

srini.vankee@gmail.com
↑