The worst company I ever worked at (now out of business, fortunately) had an interviewer / hiring manager who asked these sorts of riddles.
He also had a really thick accent. Later, he also proved to be technically incompetent.
I quit after 6 months.