I'm sure you're doing it in a sensible way, but... the thought that played out in my head went a little like this {apologies, I'm not well today, this might be a fever dream}:
Interviewer: "Welcome to your hammer-stuff interview, hope you're ready to show your hammering skills, we see from your resumé you've been hammering for a while now."
Schmuck: "Yeah, I just love to make my bosses rich by hammering things!"
Interviewer: "Great, let's get right into the hammer use ... here's a screw, show me how you'd hammer that."
Schmuck: (Thinks - "Well, of course, I wouldn't normally hammer those; but I know interviewers like to see weird things hammered! Here goes...")
[Hammering commences]
Interviewer: "Well thanks for flying in, but you've failed the interview. We were very impressed that you demonstrated some of the best hammering we've ever seen. But, of course, wanted to see you use a screwdriver here in your hammering interview at We Hammer All The Things."
Sounds like it’s intended to be used to schedule jobs, or complex builds.
[deleted]
Your loss, not theirs. Lots of good developers are not expert at unix commands, many of which spend most of their time on Windows. They may be "wasting" 2 minutes on this specific task with their "inefficient" method, but they may perform much better on other tasks, to the point that 2 minutes saved here is nothing.
Not to mention that these days people often ask ChatGPT "what's the best way to do this" before proceeding, and whatever you ask in interviews is completely irrelevant.
It is exactly for these reasons we never ask such questions in our interviews. There are much more important aspects of a candidate to evaluate.
The 2 minutes wasted to write it doesn't move the needle, but the time that their present and future teammates will waste on reading it might.
It costs me more effort to read and understand a screenful of unfamiliar code than the equivalent "sort -k 1.1" or "uniq" while skimming through a shell script. This adds up.
Assuming teammates are all experts at linux commands. Fact: not everyone knows what "sort | uniq -c" does or can type it out on demand. Actually I'll be surprised if more than 25% of all software engineers can do that
. If you don't believe me, ask random people inside and outside your company.
> It costs me more effort to read and understand ...
You don't need to. LLMs are meant for that. You probably will roll your own script anyway and none of this matters.
You are worrying about things that, in my experience, do not make any noticeable impact on overall productivity.
This depends on the context... If a file is pretty small, I would avoid sort pipes when there is a Python codebase. It's only useful when the files are pretty big (1-5GB+)
They are tricky and not very portable. Sorting depends on locales and the GNU tools implementation.
you can develop just as fast or even faster with python once you develop a good enough utility library for it.
For example my python interpreter imports my custom List and Path classes and I could just do the following to get the same result:
List(List(Path("filepath").read_text_file().splitlines()).group_by_key(lambda x:x).items()).map(lambda x:(len(x[1]),x[0])).sorted()
and if used often enough, it could made an utility method:
Path("filepath").read_sorted_by_most_common()
So I find it shortsighted to reject someone based on that without giving them a chance to explain their reasoning.
I think generally people really underestimate how much more productive you can be with a good utility library.
> once you develop a good enough utility library for it.
What happens when everybody comes to the job with their own utility library and start working on the same codebase?
Would you like it if you had to get up to speed with several utility libraries your coworkers developed for themselves?
A common set of tools, like the Unix commands, makes it easier for people to collaborate. They were put in an official standard for a reason.
> For example my python interpreter imports my custom List and Path classes and I could just do the following to get the same result:
List(List(Path("filepath").read_text_file().splitlines()).group_by_key(lambda x:x).items()).map(lambda x:(len(x[1]),x[0])).sorted()
... But I don't know why you would, because with builtins and the standard library you can already do
sorted((count, line) for (line, count) in Counter(Path("filepath").read_text().splitlines()).items())
> and if used often enough, it could made an utility method:
Sure, but you can do that for any functionality in any practical language.
> Wasting developer time
What is the definition of wasting developer time? If a developer takes a 2 hours break to recover mental power and avoid burnout, is it considered time wasted?