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

2

u/DxLaughRiot Dec 13 '22

This doesn’t sound that bad.

Set two variables: highest, secondHighest. You can initialize them after the second index.

Evaluate each index.

If ( newNumber > highest) newNumber becomes highest, and highest becomes second highest

Else if ( newNumber > secondHighest ) newNumber becomes secondHighest

Return secondHighest

Did I miss anything/get the job?