Junior interview question
What do TF and IDF measure?
Model answer
Term frequency: how often a term appears in a document. Inverse document frequency: how rare it is across the collection, the total count divided by the documents containing it, usually logged.
TF-IDF sums IDF × TF over the query's terms, so rare query words count most.
Practise the rest
6 Retrieval algorithms questions, 492 in all, each with a model answer. Free.
More Retrieval algorithms interview questions
- What does BM25 add to TF-IDF?
- Why is term-based search fast, and what does it never return?
- How does embedding retrieval work, and what's its catch?
- Exact k-NN is too slow at your scale. What do you give up with an ANN index, and how do you choose one?
- Term-based or embedding retrieval for a support search full of error codes and paraphrased questions?