#314 Implementing a Document Recommendation Service

Companies:
VK
Themes:
JavaCollections & GenericsPractice

The following function evaluates how relevant a document is to a user:

interface Scorer<Document, User> {
    double getScore(Document doc, User user);
}

Implement a service that can save a document and return the top K (limit) documents for a user according to this function's score:

interface RecommenderService<Document, User> {
    List<Document> getTop(User user, int limit);
    void addDocument(Document document);
}

Question review

Mentor
Answer as you would in a real interview. I’ll ask follow-up questions, then compare your answer with the reference answer and show your accuracy as a %.
Sign in to start the dialogue The mentor keeps the context of the current question and your previous messages.
Sign in