Skip to content

mongodb-developer/da-interview

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

DA Technical Interview

This round aims to measure the your basic coding ability and logical thinking. While code is written in javascript with MongoDB queries, you are not expected to have in-depth knowledge of either. However, you are still expected to have the ability to discern the intention and logic of the code.

Part 1: Code Interpretation

Open the file: index.js.

Try to the best of your ability to explain what we are trying to achieve in this code.

If you are not familiar with MongoDB search functions, try to make some sense in the logic. Otherwise you can treat the textSearch and vectorSearch functions as a blackbox that return some documents based a query string.

The search functions returns an array sorted by their score in descending order, and looks like this:

  {
    _id: '0766012816',
    title: 'The New York Knicks ...',
    score: 7.354069232940674
  },
  {
    _id: '0060175028',
    title: 'Second Coming: The ...',
    score: 7.24722146987915
  },
  //...

Pay particular attention to the hybridSearch function: How does the logic work and what do you think is missing to make it complete as a hybrid search?

Part 2: Coding and Logical Thinking

Improve the current hybrid search by using the Reciprocal Rank Fusion algorithm:

  • The score that is being returned by individual search functions is now irrelevant
  • The score of each document should be recalculated and is equal to 1 / (60 + RANK)
  • If the same document appears on both types of search, the score should be the summation of both
  • re-rank the results accordingly and return the results

If you are unfamiliar with javascript, it is okay to code with pseudo-code and explain to the interviewer your thought process.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published