If Donald Knuth interviewed with Google, he would fail too because he would need 24 hours to solve a hard level leetcode question[1]. Unfortunately, Google loves throwing those kind of questions at interviewees and expect them to come up with solutions within 1 hour interview, lol.
[1] - http://keithschwarz.com/interesting/code/?dir=find-duplicate
It's just a trick though; I don't think skill in coming up with these is particularly well-correlated with being a good programmer, and for that reason Google claims not to do teasers like this any more.
All google does is teasers like this.
Today everyone is reading CTCI book and prepping. So if you aren't at that level, you will be behind. It's just like that guy who refuses to use steroids while trying to be competitive in MLB/NFL.
Remember Google infamously rejecting Max Howell, the original Homebrew author? I know there has to be more to the story, but he's become the poster child for talented programmers getting rejected because they can't play the interview game. My point is, though, that his side project absolutely had a huge impact and it still wasn't enough.
90% of my interviews have been a take-home project followed by a chat going through my history and experience; in fact, my small side projects and hackathon projects tend to impress interviewers more than my on-the-spot abilities or my work history. Interestingly, I worked for a Fortune 500 bank and, while it was the least-challenging job I've had, the interview process was by far the hardest and had a few questions straight out of CCTI.
Research a few companies. Their Glassdoor pages usually indicate what kind of interview process they have. Then prepare accordingly.