It's not just that real working engineers would go look it up. It's that the culture around these "prove you can code" problems got into an arms race, where companies kept trying to come up with ever more difficult problems and stringent requirements on solutions. It finally reached the point where, at some companies which use them, the bar for "can you code at all" is actually "given a problem you've never seen before, can you match or beat the absolute best solution the world's best CS researchers have ever come up with, in twenty minutes, on this whiteboard". If you aren't able to, they label you a bozo who can't even write a for loop, and pronounce you unqualified to do any type of programming, and pat themselves on the back for having kept "fake coders" out of their company.
(and if you wonder how anyone ever gets hired there, the answer is: by cheating. If you're going to interview at one of those places, odds are their interview problem and an accepted solution will be online somewhere, so you just go look up and memorize)