News for hackers. Stuff that matters.
Re:Ask HN: What topics/subjects are worth learning for a new... by pfarnsworth on Sunday September 16, 2018 @05:54PM (#18001378)
> I’m looking for them to find the right abstraction—one that will make it easy to extend the problem and for junior devs to look at the solution function and understand exactly what it’s doing. Almost no one passes.

If no one passes, it means you are instead asking them to recreate what YOU would do, and basically asking them to be a mind reader. A good interviewer would know that there is more than 1 solution to everything, and that there are equal, but completely different solutions to the same problem. Someone could abstract the problem completely different from yours, but still be correct.

Re:Ask HN: What topics/subjects are worth learning for a new... by baron816 on Sunday September 16, 2018 @05:58PM (#18001398)
I tell them exactly what I’m looking for and am very clear up front. Many of them don’t follow orders, they put everything into one big function and don’t try to abstract at all.
Re:Ask HN: What topics/subjects are worth learning for a new... by codingdave on Sunday September 16, 2018 @06:09PM (#18001471)
So you are expecting them to start with the abstraction, before coming up with a solution?
Re:Ask HN: What topics/subjects are worth learning for a new... by enedil on Sunday September 16, 2018 @06:58PM (#18001741)
Oh, come on, the solution is trivial.
Re:Ask HN: What topics/subjects are worth learning for a new... by emmanuel_1234 on Sunday September 16, 2018 @10:37PM (#18002756)
So trivial that I can't really see what's there to abstract. It's literally a one liner in Python.

[x for x in my_list if x % 2 == 0] + [x for x in my_list if x % 2 != 0]

Re:Ask HN: What topics/subjects are worth learning for a new... by codingdave on Monday September 17, 2018 @08:00AM (#18005019)
That doesn't re-build it into a linked list as his example showed. It also does multiple passes through the data, which should be fun if there are millions of items.

It is a great question for talking about performance tuning an algorithm, but just seems bizarre to be pushing for abstraction on this problem.

Re:Ask HN: What topics/subjects are worth learning for a new... by ldd on Monday September 17, 2018 @09:07AM (#18005535)
Maybe something like

lambda f: [x for x in my_list if f(x)] + [x for x in my_list if not f(x)]