News for hackers. Stuff that matters.
Re:Data Structures for Coding Interviews by ahjones on Tuesday August 01, 2017 @04:12AM (#14898694)
I think you're being a little bit unfair. The same block then continues:

  This is called an integer overflow. At best, we might just get an error. At worst, our computer might compute the correct answer but then just throw out the 9th bit, giving us zero (0000 0000) instead of 257 (1 0000 0000)! (Python actually notices that the result won't fit and automatically allocates more bits to store the larger number.)
The article is introducing the concept of integer overflow.
Re:Data Structures for Coding Interviews by ldite on Tuesday August 01, 2017 @04:23AM (#14898742)
1111 1111 = 255

1 0000 0000 = 256

Anyone who claims to understand integer overflow from actual experience, rather than memorizing textbooks, should know that by inspection.

I'd forgive that in a CS grad (possibly) but if someone claimed to have been working in C or other unsafe languages for more than a trivial amount of time I'd be very suspicious.

Re:Data Structures for Coding Interviews by fulafel on Tuesday August 01, 2017 @05:14AM (#14898933)
That's only assuming 0-based numbers :)
Re:Data Structures for Coding Interviews by philh on Tuesday August 01, 2017 @06:28AM (#14899270)
(I know you're being tongue-in-cheek, but)

> our computer might compute the correct answer but then just throw out the 9th bit, giving us zero (0000 0000) instead of 257 (1 0000 0000)!

Re:Data Structures for Coding Interviews by elldoubleyew on Tuesday August 01, 2017 @09:01AM (#14900174)
Well he did say he didn't read any further.