The programming test I took to get my current job was awkward as hell because it had this sort of thing in it. It felt like it took forever and my confidence was shot when I went home from that interview. When you’re maintaining an existing code base, you rely on doing things consistently, which usually means having a wrapper function that takes care of float-string conversion and a million other little tasks. If you’re given a test outside of that context you can find yourself floundering.
Turns out I scored better on that test than anyone currently working there.
But if non-programmers had been watching me sweat bullets while working through that thing, they’d probably assume I had no idea what I was doing.