Q. Is this really as harmful as you think?

A. Go to your parents house, your grandparents house etc and look at their Windows PC, look at the installed software in the past year, and try to use the device. Run some antivirus scans. There’s no way this implementation doesn’t end in tears — there’s a reason there’s a trillion dollar security industry, and that most problems revolve around malware and endpoints.

you are viewing a single comment's thread
view the rest of the comments
[–] 58 points 2 years ago (9 children)

Couldn’t you use a separator to make it one line of code? That way it’d be even more dangerous

  • source
  • hideshow 9 child comments
  • [–] 11 points 2 years ago (5 children)

    I did an interview where the candidate said that if it's one line, it runs in constant time. And they were completely serious. And this was in the context of Python list comprehensions.

    They claimed this ran in constant time:

    new_list = [value for value in my_list]
    

    Whereas this ran in linear time:

    new_list = []
    for value in my_list:
        new_list.append(value)
    

    We asked clarifying questions, like what happens to the runtime if the list gets really large, and they doubled down.

    And this was for a senior Python dev position... No, they didn't get the job.

  • source
  • parent
  • hideshow 5 child comments
  • [–] 0 points 2 years ago (4 children)

    Runs in constant time doesn’t ring a bell to be honest…do you mean instantly?

  • source
  • parent
  • hideshow 4 child comments
  • [–] 0 points 2 years ago (3 children)

    No, constant time means it'll take the same amount of time whether you have 10 items or 10,000.

    A list comprehension will take roughly the same amount of time as a for loop, it's just syntactic sugar.

  • source
  • parent
  • hideshow 3 child comments
  • [–] 1 point 2 years ago (1 child)

    Thanks!

    Not sure why you needed to downvote my honest question, maybe the candidate dodged a bullet there, he he he.

  • source
  • parent
  • hideshow 1 child comment
  • I didn't downvote.

    If this was a junior candidate or something, I may have let it slide. But this was a senior candidate, which means they are supposed to be a technical leader for the team. I can't have someone in that role with such fundamental misunderstandings. There were more red flags than just that one, I also don't fail people for one gaff (e.g. I just passed a senior that bombed the coding challenge, but it was obvious they were over-thinking it).

  • source
  • parent
  • [–] 8 points 2 years ago (2 children)

    Are you... Are you saying EVERYTHING can be hacked with one line of code?

  • source
  • parent
  • hideshow 2 child comments