News for hackers. Stuff that matters.
Re:I cheated on my Microsoft interview (2019) by williamkuszmaul on Sunday June 05, 2022 @05:39AM (#31629399)
Using 64 bit integers, we can store the square of any 32 bit integer. Not that small...
Re:I cheated on my Microsoft interview (2019) by ciupicri on Sunday June 05, 2022 @06:26AM (#31629667)
Also it was 2004 and 64 bit machines weren't common. If I remember correctly you had only 2 GB available under Windows XP and if you wanted more, 3 GB to be more precise, you had to boot with a special parameter.
Re:I cheated on my Microsoft interview (2019) by saagarjha on Sunday June 05, 2022 @07:17AM (#31629918)
32-bit machines generally 64-bit arithmetic of some sort; for example "long long" in C is mandated by the standard to be of a width greater than or equal to 64 bits.
Re:I cheated on my Microsoft interview (2019) by ciupicri on Sunday June 05, 2022 @01:25PM (#31632996)
Yeah, 64 bit integers were available under gcc on Linux, but the memory issue remained. The array had to fit in 2 GB, unless of course the problem stated otherwise, for example the numbers were read from a file.