I went through a similar experience with a radically different outcome. I was given a coding assignment and one week to finish it. I spent more than 30 hours on it and came up with a solution that was supposedly 500 times faster that what they'd ever seen (they told me this later). But things took a wrong turn at that point. In the followup meeting the interviewer turned out to be rude, disruptive, and combative. He tried to grill me on every little thing I said and finally rejected me. I have no idea how it happened but I suspect they simply thought my solution to the take-home assignment was too good to be mine.