Looking back at my own career, as well as noticing patterns in employees I've mentored over the years, I've noticed a common scenario play out during the "awkward teenage years" of most, if not all, software engineers' careers.
There's usually a "sink or swim" project where an engineer either rises above and learns how to navigate the waters of project management and technical leadership, or they sink and end up in an awkward position where they're not able to easily grow and develop their skills. What's more, this is a necessary step in the career of any engineer who wants to grow into a technical leader.
Here's a more concrete picture of what I'm talking about:
At the start of an engineer's career, they're usually given well-scoped, clearly-defined tasks that, while technically challenging and rewarding, are sized such that they can be completed in a reasonable amount of time and there are few, if any, unknowns. Tasks in this category might look like:
Add one, or more, CRUD endpoints to an existing API
Modify a logging library to log some extra bits of information
Improve the performance of a troublesome SQL query
An engineer at this level begins to think: "Software engineering isn't so bad! I'm getting the hang of this!". And while that might be partially true, they don't realize they're still swimming in the shallow end.
After a few years of building up confidence and technical chops, a good manager will eventually decide that the engineer is ready for the next step. In my experience, the best next step isn't gradually moving down the pool into deeper and deeper waters.
The best thing to do is to throw the engineer into the deep end.
The deep end might include:
Leading a multi-month project
Investigating a vague, unknown problem
Managing more junior engineers on the team
Inevitably, the engineer will struggle. Typically, they won't speak up and ask for help as much as they ought to. They'll try to pretend like everything is find and give vague status updates in standups like: "things are going fine!" "we're making progress!".
A good manager will give the engineer a long leash and time to figure things out on their own, but will jump in and help as soon as it looks like failure might impact the business. This is a good time to explain: here's what you did well, here's what you could have done better, and here's how we can work together to make sure this doesn't happen again.
This is the only way to learn how to grow into a senior engineer. It's just as important to learn how not to do something through experience as it is to learn how to do something the right way.