Sample questions
Question 1Easy
For vectors normalised to unit length, the dot product equals:
- The sum of their elements
- Their Euclidean distance
- Zero always
- Their cosine similarity
Answer: D. Their cosine similarity
Explanation
cos = a.b / (|a||b|) and the norms are 1.
Step-by-step solution
- cos(a, b) = a.b / (|a| |b|).
- For unit vectors |a| = |b| = 1.
- So cos(a, b) = a.b.
Why the other options are wrong
- A. Summing elements is not a dot product of two vectors.
- B. Distance decreases as the dot product increases; they are not equal.
- C. The dot product is zero only for perpendicular vectors.
Question 2Easy
A sentence embedding model maps each sentence to:
- A single integer ID
- A fixed-length vector
- An image
- A variable-length list of words
Answer: B. A fixed-length vector
Explanation
Fixed-size vectors make similarity search and clustering of sentences possible.
Step-by-step solution
- A sentence embedding model reads a sentence of any length.
- It outputs one vector of fixed size (e.g. 384 or 768 numbers).
- Fixed size lets any two sentences be compared directly.
Why the other options are wrong
- A. An ID carries no meaning for similarity.
- C. Text models output vectors, not images.
- D. A list of words is the input, not the embedding.
Question 3Easy
- A dense vector
- A label for a class
- A compressed ZIP file
- A database index on text
Answer: A. A dense vector
Explanation
Embeddings capture meaning so similar items are close in vector space.
Step-by-step solution
- An embedding maps an item (word, image, user) to numbers.
- It is a dense vector, usually of a few hundred dimensions.
- Similar items get similar vectors.
Why the other options are wrong
- B. A label is a category, not a vector.
- C. ZIP files are byte compression.
- D. A database index is a lookup structure.
Question 4Easy
Which is the best use of embeddings in a recommendation system?
- Finding similar items
- Encrypting user IDs
- Sorting items alphabetically
- Compressing images losslessly
Answer: A. Finding similar items
Explanation
Users and items embedded in the same space can be matched by similarity.
Step-by-step solution
- Embed items so that similar items have nearby vectors.
- Find nearest neighbours of an item the user liked.
- Recommend those similar items.
Why the other options are wrong
- B. Encryption is unrelated to embeddings.
- C. Alphabetical sorting needs no learning.
- D. Embeddings are lossy summaries, not lossless compression.
Question 5Medium
In classic word embeddings, vector("king") - vector("man") + vector("woman") is closest to:
- vector("queen")
- vector("kingdom")
- vector("woman") only by chance
- vector("man")
Answer: A. vector("queen")
Explanation
Embedding arithmetic can capture relationships such as gender as consistent directions.
Step-by-step solution
- king - man removes a 'male' direction, roughly leaving 'royalty'.
- Adding woman adds a 'female' direction.
- The nearest word to the result is typically queen.
Why the other options are wrong
- B. Kingdom is related to king but not a gendered counterpart.
- C. The result is reliably near queen, not woman by chance.
- D. The man direction was subtracted.
Question 6Medium
What is the cosine similarity between (1, 1) and (1, 0), to three decimals?
- 0.500
- 1.000
- 0.866
- 0.707
Answer: D. 0.707
Explanation
1 / (sqrt(2) x 1) = 0.707.
Step-by-step solution
- Dot =
1 x 1 + 1 x 0 = 1.
- Lengths: sqrt(2) and 1.
- cos =
1 / sqrt(2) = 0.707.
Why the other options are wrong
- A. 0.5 is cos 60 degrees.
- B. 1.000 would need the same direction.
- C. 0.866 is cos 30 degrees.
Question 7Medium
Reducing high-dimensional embeddings to 2-D for plotting is often done with:
- Gradient clipping
- One-hot encoding
- t-SNE, UMAP or PCA
- Max pooling
Answer: C. t-SNE, UMAP or PCA
Explanation
These techniques help visualise clusters, though distances in the plot are approximate.
Step-by-step solution
- Embeddings have hundreds of dimensions; plots need 2.
- PCA keeps the directions of greatest variance.
- t-SNE and UMAP preserve local neighbourhoods, showing clusters well.
Why the other options are wrong
- A. Gradient clipping is a training safeguard.
- B. One-hot encoding increases dimensions.
- D. Max pooling shrinks image feature maps.
Question 8Medium
Approximate nearest-neighbour (ANN) indexes such as HNSW are used because:
- They work only with images
- Exact search is slow
- They always return exact results
- They need no memory
Answer: B. Exact search is slow
Explanation
ANN trades a little recall for large speed-ups in vector search.
Step-by-step solution
- Exact nearest-neighbour search compares the query with every vector.
- With millions of vectors, that is too slow.
- ANN indexes like HNSW find almost the best matches far faster.
Why the other options are wrong
- A. ANN indexes work for any vectors, text included.
- C. Approximate means results may occasionally miss the true nearest neighbour.
- D. ANN indexes use extra memory for their structure.
Question 9Hard
Normalising (2, 3, 6) to unit length gives:
- (0.2, 0.3, 0.6)
- (2/7, 3/7, 6/7)
- (1, 1, 1)
- (2/11, 3/11, 6/11)
Answer: B. (2/7, 3/7, 6/7)
Explanation
Divide each component by the norm 7.
Step-by-step solution
- Length =
sqrt(4 + 9 + 36) = 7.
- Divide each entry by 7.
- (2/7, 3/7, 6/7).
Why the other options are wrong
- A. Dividing by 10 does not give length 1.
- C. (1, 1, 1) changes the direction.
- D. Dividing by 11 uses the L1 norm.
Question 10Hard
Embeddings for search are compared with cosine similarity. A document vector is accidentally scaled by 10. How does its cosine score change?
- It becomes 10 times larger
- It becomes 0
- It becomes negative
- It does not change
Answer: D. It does not change
Explanation
Cosine depends only on direction, not magnitude; a raw dot product would change.
Step-by-step solution
- cos = a.b / (|a| |b|).
- Scaling b by 10 multiplies a.b by 10 and |b| by 10.
- The factors cancel, so cosine is unchanged.
Why the other options are wrong
- A. The dot product grows tenfold, but cosine does not.
- B. Only a zero vector would break the score.
- C. A positive scale cannot flip direction.
Practise all 20 questions free
The full question bank with timed practice, progress tracking and Vidya, your AI tutor. Free, no ads.
Open this topic in the app →