All companies should have a test like this
In the age of "cracking the coding interview", glassdoor, levels.fyi, etc... it would only work a handful of times before everyone is in on the test and true assholes won't expose themselves.
It's fairly obvious if you're on the receiving end what the purpose of the test is when you're being observed (as with most interview questions, it helps to ask yourself why the interviewer asking me / having me do this?)