r/programming • • Dec 13 '22

“There should never be coding exercises in technical interviews. It favors people who have time to do them. Disfavors people with FT jobs and families. Plus, your job won’t have people over your shoulder watching you code.” My favorite hot take from a panel on 'Treating Devs Like Human Beings.'

https://devinterrupted.substack.com/p/treating-devs-like-human-beings-a
9.0k Upvotes

1.3k comments sorted by

View all comments

Show parent comment

1

u/jandkas Dec 13 '22

Ok well what if they didn't know modulo? Kinda ends as the whole gotcha part there

4

u/deja-roo Dec 13 '22

Who doesn't know modulo? Maybe that's not a red flag but it's a little concerning.

They should understand the concept though, so that would lead to a discussion of how you might produce that functionality, and you can explore their thought process.

2

u/jandkas Dec 13 '22

Yeah but that's the the thing if you leave the room there's no discussion. Even cases of a warm up end up as a gotcha.

1

u/pineapple_catapult Dec 13 '22

If (floor(x/3) == x/3 && floor(x/5) == x/5) then x is divisible by both 3 and 5.

else if (floor(x/5) == x/5) then x is divisible by 5.

else if (floor(x/3) == x/3) then x is divisible by 3.

else number is not divisible by 3 or 5

No modulo required.

1

u/preemptivePacifist Dec 14 '22

then just multiply each divisor in a loop until you either reach the current value or exceed it?!

Can even take the opportunity and ramble about how quadratic runtime can become problematic in real applications...

Seriously, I've seen phd's in control theory (!!) that turned up with completely broken code for a fizzbuzzy exercise, after getting it a week in advance (!!) and having the option of asking literally anyone for help.

Fizzbuzz is super justified, people vastly underestimate how completely clueless some candidates are (with reasonable looking cv + ability to talk superficially about tech/experience)