Misc.Jul 16, 2019
Marvellmartiality

Longest increasing subsequence

People at FANG, if an interviewee comes up with O(n^2) solution for the problem quickly, but couldn't come up with O(nlogn) at all, will it he hire or no-hire for you? I came up with O(n^2) solution quickly for the direct problem and the indirect russian envelopes problems in leetcode.. but, could not come up with that clever O(nlogn) solution at all.. i had to look at the solution. Am I competent enough for interview purpose atleast? Or, would you expect me come up with O(nlogn)?

Poll
67 Participants
Select only one answer
Add a comment
Apple hashset Jul 16, 2019

I like to evaluate ones problem solving technique. Not how good at memorizing leedcode. If you have never seen the question before yet be able to solve it even just brutal force. That will be a positive datapoint for me.

Marvell martiality OP Jul 16, 2019

Thanks.. 🤗

Apple economyded Jul 16, 2019

So while I’m admittedly new (only 3 total YOE) this would be neutral to slightly negative. In my opinion anyone who makes it to that stage should be able to solve the brute force solution.

Marvell martiality OP Jul 16, 2019

O(n^2) is not brute force for this problem.. O(2^n) is brute Force

Google 🔟xEngineer Jul 17, 2019

O(n^2) is pretty close to brute force. Start at first point, keep going until you are no longer increasing. Start at second point, keep going until you are no longer increasing. Do this for third, fourth, fifth, etc. Return the longest one.

Salesforce cornholioo Jul 16, 2019

Did you mean FANG or FAANG?

Oracle TLead Jul 16, 2019

A definite “No Hire” for Albertsons. They need O(logn)

Marvell martiality OP Jul 16, 2019

I thought they need O(1)

Oracle TLead Jul 16, 2019

O(1) if you are applying for senior position. Wait you have experience? Then it’s a definite No for Albertsons. You should be sad for yourself for failing Albertsons

Pinger create💻 Jul 16, 2019

The interviewer doesn't choose hire / no hire at least at G. The hiring committee would see feedback from all interviews to decide.

Marvell martiality OP Jul 16, 2019

Ok.. would the HC person say hire or no hire for this solution?

Google hooli.xyz Jul 16, 2019

Not exactly true. We can make H/NH recommendations but its up to HC to agree with our recommendations or not.

Microsoft SwitchJobs Jul 16, 2019

From the question, it looks like it was asked to you at Amazon. Its a no hire if it was the single coding question in that round. While preparing for FNG, it is quite expected to know this stuff. Unfortunately.

Marvell martiality OP Jul 16, 2019

Unless one has seen that solution before, do you think one can come up with that solution during interview on the fly?

Google Gigamisu Jul 16, 2019

Nope, but the expectation is that you have seen most of the common classes of problems

Google hooli.xyz Jul 16, 2019

This depends on how the conversation with interviewer go. I’ve passed candidates who can only code brute force but was able to drive the conversation to the optimal solution with in-depth analysis throughout and crystal-clear communication.