4 ms·
As a counterpoint, your real-world equivalent example is kind of bad. A normal person who had never changed a tire and got a flat would, as step #1, Google or
by mdorazio 7y ago
As a counterpoint, your real-world equivalent example is kind of bad. A normal person who had never changed a tire and got a flat would, as step #1, Google or YouTube "how to change a tire" and follow the steps. Or perhaps look in the owner's manual. Randomly rummaging around in your trunk and trying to puzzle out how to use a bottle jack and get the lug nuts off/on correctly is a poor way to go about it. Similarly, in real-world programming if you get to a requirement to do something you've never seen before, the first step most programmers I've worked with would take is looking up potential solutions that already exist.
The problem, of course, is that if you're in the middle of an interview and someone throws a programming problem at you, your first instinct to go look up potential solutions would generally lose you the job opportunity. A better test of real-world skill needed would be to give them some variant of fizzbuzz code then ask them what it does, or put a bug in it and ask them to find the bug and fix it based on the expected output of the function.