I have hard time imagining what position, at least if we're talking about software engineering, would require solving abstract toy problems in a timeframe of less than an hour without a chance to ever go back and improve your solution. I'd say it's "did you see this problem before" kind of question. Which means Twitter probably lost a capable and smart hire because he couldn't quickly give a perfect answer to useless puzzle (unless of course he was hired to repair the roof in Twitter's office and solving this puzzle is required for Twitter to survive the rainy season). Hardly a "perfect" way.