News for hackers. Stuff that matters.
Re:Facebook Engineering Puzzles by d3x on Monday December 27, 2010 @09:43PM (#2044411)
I took each x axis line segment x(1) -> x(6) for example and hashed it at 1,2,3,4,5,6 and did that for everyone then it would simply be a question of iterating each M point and looking at the hash table

Probably a stupid way to do it but it worked.

I think the issue was that I did not know points == queries

Re:Facebook Engineering Puzzles by btilly on Monday December 27, 2010 @10:57PM (#2044577)
Hashing is indeed the wrong way to go.
Re:Facebook Engineering Puzzles by d3x on Monday December 27, 2010 @11:05PM (#2044593)
Yea, i just wanted to solve it quick so I didn't feel like such a dumb ass. I did it again using your solution and now i see what you mean about scalability because your way is much much faster and more efficient. I had to run my solution on my db server using memcache because it was taking too long and too much memory but yours ran on my laptop.