Google Interview Question

The tech question isn't really hard. I answered the basic solution and then was expected more efficient solution and finally the problem has to be solved in a scalable scope. I bet these should be completed in 20 minutes at most but that took me 40 min. Of course I didn't get further interview.