View Single Post
Old 04-20-2022, 10:33 PM   #874
spike021
Senior Member
 
spike021's Avatar
 
Join Date: Jul 2013
Drives: '17 Limited BRZ CWP w/ PP
Location: San Jose, CA
Posts: 5,846
Thanks: 14,220
Thanked 6,568 Times in 3,255 Posts
Mentioned: 72 Post(s)
Tagged: 0 Thread(s)
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.
__________________
Instagram: @spike.grc
Quote:
Originally Posted by humfrz View Post
It sounds to me like the delicate, metallic sounds of piston skirts slapping against the cylinder walls
Quote:
Originally Posted by Tcoat View Post
Now, if it was three feet long and you were using all that leverage
spike021 is offline   Reply With Quote
The Following 3 Users Say Thank You to spike021 For This Useful Post:
Dadhawk (04-21-2022), humfrz (04-21-2022), p1l0t (04-21-2022)