Having a solid Computer Science background is a must! So do the courses if you think your CS base is not solid enough.
Then, solve the "Cracking the Coding Interview" problems all by yourself, hesitate to look at the solutions until you really tried them out.
Here is a great resource to prepare for big companies, like Google:
https://github.com/jwasham/google-interview-university