What about it is disrespectful? It seems to me that it’s testing for something relevant and I don’t see it as otherwise bad (abusive, pure trivia, easily Google-able, etc)
It is akin to giving a spelling quiz to an author. There is a level of decorum required when dealing with professionals. A junior verbally pointing out a syntax mistake reveals a naiveté about the competency itself and "the mission" of the field.
In this interview, I would have liked to receive two code examples (that might contain errors) and discuss benefits according various objectives.
If the interviewer makes it clear that pointing out syntax mistake is not rude, I could mention them in passing. This demonstrates not only attention to details but also decorum.
I once halted an interview because of this kind of thing. Told them their interview process suggested they were looking for someone substantially less experienced. When they then insisted everyone had to go through this, I told them that was a warning sign to me that their hiring process was a box ticking exercise rather than addressing the actual needs of the positions they were hiring for and that I was no longer interested.
Recruiters need to understand that these kinds of processes will often filter out the wrong people, such as those skilled enough to be able to pick and choose.
A lot of interviewers have complete leverage, so they don't get any sort of feedback or real check on their ability or processes. It's only when a candidate isn't desperate for the position, is competent, recognizes red flags, and gives them the feedback that they'd ever be aware of. You don't have to be upset to realize there's a mismatch and withdraw your candidacy.
Candidates often have to call out nonsense otherwise it may never be called out. Processes need feedback to adjust and adapt, otherwise they'll typically continue with momentum alone.
With that said you can give feedback in a polite and professional way, you don't have to be arrogant about it. "Based on the questions, it appears you're searching for these specific abilities which are often attributed to a junior role, so I believe I may be a mismatch for this specific role. I'm going to politely withdraw my continued involvement in this process. I appreciate your time and interest and hope you will contact me if a more senior role is available." Or something to that effect. You don't have to be arrogant to give feedback.
If you were like "what, this is ridiculous, what am I am an intern? Good luck filling this trash position!" And then walk out then sure, that person clearly had some anger management issues.
I once interviewed for a director role and the first round went something likes this:
Interviewer: How would you reverse a string?
Me: boggle Any language I want to use?
Interviewer: Yes.
Me: Okay, Ruby. "somestring".reverse!
Interviewer: boggle
Me: I don't think we're aligned on what this role is. says thank you and leaves
Interviewers need to understand what they are interviewing for.
I mean, it all comes down to how that situation is handled.
If OP was a dick about it, then yeah, it serves to filter out an arrogant assbag.
But if OP simply explained that the interview led them to believe the position was a more junior/entry level than they were expecting, that seems fine. Further, to even explain that the interview process seems to just be a checkbox process seems fine; if you work in a critical thinking/creative role, checkbox culture is an absolute brain drain.
Getting that out in the open, in honest and respectful terms, is a fine thing to do. Why wouldn't it be?
Further, any hiring institution that feels the need to build in 'tricks' to filter people out of the interview process is toxic. Even if the people they're filtering are arrogant assbags.
If a prospective employer has a hiring process that is wasteful and pointlessly bureaucratic and tests people for things entirely irrelevant to a role, that tells me they're likely to be an awful place to work and/or don't understand what they're hiring for (which is likely to make them an awful place to work too).
If you I consider that arrogance, then so be it. I consider it not taking jobs that'd make me miserable, because I don't need to.
A prospective employer doesn't have a right to have me bend over for whatever process they'd like.
TBH, aeons ago, we had this as a high-pass filter (doesn't notice a glaring SQL injection hole, no problem with eval() on user input? Nope.) and a conversation starter (-why are you constructing a database handle right in the middle of business logic? -indeed; how would you do this?)
It very much depends on the code - but I was genuinely surprised how many applicants, claiming to be fluent and applying for a senior developer position, had problems just grokking what the code did (a while loop reading from database).
Definitely not - if an author has written a book in German (even if it's not their native language) then giving them a German test is definitely insulting, the same applies for a newscaster in Italian if they have done reporting in Italian previously.
What you say applies if you're hiring people for their first position at that task (e.g. the author writing their first book in German or a newscaster who has never done reporting in Italian professionally). If you're hiring people at some hypothetical "level 10" then your interview needs to discriminate between "level 9 or less" people and "level 10 or more" people, but asking them to assert that they meet "level 1" implies that they might not, and that implication is literally insulting.
In the interview case, you often have someone who claims they wrote a book in German (but you can’t see the book) or to be a professional Italian newscaster (but you can’t see any of their reporting).
Switching part of the interview to be in Italian or German would not be seen as disrespectful, right?
It’s interesting that some find the coding equivalent insulting rather than merely a bar pointlessly laid on the ground to be stepped over.
The difference IMHO is in the expectations of what's required from the applicant. Switching part of the interview to be in Italian or German would not be seen as disrespectful as it does not add much (if anything) to the length of the interview, but asking them to fill a 30-minute quiz on basic Italian/German grammar would be disrespectful.
A bar pointlessly laid on the ground to be stepped over is reasonable iff it's you can just quickly to step over it - but if they ask the candidate to waste half an hour to prove their capacity for stepping over bars laying on the ground, that is disrespectful of their time.
For programming, a trivial short task (e.g. fizzbuzz) is appropriate but a trivial long task is appropriate only for junior positions but disrespectful for senior ones - ask something that tests whether they're capable of something serious, because passing the trivial task can't be sufficient anyway.
I think the issue is what happens if an author ghostwrote a book in German? I guess that's the book version of copying code off Stack Overflow and claiming it's yours? People trying to game the system make it crappier for everyone else.
Then do it in a different way. Phrase it as a toy pull request that the reviewer has to review, and let that contain everything from minor syntax errors to logic errors to missing core stuff (like missing test cases).