70
mangodb
5y

(Interview for sde-3 position)
(continuation of https://devrant.com/rants/2132431/... )

Interviewer - *opens laptop. Gives a question.* solve this.

Me - *a bit surprised that such questions were being asked on a sde-3 level*
this is the 4th or 5th question from geeksforgeeks, isn't it? I know the answer to this. Do u still want me to solve it?

Interviewer - *not believing me* Yes

Me - okay. Well this *writing down the original solution mentioned on the site* is the verbatim code mentioned on the website, with complexity O(n^2).
However I feel this is not the optimal solution. Let me write a better solution.
*I provide a better solution*
This has a complexity of O(n log n) . What do you think?

Interviewer - Nope. This could be a lot better.

Me - okay. Let me see. Did some minor changes, added some caching (obviously this will have no effect on the base algorithm) etc
How about now?

Interviewer - nope. Still not good.

Me - okay. Can you tell me how to improve it?

Interviewer - no we are not allowed to solve problems for you. It is not our interview, it is yours.

Me - that makes no sense. Interviews are a two way street. I'd very much like to know the optimal answer to this.

Interviewer - okay
*copies down the answer from geeksforgeeks*
This is good

Me - *at first I thought this was a prank or something. *
I just mentioned this answer here.
Then I spent the next 10 minutes providing a BETTER solution.
May I know how yours is better?

Interviewer - this solution has 2-3 loops. Yours has a function calling itself.

Me - that's called divide and conquer using recursion mf!
Anyways let's take an example and do a dry run.

Interviewer - okay

*we do dry run*

Interviewer - oh yes. Yours ran faster. But it will run fast only sometimes.

Me - yes. Each time the algorithm rolls a dice to decide if it should run fast or slow. You have one goddamn awesome weed dealer man.
I got to go. Thank you for meeting me.

Comments
  • 16
    You carried on with this after the last experience?! Please tell me it was just for the laughs...!

    But if it was for the laughs, well played. They are indeed rather entertaining.
  • 9
    @AlmondSauce I was going through the above rounds because I was curious about how bad developers can be, and also because it was a lazy Sunday, I didn't have much to do.

    This was a startup which had recently attained unicorn status.
  • 4
    @syentix Yes you're right. Not applicable in this case. He wasn't willing to specify the limits of the input data set.
    In his words, "make your assumptions, it should work for huge inputs and small inputs". So I went with divide and conquer.
  • 0
    WOW...!!
  • 1
    @mangodb Fake it till you break it
  • 0
    What???
  • 0
    Probably the same type of hr person who doesn't even properly look at your CV, git(lab/hub/...) repos, website etc.
  • 1
    @-ANGRY-CLIENT- This was a developer not HR
  • 0
    @mangodb my bad. I should have told that I mean hiring dude/tte by saying hr. I use that interchangeably. Can't help it lol
  • 1
    @-ANGRY-CLIENT- My bad too. Such people don't deserve to be called developers. More like scum of the earth.
  • 0
    @mangodb indeed ๐Ÿ˜๐Ÿ˜
  • 0
    (Wo)man, if idiots like him can get a job, you definitely can. Be cheerful that you kicked that job or you would have to deal with developers hired by the same numb nut.
  • 1
    @kayb01000010 Of course. I wasn't worried about getting a job, I just couldn't believe that these morons were the top 10 employers in my country
  • 0
    @mangodb WHAT. Where was your interview ๐Ÿคจ?
Add Comment