04-21-2022, 02:13 PM
|
#888
|
|
Senior Member
Join Date: Jan 2016
Drives: 2016 Subaru BRZ Hyperblue
Location: West Hartford, CT
Posts: 8,478
Thanks: 22,741
Thanked 9,438 Times in 4,847 Posts
Mentioned: 58 Post(s)
Tagged: 1 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.
|
So they failed you for some quotes. Like that type of thing doesn't happen and get fixed 7x a day...
Sent from my SM-G975U using Tapatalk
|
|
|