Hacker News new | past | comments | ask | show | jobs | submit login
Instagram Engineer Challenge solved with Javascript (feval.info)
184 points by triptych on Nov 15, 2011 | hide | past | favorite | 27 comments



This challenge is the first real life program I wrote with Haskell.

https://github.com/Mgccl/mgccl-haskell/blob/master/random/un... (so it seems I don't like to specify the type of my functions...)

Explanation is here: http://chaoxuprime.com/2011/11/a-solution-to-Instagram-engin...


Very nice.

Care for some unsolicited hlint-like suggestions?

Why not simply this:

    img <- readImage "file.png" 
    -- instead of this?
    t <- readImage "file.png"
    let img = t
Why not this:

    map (y!!) x  
    foldr ((:).(y!!)) [] x -- instead of this?
Note that a way of reading fold g [] is that replaces the list constructor (:) (aka cons) with g. So (:) as argument of fold is probably not idiomatic, since foldr (:) [] is the same as id.


Thanks. hlint-like suggestions are always welcome.

I have no idea what was in my mind when I wrote

  foldr ((:).(y!!)) [] x


Heh, I did the same thing. It took me much too long to figure out that I needed to call ilInit...


Mine from the weekend here: http://ronilan.com/instagram-unshredder/


I preferred yours. You at least gave some comments about the solution.


I wish I read the comments here first.


awesome! great job


Note that image 3 and 5 are slightly NSFW.


The source code is also NSFW: "_analizeColumn"


That's probably a mispelling of _analyseColumn.


5 depends on where you work :)


I (kind of) solved it with CoffeeScript but thought it wasn't a good idea to publish… if you do it's not a challenge anymore, is it?

https://github.com/ricardobeat/instagram-challenge


Very neat. Makes me kind of embarrassed that I never got around to actually solving this challenge. I've had the web page open on my laptop since it first showed up on HN.


Me too, and no response. I really wanted that T-Shirt... http://www.solesavoria.com/instagram/v2/


You might also be interested in DARPA's similar challenge: http://www.shredderchallenge.com/


Or for a similar, easier task, problem 3 "life" from this year's FARIO: http://orac.amt.edu.au/fario/11/problems_en.pdf

Here's case 8 to give you an idea: http://i.imgur.com/1fFzO.png :P

Test data here: http://dl.dropbox.com/u/76985/life-all-linux.zip



So is this challenge over? I submitted an entry using Canvas as well but allowed users to drop image in from their desktop (only works in Chrome/Firefox though). Haven't heard from anyone at Instagram.


funny, that's exactly how mine works. Haven't heard anything either


I solved it in ocaml, I only had this development environment this week end but it was fun. I didn't posted it on my blog but if someone wants it, just ask ;)



Great job! Excellent coding style btw.


so can someone actually explain how this works?


While I didn't look at how he did it, if I were to write something to do this, I would first locate each slice of the image. This could be accomplished using a rudimentary edge detection algorithm ( ie starting from the left, compare each column of pixels with the next, any large differences of course means an edge ). After that I might assign a weighted value to each edge of a slice, and then sort based upon those values.


Nice work!


Really impressive work, great job.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: