I want honest opinions. Do you think the following is a good or not so good interview question. Why or why not? Defend your argument.

Define a function where the input is a list of integers. It should find and return all the unique sets of three within the list that sum to x.

For example, given the list [1, 3, 2, 5, 6, 8, 10, 13, 15] and with x = 16, the function would return [(10,5,1), (13,2,1)]

If the candidate presents the trivial solution with time complexity of o(n^3), ask if can be done in o(n^2) or better.

  • 8
    You wanna get graduates who dunno how 2 code for shit? Bc this how you get graduates who dunno how 2 code for shit.
  • 5
    Its certainly not a bad question, but it does not tell me much about the ability of the developer being interviewed.
    No really, it doesn't. And I say this from experience, meaning that i have interviewed before.

    Basically, I am interested in their thought process and ability to problem solve, and this is a good example for thatand only that...but;

    Best practices for setting up an entire new project.

    How do you approach being thrown an existing project with no documentation?

    How familiar are you with different architectural patterns.

    How good are you with reading documentation.

    Shit like that is way better for me and I would throw them some obfuscated af code. And if they can tell me what the code does good!

    Peraobality and drive matter the most to me. Because everything else can be learned with enough dedication.
  • 1
    It’s good if you want to find out if the candidate has their basics knocked down; list iteration, time complexity analysis, and conditional statements, etc. After seeing dozens of bungled basic test interview questions by candidates over the internet, I’d say it’s a good idea for filtering out the candidates that got through school by copying code online without understanding why it works. But that’s about it.
  • 0
    @monzrmango pretty sure this one is a standard question, i remember it from hackerrank. If you wanna do what you said, word it differently like ionno, "you have these notes and you wanna buy a $16 item" or something
  • 2
    Nope. Be the one to buck the algorithmic question trend.

    Algorithmic problems are googleable and tricky to remember / solve off the bat.

    I’d much rather a dev that can confidently configure an environment, get a database working, do unit testing, solve broad architectural problems, and eventually solve algorithmic problems.

    If the solution isn’t out there they can work it out, but if they can’t do the higher-level stuff then you’re screwed. I don’t want a bit flipping, list sorting, esoteric coding challenge-solving type dev.
  • 1
    I've been developing software for 15 years. That problem just makes my eyes glaze over. I can't put my finger on it. It just makes me die inside. I suppose I've been fortunate that I've never been asked anything like that in an interview.

    I suppose there are types of work where that sort of problem-solving could be relevant. I just haven't encountered it.
  • 1
    First of all, what about 8,5,3? Don’t confuse the reader with incorrect examples.

    This is a variation on the more common problem to find all pairs which sum to a given number.

    As such, I think it’s ok. Algorithmic questions are good IQ tests in disguise. A good developer must think of at least sorting the array. And I disagree with badwiring - these kind of optimization tasks happen all the time. Usually they don’t require a perfect algorithm, though.

    The problem with such questions is they favour people who learned algorithmics in a good college.

    Make sure you also test other aspects of software design - can they write readable, clean code.
  • 0
    Just wondering, a little off-topic: What kind of upper bound have you guys found for finding k-tuples?
Add Comment