How to mentor a junior developer effectively.

•

•

Teach Them to Find It, Not Just Fix It

I spent most of my early career thinking that mentoring meant sitting someone down for a structured lecture on design patterns or reviewing their clean code against a checklist of industry standards. It’s a lie. Most of the “best practices” you find in HR-approved handbooks won’t help when you’re trying to figure out how to mentor a junior developer who has just accidentally dropped a production table because they didn’t understand how a connection pool works. Real mentorship isn’t about teaching them how to write a perfect loop; it’s about teaching them how to stay calm when the pager goes off and the logs start screaming.

I’m not going to give you a syllabus or a list of theoretical frameworks to implement. Instead, I want to share the stuff I wish someone had told me back when I was the one breaking things—the practical, slightly messy lessons learned from fifteen years of production incidents. I’ll focus on the high-leverage habits that actually build competence, like how to review a PR without being a jerk and why documenting your mistakes is more important than being right. This is about building engineers who can eventually handle the chaos on their own.

Table of Contents

Onboarding Junior Engineers Without Breaking the System

Onboarding Junior Engineers Without Breaking the System

The biggest mistake I see when onboarding junior engineers is treating them like a separate, isolated entity that exists outside the actual production lifecycle. You can give them all the training docs in the world, but if their first task is a “sandbox project” that never touches real traffic, you aren’t actually teaching them. Real growth happens when they see how their code interacts with the messy, unpredictable reality of our services. I prefer to give them small, low-risk tasks—maybe a bug fix in a non-critical utility or adding a telemetry metric—that require them to navigate the actual deployment pipeline. It’s about building developer confidence through small, controlled wins rather than throwing them into a deep end of architectural complexity.

However, you can’t just let them loose. This is where effective code review techniques become your primary tool for teaching. I don’t use PRs to nitpick indentation or variable naming; I use them to explain the why behind our constraints. If I ask them to change a pattern, I don’t just say “do this instead.” I explain the specific production incident from three years ago that made this particular pattern a requirement. You aren’t just checking syntax; you are transferring the institutional memory that isn’t written down anywhere else.

Building Developer Confidence Through Controlled Failures

Building Developer Confidence Through Controlled Failures

The biggest mistake I see leads to a culture of fear: treating a junior developer like a fragile glass ornament. If you shield them from every potential mistake, you aren’t actually helping them; you’re just delaying the inevitable moment they realize they don’t know how to handle a real error. Instead, I prefer to create “safe-to-fail” environments. This might mean assigning them a task in a staging environment that mirrors production complexity, or letting them own a non-critical service where a crash won’t cost the company thousands of dollars per minute. Building developer confidence isn’t about telling them they’re doing a great job; it’s about showing them that when they inevitably break something, the system is resilient enough to survive it.

This is where your technical leadership skills actually get tested. It’s easy to fix a bug yourself in five minutes; it’s much harder to sit there while a junior struggles for forty-five minutes, resisting the urge to take the keyboard away. You have to guide them through the diagnostic process—asking “what does the log say?” rather than “type this command”—so they learn the why behind the fix. When they do stumble, don’t treat it as a performance issue. Treat it as a data point for the next post-mortem.

The Practical Stuff: Five Ways to Actually Help Them Grow

  • Stop being a human compiler. When they ask a question, don’t just give them the syntax or the fix. Ask them what they’ve already tried and where they got stuck. If they can’t explain the problem, they haven’t understood it yet. It’s slower in the short term, but it’s the only way they’ll stop coming to you for every semicolon.
  • Teach them the art of the “Paper Trail.” I’ve spent too many hours re-solving problems I thought I’d mastered years ago. Show them that a good PR description or a well-documented post-mortem is just as important as the logic itself. If they solve something tricky, tell them to write it down so their future self doesn’t have to suffer.
  • Normalize the “I don’t know.” The most dangerous junior is the one who is too afraid to admit they are lost. Share your own stories of when you tripped over a basic configuration or broke a deployment pipeline. If they see that expertise isn’t about knowing everything, but about knowing how to find the answer, they’ll stop panicking when they hit a wall.
  • Give them ownership of something small but real. Don’t just bury them in “shadow tasks” or documentation that no one reads. Give them a low-stakes service or a specific internal tool to maintain. They need to feel the weight of a piece of the system—even a small one—to understand how their code actually lives in the wild.
  • Review the “Why,” not just the “What.” When you’re doing code reviews, don’t just nitpick their variable names. Explain the architectural trade-off. Instead of saying “don’t do this,” say “we do it this way because if we did it your way, the database would choke when we hit ten thousand concurrent users.” Context is the difference between a coder and an engineer.

The Lessons I Wish I’d Written Down Sooner

Stop treating documentation as a chore and start treating it as a survival guide; if a junior engineer can’t find the “why” behind a weird configuration, you haven’t finished mentoring them yet.

Guard the production environment, but don’t build a wall around it; give them enough rope to learn how to tie knots, provided you’re standing close enough to catch them before they hit the floor.

Value the “why” over the “how”; a junior who understands the trade-offs of a slow database query is worth ten who can just copy-paste a Stack Overflow fix without knowing why the site just crawled to a halt.

The Long Game

Mentoring developers for The Long Game.

At the end of the day, mentoring isn’t about checking off a list of training modules or ensuring they can navigate our specific CI/CD pipeline. It’s about the architecture of their mindset. We’ve talked about onboarding them without causing a site-wide outage and, more importantly, giving them the psychological safety to break things in a controlled environment. If you focus too much on their ability to write perfect syntax, you’ll end up with a developer who is terrified of the terminal. Instead, focus on teaching them how to trace a bug through a distributed system and how to write documentation that actually survives a year of turnover. The goal is to move them from “I think this works” to “I know why this failed.”

I’ve spent fifteen years fixing things that were broken, and I can tell you that the best engineers I’ve ever worked with weren’t the ones who never made mistakes; they were the ones who documented their scars. When you mentor someone, you aren’t just transferring technical knowledge—you are passing down a survival manual for a career that is inherently messy and unpredictable. Don’t aim to build a junior who is a perfect mirror of yourself. Aim to build a colleague who is capable of eventually sitting in your chair, looking at a production incident, and knowing exactly where to start looking.

Frequently Asked Questions

How do I balance giving them enough freedom to explore without accidentally letting them push a breaking change to the payment gateway?

You don’t balance it with trust; you balance it with guardrails. I don’t care how much I trust a junior—I don’t even fully trust myself on a Friday afternoon. The solution is a rigorous CI/CD pipeline and strict CODEOWNERS files. Let them refactor the entire service, but make sure the payment module requires two senior approvals and a green light from the integration test suite before a single byte hits production.

What do I do when a junior developer is clearly stuck but is too afraid to admit they don't understand the codebase?

Stop asking “Do you have any questions?” They’ll say no every single time, even while drowning. Instead, try “Walk me through how you’d implement this specific change.” When they stumble, don’t jump in to save them. Use it as a bridge to show them where the documentation is lacking or where the abstraction gets too muddy. Make it safe to be lost by admitting how long it took you to learn the same thing.

How much of my own time should I actually spend on code reviews before I start feeling like I'm doing their job for them?

If you’re rewriting their logic to make it “cleaner” according to your personal preference, you’ve already crossed the line. I used to do this constantly until I realized I wasn’t teaching; I was just being a bottleneck. Aim for the “why,” not the “how.” If the code works and doesn’t introduce a regression, let the stylistic nitpicks go. If you spend more than 30 minutes on one PR, stop. You’re not coding for them; you’re reviewing their thinking.

At what point do I stop providing the answers and start letting them struggle through the documentation on their own?

The rule of thumb is this: if they’re asking “how” to do something, give them a hint. If they’re asking “what” something is, send them to the docs. I usually wait until I see them staring at a screen with that specific, blank expression—the one that precedes a frantic Slack message. Let them sit in that discomfort for fifteen minutes. If they haven’t found the answer by then, they’re just spinning wheels, and that’s when you step in.

Tomasz Wierzbicki

About Tomasz Wierzbicki

I am not interested in arguing about frameworks. I am interested in why the thing broke at two in the morning and what would have prevented it. Most of what I know came from being wrong in production and writing it down afterwards.