Pergunta de entrevista da empresa Microsoft

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