Microsoft Interview Question

Write how tfidf works and try to implement it using python?