News for hackers. Stuff that matters.
Re:Ask HN: What is your go to idiot-filter question in inter... by wruza on Wednesday December 07, 2022 @04:11PM (#33900306)
I ask to live-design a quadratic equation solving function (the basic method is provided for those who forgot it) and to discuss decisions done. It tests for edge/degenerate case awareness, numeric issues, experience with multiple results specific to a language, and for choosing a prototype that fits the bigger task.

I don’t care if it’s buggy, how much time it takes or whether the first scratch is any good, because it shows fundamental things every decent programmer knows or knows how to discuss and reason about imo. Unlike fizzbuzz, if you pre-solve this question at home and remember these details, you’re already good enough for the next question.

Re:Ask HN: What is your go to idiot-filter question in inter... by nailer on Wednesday December 07, 2022 @05:09PM (#33901033)
> I ask to live-design a quadratic equation solving function

I’ve been programming for a decade, was a Linux/cloud engineer a decade before that, I’ve had code on the front page of google, launched products for Microsoft, and had my code shown on stage at nodeconf and aws re:invent. I am currently top 0.07% on stack overflow. I can answer the other questions in this discussion easily. I would absolutely fail this.

Re:Ask HN: What is your go to idiot-filter question in inter... by nitwit005 on Wednesday December 07, 2022 @05:37PM (#33901362)
Solving quadratic equations is just plugging numbers into the two versions of the quadratic formula.

I can understand forgetting the quadratic formula, but the idea is taught to every school student who takes algebra.

Re:Ask HN: What is your go to idiot-filter question in inter... by igorkraw on Wednesday December 07, 2022 @05:36PM (#33901335)
Serious question: why? If I understand OP correctly, it's a 1 line math equation which is provided if necessary and you just need to turn into some useable interface?
Re:Ask HN: What is your go to idiot-filter question in inter... by wruza on Thursday December 08, 2022 @02:29AM (#33905233)
I don’t understand. The simple formula is provided, all they’re expected to do is to

- figure out what parameters should look like

- detect edge cases (e.g. division by zero when a==0 or sqrt of negative value)

- and discuss its usage (how to return 0, 1, 2 roots and how you signal it to the caller so it’s convenient)

And this is not a silent-wait quiz. When they seem confused I ask directly what it would return if `a` is zero. Or tell that a, b and c are parameters to such equation.

Anyway, maybe it’s sort of a TIL moment and I should stick more to fizzbuzz with periods changed or to string reversal.

But I feel confused about it as hell.

Re:Ask HN: What is your go to idiot-filter question in inter... by nailer on Thursday December 08, 2022 @05:30AM (#33906392)
I dive into math occasionally when working on animation and (real) crypto, and then forget about it when I go back to whatever I'm working on.

Actually looking up the formula for the first time in 20 years it's readable (i.e. doesn't use symbols I don't already know) so yes I'd be able to solve it. That's not guaranteed with every formula though.

Re:Ask HN: What is your go to idiot-filter question in inter... by matthewwolfe on Wednesday December 07, 2022 @05:36PM (#33901347)
Agreed, you can be absolutely horrible at math and be a fantastic programmer. I always found math easy in school but 5+ years later if someone asked me to write a quadratic function solving function I’d have no idea what that even means. Presumably with a guide I could write the code, but that’s so far removed from the type of work I do day to day
Re:Ask HN: What is your go to idiot-filter question in inter... by tzarko on Wednesday December 07, 2022 @05:22PM (#33901192)
Thank you. A lot of the questions in this thread have me seriously doubting myself.
Re:Ask HN: What is your go to idiot-filter question in inter... by adamrezich on Wednesday December 07, 2022 @05:19PM (#33901154)
even with the quadratic equation provided?!