there was this question, which I don't remember now. the question had example inputs and outputs. the examples had a few sorted arrays as inputs. but the question didn't say that the answer should only accept sorted array.
when the array is sorted, the solution is easier. but even it is not sorted, sorting the array first won't result in extra big O time. And sorting is trivial, so I commented in the code that I only implemented a solution where I expect a sorted array as the input. The question isn't clear regarding if the input is sorted or not. In case, the input is not sorted, sorting is trivial. I could use whatever to sort it ....
I was proud of my answers, not on this question, but questions before this one. As some questions asked for bit manipulation. and I used inline assembly for a very speedy implementation.
After I submitted my answers, the CTO of that startup ran my code against their unit tests, and minutes later I received rejection.
I asked them, why? he gave me a case where the input is not sorted. clearly he didn't even look at my code.
Using ambiguous questions to reject people doesn't make sense to me. Plus, the online coding platform isn't interactive at all. there was no chance for me to clarify the question.
I guess they made this question unclear on purpose, but I don't know what they are testing? interview skills I guess?
Or maybe they wanted to test if I'm a rigorous person. of that I didn't fail, as I had pointed out the input requirement was unclear.
They didn't even't look at the code, not too many lines, which I feel disrespectful.
I said I have never had a conflict of great hostility with my supervisor, I'm easy going.
but he insisted I need to find a real-life example of me resolving hostile conflict with a supervisor. I was NCG, I hadn't had too many supervisors.
I had no choice but made up a story for that one. I guess that position requires story telling skills.
Since they lied to me I became skeptical right off the bat so I called them up and asked why they wanted to drug test me?
I got the "It's normal procedure", and then was told "it'd be unfair to the company if someone came in high and didn't perform and they still had to pay them". I agreed with that last part, but had to ask "Who gets to see the results of my test" and was assured that only management and the owner would see it.
So then I asked "Does management and the owner take the test and can I see the results of theirs when they do?" and was told "No. They are not required to take the test, only hourly employees."
So then I told them I was fine with taking the test but before I'd work for them I wanted to see the results of the owner and manager's tests because they might not be able to evaluate my performance when it was time for me to get a raise in pay after they'd been binging all weekend on coke and hookers and I've been screwed before by "owners" and "management" who did that.
I obviously didn't get or take the job. I've still never taken a job that required a drug test. I wouldn't even apply for one that required it. Not because I do drugs, but because I'd never work for anyone who'd ask me to pee in a cup because to do that is just too cowardly and I cannot stoop that low without being ashamed of myself forever. In practice it's hardly different than demanding I lick their boots, and in fact it's even worse.