Bloomberg LP Interview Question
Financial Software DevelopersSo a bit of basic math.
4 bytes counts 4294967296 structures.
1 sq mi = 27878400 sq ft.
My apartment is about 1200 ft sq. If all the buildings in NY had a footprint on average that was half the size of my apartment (pretty small for lots of buildings in NY. The area that could be counted by the counter would be
4294967296 * 600 ft sq = 2.5769803776 e+12 ft sq
which is
92436 mi sq
or an area 304 mi by 304 miles. If the average building footprint is larger than my apartment, then the size of the area grows.
Yup... I think the counter is big enough at 4 bytes.
4 bytes are 32bits, which can represents 2^32 = 4 billion numbers. Maybe it is enough to represent the builds, I guess :)
- Anonymous January 22, 2010