I am seeing so many companies ask LeetCode questions for software engineering jobs. (even for just developing website's front end).

Those questions can be very specific and not something that a typical software engineer would do even in 15 or 20 years. For example, it could be, given 10000 x 10000 slots and dividers of varying height between them, now find out a 20 x 20 region that can trap the most rain water when it rains for a long time.

And there can be 1500 different questions in the LeetCode database.

And the catch is, many programmers can write some code that can find the answer, but the problem usually has some tricks in its problem's property that, somehow you may be able to do it faster.

And researches were done for these types of problems, sometimes for months or for years, as a master or Ph.D. thesis.

But the thing is, programmers, especially programmers who develop the front end of a website, don't do it at all. Not even once in 20 years. So it is not really their real job content.

But the companies like to ask you these questions, and people who read the answers on LeetCode, they may get 5 out of 5 points for the several interview sessions and get into the company, while the person who wrote a correct solution but not the solution that took people months or years to find out before, get a 3 or 3.5 out of 5 only, and they are rejected as a candidate.

And what I found sometimes is: these engineers enter the company, and sometimes they cannot even write correct code. They know standard answers to those questions, but when seeing a real problem, they did not know how to think sometimes -- not as well as the candidates who can actually think well in the interviews.

But companies hire people using this method any way. I do not quite understand how and why it works this way?


But companies hire people using this method any way. I do not quite understand how and why it works this way?

Some companies do not have experienced engineers analysing the interview process. A failing on their part if they're hiring engineers, but common enough. So HR just searches for some metric to use.

  • Have you ever been to the interview where you can show during the discussion of the quiz that the code they have used is either incorrect or bad practice? They are avoiding this situation. Mar 27 '21 at 10:22
  • 2
    @user10186832 I am not a developer, but I have seen an engineering question used where the expected answer was wrong and explained why. And I have seen a compliance question where the expected answer had been illegal for a couple of years since a legislation modification.
    – Kilisi
    Mar 27 '21 at 11:11
  • "Some companies" - Seriously? It is more like "90% of the companies with a HR department".
    – TomTom
    Mar 27 '21 at 12:21
  • @TomTom perhaps for devs? I wouldn't know. But it's not normal for engineering and many other professional industries.
    – Kilisi
    Mar 27 '21 at 12:23
  • 1
    Sounds like it's just a cultural thing. I've had exactly 0% of the companies I've interviewed with use any of these tests. It's a big world and you probably only interviewed in a small part of it.
    – Erik
    Mar 28 '21 at 12:37

Hiring is a time consuming and costly process. Many companies offload that on to recruiters and/or online tech tests.

These style tests are very well marketed.. They claim to provide companies with an almost haste free way to vet candidates, ask the right questions, find the best talent, and that's why companies use them.

If you don't like doing them or don't see how they are relevant, then say so. Ask for a different way to prove your skills. - It doesn't always work, but sometimes it does.

Those questions can be very specific and not something that a typical software engineer would do even in 15 or 20 years.

These style questions are 100% relevant to software engineering and what a "typical" software engineer should know, but completely irrelevant to a lot of niche areas within software engineering such as web development because most of the CS knowledge is abstracted away by high level languages and libraries.

Most of these style tests are focused on software engineering as a whole, not on nice areas, so a lot of companies are giving out CS tests, not web development ones.

(Rather the web development focused ones are often poorly written with a focus on irrelevant CS questions)

Some companies are starting to realise this, but it will take time for things to change.

Essentially companies just want the most economical way to find good candidates, and these style tests promise that, even if they don't provide.

  • 1
    "These style questions are 100% relevant to software engineering" - the questions are nieche. I do software for 30 years, backend systems and db specialist. This is what the VAST majority of companies program - systems that take data from a database and play around with it in a UI or processes. And then you get hit with low level questions and asked to program a SORT? Heck, I do not sort in code - I tell the database to sort the data. Yes, I can look it up, but this is low level code that is hardly ever written in the real world, and if then in VERY specific special contexts.
    – TomTom
    Mar 27 '21 at 23:32

Because HR and recruiters quite often are totally detached from reality (as in: delusional of their worth) and do not know anything about IT. They look for SOME metric to measure how good people are without bothering the IT department with a trial workday or something like that.

And that means they need measurable tests. And then you add them and possibly some manager being so stupid (yes, that is the friendly version) that he does not realize that EVERY IT person I have ever met realizes those tests mean nothing - that they promptly use a totally inaccurate test.

This is seriously a case of mass delusion - a whole industry thinking they mean something when everyone doing programming knows they mean nothing.

It gets even better when then those incompetent hires do not get fired again because "it is so hard to get ANYONE from our HR department, we better work with what we have". That then means the Peter Principle is in full effect, the IT group becoming a molasse of incompetent people (as the competent ones will move on), all because HR does a wonderful job with totally non working tests.

  • Remember that some of those managers got there by the Dilbert Principle.
    – Skrrp
    Mar 27 '21 at 22:22

I do not quite understand how and why it works this way?

One very important thing to keep in mind is that the goal of a company's hiring process is to hire qualified people, as easily as possible. That's it.

Its goal isn't to make sure that every qualified person gets an interview. The goal isn't to find that "diamond-in-the-rough" candidate, someone with a poor employment history, or who does poorly interviewing, or who forgets things while white-board coding, or who makes mistakes on a timed coding assessment, etc., but would actually succeed at the job.

As long as the jobs are being filled by good hires, the hiring process is working. Are there "false negatives", folks being rejected by the process who are qualified, and who would have succeeded at the job? Of course there are, but from the point of view of the hiring process, that is necessary. A company doesn't have the time to interview every person who applies, so it needs some way to filter applicants so that the folks who actually do get interviewed are very likely to be qualified. If they interview 5 qualified people for a role, it doesn't matter that 5 other qualified people didn't make the cut.

Note that I'm not claiming that LeetCode type questions make the best assessment of a developer, or that a company which uses them thinks that they do either. What I'm saying is that it doesn't matter one bit if these questions have zero relevance to the job. It doesn't matter that you're never going to reverse a string, or find all the prime numbers in a list; all that matters is that the company thinks that its process is working: that it is finding qualified candidates as efficiently as possible.

So if you want to apply to a company that has decided that they are going to use these tests, you have two choices: you can either practice these problems, or you can sit down unprepared and hope you get lucky.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .