Interview Coding Challenge

If you don't care about performance why do you care about minimizing the number of array lookups?

No ifs I specifically stated what it was optimized for.

Jow Forums in a post

>You should see the take home problems
please no. I'm fucking sick of small startups that made me shit out a functional web app or implementing a server for a custom protocol over udp or something bullshit like this

pastebin.com/pEASCWZ5

Attached: programming.jpg (400x421, 13K)

Since you're Canadian, if you consider moving, apply to Amazon (they're Toronto and Vancouver), they're doing some massive hiring right now and pay much more than pretty much any other company in Canada.

apart from performance, is there some other reason one would want to minimize the number of array lookups?

I've done 10~ hour projects for people back when I was naive. Or desperate. I didn't mind for a while, but when the amount of people that didn't even call me back to let me know I wasn't considered anymore, nor did they send me a thank you for applying message began to mount I had to stop. It was draining a significant amount of my time and I wasn't about to wait for it to suss out a 1/100th hire rate when I could work just fine under a 1/300th hire rate with the no-effort-required applications. A 10 hour project should get you right into the interview or pre-hire stage instantly.

Looks pretty good. You want a $7/h job?

rekt

Hey OP, I work at Google, this is a tougher problem than we'd usually give in our entry level interviews. The trick is to realize that you can never have a cycle between your pixels, and to use that fact to reduce the number of checks you need to make. Look into the BFS algorithm! The big-O runtime is the same, and it's still possible to achieve good cache behavior, especially when the entire image can fit in your cache.

Also, not sure if it's mentioned, but the example is wrong, around the bottom left corner.

I think you can avoid checking everything around the circles, since it’s a given that the neighbors will point at them, it’s the darkest pixel