Comment by tdeck
15 hours ago
> I'll assume they want Python or Java or C++ or Rust, not Bash or ALGOL 68.
I've solved interview questions with one line of Bash before and gotten an offer. The question was something like "count all the files in this folder with a name ending in X". The interviewer was happy I had a quick solution and they could move on to talking about something more interesting.
The obvious ways to do this sort of thing in Bash have some nasty gotchas on non-standard filenames, though.
And a Python solution that avoids those problems is also quite simple and terse for the example you gave, and probably for most problems in the category.