The #1 Rule of Thumb I've read and used is: try to be as close to last as possible. The point being, you want to be fresh in their minds. Going early is not the way to do that.
Some places are interviewing for a single open role, conduct all interviews and then make a decision from that candidate pool. Being towards the end might be an advantage in that case.
Other places open up several new roles, and conduct rolling interviews until all are filled. In this case I would rather get in early and compete for one of N positions instead of competing for the final one. With several similar roles open they could also decide which fits you the best and make the offer based on that. When there is only one junior position still open, that might be the only option.
Well, yeah. It works for A role. It wouldn't make sense to wait too long if there was a bunch. That said, at some point there's a decision to be made. The older their memory of you at that point, the more forgettable you are.
Other places open up several new roles, and conduct rolling interviews until all are filled. In this case I would rather get in early and compete for one of N positions instead of competing for the final one. With several similar roles open they could also decide which fits you the best and make the offer based on that. When there is only one junior position still open, that might be the only option.