04-20-2022, 10:42 PM
|
#875
|
|
Senior Member
Join Date: Jan 2018
Drives: Crapcan
Location: Oregon
Posts: 11,593
Thanks: 18,878
Thanked 16,875 Times in 7,680 Posts
Mentioned: 112 Post(s)
Tagged: 0 Thread(s)
|
Quote:
Originally Posted by spike021
For all you programmers out there, today I failed an interview for panicking and totally forgetting to question the value-types of the data I was working with.
i.e.
array: [["1230", "testing", ""], ["200", "testing3", ""], ["1230", "testing1", ""], ["2000", "testing", ""]]
Basically the first value is a timestamp in 2400 format. I had to sort first by the 2nd value (some word), and then sort by the first.
So I did a Python library sort with a lambda.
But I messed up one thing, I kept getting the list back in a different than expected order.
With that bug, I screwed up the rest of the interview.
The bug was... I was sorting the first values (the timestamps) as strings, not type-casting to integers.
|
There are far too many words in this post I don't understand
You fail an interview for that? I figure if you could explain what you did wrong reasonably and in a timely manner that would be almost as good as a straight pass.
__________________
"Experience is the hardest kind of teacher. It gives you the test first and the lesson afterward." -Oscar Wilde.
|
|
|