The same can be applied to pre-interview screening problems as well. I recently send my resume to a company that was advertising on the Hacker New job board (I'm not going to say which company it was). They replied to my email telling me that in order to get to the next step in the process, I need to solve a problem and send them my code. They wanted me to send them a conway's game of life board that, after 1000 generations, could be converted to a GIF and would make up a black and white image they included in the email. Basically they wanted me to take their image, convert it to a conway game of life board, and then figure out how to calculate backwards game of life generations. Sounds to me like a fools errand. I deleted the email and never thought about it again. I have better things to do to fill up my free time. Maybe if they had me do something actually useful or meaningful...
That sounds like a fun challenge, and if it's at all representative of the sorts of problems they take on, I'd love to know who the company was so I can apply.
The fist task is converting the GIF into a data structure. That could take anywhere between one hour and one day. Since I personally have no experience reading data from GIF files, it is probably going to take me one day.
The next step is to figure out how to reverse generate conway's game of life. If you have previous game of life experience, you may already know how to do that. But I'm not a game of life expert. Its going to take quite a bit of research and trial and error to get that working. It will probably take me at least a day.
It all boils down to this: I don't want to waste two days of programming time for something as pointless as this. Especially since they could very easily say "sorry you're not a cultural fit" after spending all that time. Thats actually what happened to me a few months ago when I spent 4 days doing a programming problem for a job at reddit. They called me about a month later and had a 5 minute conversation with me, and then never heard from them agan. Assholes.
My new rule is that I don't spend any ore than a few hours on any one single problem, unless they pay me, or if it's interesting enough.
How I feel about things like this: If you're interested in doing the programming challenge, you should do it, because it's interesting to you (and so that company tries to give its employees problems that are interesting/has employees that find the same problems interesting as you do). If not, then you're right, it's a lot of time to spend on it. But learning how to go about programming that is certainly not, in my view, a waste of time, or at least no more a waste of time than doing an edifying class assignment. So, in essence, they're filtering for people that enjoy solving interesting coding challenges in their free time. If I'm a company, that is probably a reasonably good filtering mechanism, and if I'm a potential employee, I likely want to be around people who like solving these sorts of things on their own.
Also, this isn't as tough a challenge as you make it out to be: writing the game of life is, at most, a 2-hour assignment. So writing a game-of-life-reverser might tack on an extra 30 min. to hour. Then, you just hand-code in the gif into a game of life board, and run it through your reverser. Unless your gif is really large, in which case it might be a little more annoying, but probably not drastically so.
Just to clarify: It was a 800*800 image (or there abouts), and the GIF was pictoral (it was actually lena). It wasn't a typical GOF board. The question even hinted that if you can't get an exact match, then return a board that "comes close as possible". Without posting the whole problem, it definitely seemed like the kind of problem that would take at least a few days.
On the other hand, I once had a company give me a problem that was essentially to build a page that displays products from an API endpoint, and have that page infinitely scroll. That was something interesting, because infinite scroll is a useful skill. I had never implemented infinite scroll before, so in order to complete the task, I'd have to educate myself. And infinite scroll is a skill that I can use again. Conway's game of life in reverse is not a skill I'm ever going to use again, except for the next job interview busy work.
> I once had a company give me a problem that was essentially to build a page that displays products from an API endpoint, and have that page infinitely scroll.
I'd probably have the same reaction to that as you did to the reverse-GOL. Sounds dreadfully boring, if that's the sort of stuff they do every day. I don't want to re-use old techniques over and over and over; I want to continuously discover new ones.
Addendum: figuring at a specific game of life board would be tough, because multiple boards could produce a single result. However, figuring out some board shouldn't be too bad, so you should be able to generate a valid board fairly simply. And now I'm interested in trying.
It's perfectly possible this "riddle" did its job perfectly well, by determining you weren't a good fit for them, and all it did cost them was a single email.
I would have done it, because it seems fun. And solving it proves that you know how to find libraries to do external stuff (reading/writing gifs. Knowing how to use basic ImageMagick or equivalent is a useful skill), and that you can solve some algorithmic task, or at least have an interest in it (no idea how hard reversing game of life is, or if this specific problem is bruteforcable, but if they ask it, I guess there's a solution).
How big was the game board? It doesn't seem like running life backwards would be an obvious thing. If I have a 3 by 3 grid with the center turned on I think there are 8 choose 3 or 56 possible previous boards that would lead to that. I guess you're just looking for any possible previous board not a specific one but it seems like any decent sized board would lead to a seriously large problem space in a hurry.
I also dislike puzzle questions in interviews and never use them when I'm hiring people.
It seems that you can choose the initial state of the game, this implies that the number 1000 is no restriction (if it takes a million steps you take the 999000 as the initial state. You can program some greedy algorithm and since number of steps is not a problem the solution seems attainable by this method (just 3 minutes thought).