Ideal party composition in 5e.

I want to pose a difficult question to you guys. We are all accustomed to the classic fantasy trope of a team that includes "warrior, rogue, wizard (and bard)". The warrior being strong but dumb, the wizard being a nerd, and the bard being charismatic and the face of the party.

But 5e is so popular that it basically overtook the fantasy rpg genre and so, what is the actually best party composition? Considering that we're talking about the average adventure where there are dungeons and combats, but also towns and dialogues and trading. Oh and we assume 4 characters in a party.

I would guess the perfect party needs a frontine melee "warrior" (fighter/barbarian) to take the hits, and others can be more utility based. However, the intuitive answer from 5e mechanics seems to be "4 spellcasters". What do you think? Not just what's the most optimized but also the most fun to play as.