It seems that in 5e the "sweet spot" is level 5-10. Now is it *exactly* 5-10? (4-9? 5-9? etc etc)
classic: 3-8, 3.0 2-10, 3.5 'E6', 5e ...
but let's not worry about the exact value.
Oh, OK.
The thing that is remarkable about this is that the "sweet spot" for 2e and 3e were *also* level 5-10 (roughly speaking). I don't think that everyone would agree but there seems to be a general consensus.
There was definitively a 'sweet spot' for every edition (with the possible exception of 4e, which was either fine at all levels or intolerable at all levels or troublesome starting in Paragon or Epic, depending on who was evaluating it).
The class/level structure, attempts at imposing balance, incentives to play, rewards for system master, etc...
The basic class/level structure and advancement in classic D&D started with characters very fragile, but the 'tougher' ones hard to hit, making it randomly deadly, and was imbalanced in favor of MC'd non/demi-humans and fighter-types. Through the sweetspot, that imbalance more or less resolved and parties had a good chance of surviving most adventures, but still found them challenging. As you exited the sweet spot, the pendulum swung the other way, humans and casters achieved primacy and few challenges (other than fiendish 'gotchyas') stood up to their capabilities and magic-item collections.
3e tried to improve things, but really only playtested level 1-10 (on the theory that's what people actually played). High levels remained quite problematic, and the very lowest levels unpredictably deadly. The fighter-caster imbalances remained, but was accelerated, with casters both catching up and pulling ahead sooner (how much sooner depended on system mastery).
4e changed the class/level advancement structure dramatically, putting all classes on equal footing, so there was no class-balance-pendulum over levels, and 'da math' (after some kludges), worked out over all 30 levels, making encounter balance fairly stable, as well. Play increased in complexity over 30 levels, though, so depending on how you coped with that, it had an upper limit to it's 'sweet spot.'
5e is back to very fragile low level characters, quickly getting very durable to the point that it can be hard to establish 'threat' at higher levels, though it gives casters so much flexibility (including cantrips) that they're not particularly 'behind' the tougher melee-type classes at first. As always, exactly where the sweet spot is varies with preference, but the designers, themselves, set the exp charts for the most rapid advancement over the first 3 or 5 levels, decidedly slow advancement for a while after that, speeding up again towards the end. That at least strongly implies that the slower-advancement levels are meant to linger in the 'sweet spot.' All, presumably, in service to 'classic feel.'