Interview questions solved in python