News for hackers. Stuff that matters.
Re:On a Great Interview Question by lamontcg on Wednesday April 12, 2023 @10:01PM (#35549898)
> The fastest I had a candidate solve the entirety of the problem with all bells and whistles was in 20 minutes, by a freshman from the University of Waterloo, the type who did high-school competitions.

That is who you're optimizing for.

Re:On a Great Interview Question by wintogreen74 on Wednesday April 12, 2023 @10:32PM (#35550133)
And yet it takes him 8+ paragraphs to actually start explaining the problem. No thanks.
Re:On a Great Interview Question by glitchc on Wednesday April 12, 2023 @10:05PM (#35549924)
It is indeed telling that experience does not help with this question. It's a toy problem with no real consequences.
Re:On a Great Interview Question by the_af on Wednesday April 12, 2023 @10:27PM (#35550090)
The linked to article explains this is a real problem that the author needed to solve at scale.

(I still think the question is unfair, but my objection is more about the stressful interview situation where the real problem you're solving is "desperately trying to pass this or N other interviews you're currently doing").

Re:On a Great Interview Question by patmcc on Thursday April 13, 2023 @03:43AM (#35552278)
The thing I hate about this kind of question is there seems to be no expectation that a candidate will try to dig into the requirements.

What's the function going to be used for? Are we talking about strings of length 32 or strings of length 32k? Is this going to be run a billion times a day or 12?

We're not competing at some contest, we're trying to solve real problems here. I'm not going to waste a couple hours hammering out some ultra-optimized code so the logAnalyzer4000 can run its hourly batch jobs 0.004% faster. If we need it to handle strings of length N with a dictionary of size M comprised of strings from length X to Y, tell me that, and we can plan (and benchmark) based on that.

Re:On a Great Interview Question by behdad on Wednesday April 12, 2023 @10:07PM (#35549947)
As someone who actually uses algorithms and data-structures in their job, I disagree.
Re:On a Great Interview Question by the_af on Wednesday April 12, 2023 @10:24PM (#35550057)
I think both things can be true. These are valuable skills in some situations/jobs and you're selecting for students with these concepts still fresh in their minds and/or people who enjoy algorithm competitions.

And that's fine! A specialized subset of engineers. Maybe that subset is exactly what you need.

I wonder how the stress of the interview process selects out people who understand O-notation and to whom a Trie would make sense if explained to them, vs people who have these concepts fresh in their minds and/or can handle themselves in stressful interview situations.

Re:On a Great Interview Question by dclowd9901 on Wednesday April 12, 2023 @10:36PM (#35550168)
The author, everyone.
Re:On a Great Interview Question by nitwit005 on Thursday April 13, 2023 @01:23AM (#35551318)
You did emphasize it was the best result, so it's hard to argue that you selected for it.

Back in 2015 Peter Norvig discussed an analysis at Google that suggested doing well at coding contests was a negative indicator of job performance: https://youtu.be/DdmyUZCl75s

Presumably they do well at these sorts of questions, but that doesn't imply the same actual effectiveness.

Re:On a Great Interview Question by tgma on Thursday April 13, 2023 @01:32AM (#35551378)
If you watch the Peter Norvig link you shared on YouTube he actually interprets the phenomenon quite clearly: the statistic reported is only true for the subsample of people who get hired and absolutely not true for the general candidate population.

(Personally I would add that human measures of “job performance” can also be quite subjective.)

Re:On a Great Interview Question by nitwit005 on Thursday April 13, 2023 @01:38AM (#35551425)
You're imagining I didn't listen to an extremely short clip of a talk that I linked to?

Yes, implicitly Google can only measure the job performance of people they actually hire.

Re:On a Great Interview Question by tgma on Thursday April 13, 2023 @01:41AM (#35551455)
I did not mean to imply you in particular did not watch it. The way this observation often gets quoted is extremely misleading (often intentionally so, as the first piece without the second is much more sensationalistic) and needs an explicit clarification, as Norvig did immediately after reporting the curious observation.
Re:On a Great Interview Question by roflyear on Thursday April 13, 2023 @12:12PM (#35557728)
I am sure this person has NO IDEA how well the candidates do after they are hired.
Re:On a Great Interview Question by Freedom2 on Thursday April 13, 2023 @02:21AM (#35551759)
What algorithms and data-structures do you commonly use when shutting down useful services?
Re:On a Great Interview Question by tgma on Saturday April 15, 2023 @01:11AM (#35577773)
LRU Cache
Re:On a Great Interview Question by bolanyo on Thursday April 13, 2023 @05:46AM (#35553137)
Perhaps there is a sort of selection bias going on, where the people who work at Google have been chosen because they are good at leetcode type problems and think they are important, and so they tend to solve problems by implementing their own tries and similar data structures, rather than by using robust canned implementations.
Re:On a Great Interview Question by tgma on Thursday April 13, 2023 @01:50PM (#35559312)
> rather than by using robust canned implementations

And who is supposed to implement the robust canned implementation?

Re:On a Great Interview Question by bolanyo on Thursday April 13, 2023 @04:09PM (#35561417)
Probably not a UWaterloo recent grad who is good at programming competitions and has just been hired onto a random product team at Google.
Re:On a Great Interview Question by tgma on Thursday April 13, 2023 @04:57PM (#35561964)
I’d posit that a UWaterloo grad who landed a job at Google is close to maximally likely to end up working on something like that [acknowledging that in absolute terms relatively few college grads do so.]
Re:On a Great Interview Question by bluepizza on Thursday April 13, 2023 @11:58AM (#35557455)
Would you care to extend your reply, and tell us how you use them? Just like you expect a good candidate to do ;)
Re:On a Great Interview Question by tgma on Wednesday April 12, 2023 @11:24PM (#35550522)
Pretty much every good programmer I know, senior or not, will have no problem solving this unless they have a particularly bad day or brain fart; at worst, they may take slightly more time remembering/reinventing aspects of a trie to work out the optimal solution.

What folks need to remember is the employers who are primarily known for asking this generally have no problem hiring people who are good programmers and ALSO good at e.g. Dynamic Programming. And no, as much as some try to frame it, the two skills are not directly at odds with each other. Therefore, between a good programmer who can “Leetcode” and one who cannot, why wouldn’t they pick ones that are good at both?

And sure, if your company don’t have that luxury, don’t cargo cult. Hire a good enough domain expert for your specific needs.

Re:On a Great Interview Question by pkd on Thursday April 13, 2023 @12:14AM (#35550868)
While being good at Leetcode is not necessarily negatively correlated with being a good software engineer, is is also not positively correlated. Thus, by relying on it solely, you are still making a coin-toss decision about the software engineering skills of the candidate.
Re:On a Great Interview Question by tgma on Thursday April 13, 2023 @12:52AM (#35551098)
> it is also not positively correlated

Do you seriously think that claim is true? That coin toss predicts software engineering ability as well as leetcode? I don’t think any reasonable person can take this seriously.

Re:On a Great Interview Question by janalsncm on Thursday April 13, 2023 @03:22AM (#35552160)
Berkson's paradox suggests that even if they seem negatively correlated that may only be due to the selection process. For example, suppose that an interview has 2 components, a leetcode section and an engineering section. Both are scored out of 10, and a total score of 15 is needed to pass.

Among those who pass, the two components might seem negatively correlated. This is because you can score a 10 on one section and pass with only a 5 on the other. However, among the general population both sections might even be positively correlated.

Re:On a Great Interview Question by tetromino_ on Thursday April 13, 2023 @01:20AM (#35551286)
> It's a toy problem with no real consequences.

It's an extremely simplified but recognizable version of a real problem: natural language input tokenization, which of course has real consequences.

Re:On a Great Interview Question by rimliu on Thursday April 13, 2023 @04:21AM (#35552511)
Then this problem is solved by a gazillion of libraries already, no?
Re:On a Great Interview Question by reedf1 on Thursday April 13, 2023 @04:50AM (#35552719)
Ah yes, I whack out four or five natural language input tokenizers before lunch most days.
Re:On a Great Interview Question by bluepizza on Thursday April 13, 2023 @09:35AM (#35555228)
This problem was solved by medieval monks by introducing white spaces.
Re:On a Great Interview Question by tetromino_ on Thursday April 13, 2023 @09:48AM (#35555420)
Many languages still don't put whitespace between some or all words (Chinese, Japanese). Many languages tend to use long compound words which are better represented as sequences of tokens rather than one token (German, Russian). Many inputs are dirty (coming from OCR, for example) so whitespace can be unreliable. And even in clean English text, inflected words may be better tokenized as sequences of tokens rather than a single token.
Re:On a Great Interview Question by glitchc on Thursday April 13, 2023 @02:38PM (#35560057)
The problem there is that natural language processing is a highly specialized field, not something one can expect a generic SRE to know unless it's explicitly mentioned in the posting. I'm willing to bet the posting said nothing about NLP.

I could ask a detailed question on cryptography, robotics or reverse-engineering, and it would be just as (ir)relevant to the SRE. Computer science is a much broader field than your niche area. Arbitrary goal-posts are arbitrary.

Re:On a Great Interview Question by pclmulqdq on Wednesday April 12, 2023 @10:07PM (#35549946)
Welcome to the Google interview.
Re:On a Great Interview Question by qwerty3344 on Wednesday April 12, 2023 @10:04PM (#35549917)
Yep this is what most data structures and algo questions optimize for.
Re:On a Great Interview Question by koonsolo on Thursday April 13, 2023 @08:58AM (#35554709)
I'm willing to bet people who do high-school competitions, are good at programming.

I only know 1 guy who did coding competitions. He was in fact a good developer.

Why would you think a person that enjoys such a thing wouldn't be?

Re:On a Great Interview Question by boshalfoshal on Friday April 14, 2023 @07:07AM (#35568062)
Yea people on here get so worked up about coding interviews lol, if you were a successful competitive programmer I am going to be very likely to hire you, just like how I'd be very likely to hire a Google SWE with 10 yoe.

Its just another signal of aptitude, its not some magical catch all heuristic. However, people here suddenly expect like they are allowed to forget all the (very fundamental) basics and get into a job that involves coding without any coding at all. Now that leads to a bad hire.