It has been my personal experience, and the experience of many people I’ve spoken with, that this kind of trivia is learned in order to get a job and then forgotten immediately afterwards because it’s useless.
Anecdotal example: a former colleague is an incredibly talented systems programmer and has had to study leetcode garbage for the last few months in order to feel qualified to interview for a position with a team that he had previously been on at an older employer.
As another commenter said elsewhere, these types of questions are used because they’re legal proxies for “IQ tests”, and because they filter for people who are willing to sacrifice much of their personal time for the sake of the company.