I have been learning and practicing for code interviews.
I am using this amazing book called "Cracking the Code Interview" by Gayle Laakmann McDowell.
I have my own solutions and the solutions from the book posted here.
It's all written in python.
These code might help you understand how these problems can be solved in python. I have also written my thoughts on how I tackled these problems and also how the book tackles the problems. Thanks to the author for writing this fantastic book!