not as good as many senior software engineers
It’s all about abstracting things away. I have a very good memory for where things are (at least I did when I had to make everything manually...) and it mainly comes down to:
making sure the project has a logical, consistent and above all well know structure
making sure the code is well split up into logical and consistent functions etc.
not surprising anyone with where things live
The last point is a rephrasing of the previous, and it’s also why a lot of more experienced devs are very nitpicky about where things should live and what they should look like. It massively reduces what you have to remember at any given point in time.
It’s fine—you get used to having to throw away the last hour’s work, but since you were scrolling twitter at the time it’s not that much of a loss...
If you roll the dice enough times you get your answer. Or at least close enough for you to not have to have written what it came up with. And every now and then it gets things perfectly right on the first try!