Also because no one works this way. The coding challenges are contrived and don't really reflect typical work. Like I've never had to do anything like strings that occur more than k times.
And these clarifications are mostly dumb. If you pass an emoji into my string function I'm okay with it not working. Similarly if you pass in a negative number then that's your own dumb fault if it does something unexpected.
That's how the real world works. You go to the extent that covers 99.99% of cases. If that means it doesn't work in your crazy scenario, well, create a ticket and it'll sit in the backlog until we clean up old tickets.
Asking clarifying questions is a pretty key part of software development. You get a loose requirement the system must do X, you then need to drill into all the details. For this reason I think lots of these coding problems are deliberately under-specified.
One of the big things about being an experienced developer is knowing when things are important. If someone asks me to write a function that returns strings over X characters what counts as a char is going to be whatever the language counts as a char for the length function. Asking about emojis will just lead to a time-wasting discussion about something that doesn't matter.
> if you pass in a negative number then that's your own dumb fault if it does something unexpected
If a negative number isn't valid input that should be gracefully handled by the program (e.g. by responding with an appropriate error indicating what is valid and/or invalid) instead of doing something unexpected.
I'm not much of a fan of the current state of tech interviews but seeking clarity around validity of input and how to react to invalid input is one aspect that does (or at least should) mimic "real life"
And these clarifications are mostly dumb. If you pass an emoji into my string function I'm okay with it not working. Similarly if you pass in a negative number then that's your own dumb fault if it does something unexpected.
That's how the real world works. You go to the extent that covers 99.99% of cases. If that means it doesn't work in your crazy scenario, well, create a ticket and it'll sit in the backlog until we clean up old tickets.