I'm guessing when you say "ask frontend developers" you mean "at job interviews". But I like to think you mean something like "at cocktail parties" or other social situations.
Man where were you at when I was getting asked questions "to see if you've prepared for the interview" with leet code for damned UI frontend positions... I loved answering your type of questions and most companies would not do this for some reason.
I hate leetcode type questions. It's like "math Olympia" questions I had to deal with as a kid. Either you have seen the problem (or a variation of it) or there is no way of coming up with a solution under pressure.