Personally if this was asked during an interview that didn’t allow looking up references, it would be a signal that the company is not a good place to work. It indicates the company places value on memorizing lots of programming trivia instead of valuing thoughtful research and exploring various solutions. Candidates may feel they are signing up for a brainiac contest.