Embeddings

Embeddings turn text into numbers that capture meaning, making it possible to find similar ideas even when the exact words don't match — and they power the semantic search, AI tutor, and lesson pipeline at the heart of EngineerPrep.

The Search That Keeps Failing

Picture this: you're on the EngineerPrep team and the product manager opens a bug report. Learners are searching for interview questions and coming up empty — even when dozens of relevant questions exist in the database. One learner searched for 'sorting algorithms' and found nothing, even though the database had questions about QuickSort, MergeSort, and 'arranging elements in order.' The words just didn't overlap. Your first instinct is to add synonyms, or maybe a fuzzy-match query. But that quickly turns into a maintenance nightmare — you can't manually list every possible way a person might phrase an idea. There has to be a smarter way. And there is. But to understand it, you first need to understand how a computer can be taught to represent meaning as numbers.

The Simple Idea

Think about a map of a city. Every location has two numbers: a latitude and a longitude. Restaurants that are physically close to each other have numbers that are close to each other. Now imagine you could make a map — not of physical places, but of words and sentences . Each piece of text gets a set of numbers that describes where it lives in 'meaning space.' Text that means similar things ends up near each other on this map. Text that means different things ends up far apart. That's all an embedding is: a list of numbers that represents the meaning of a piece of text. The list is called a vector — just a fancy word for 'a sequence of numbers.' A typical embedding from a model like Amazon Titan Text Embeddings v2 is a list of 1,024 numbers; other models produce different sizes, such as 1,536. When a learner types 'how do trees work in interviews,' an embedding model…

See It in Action

Step 1 — Plain text goes in. Imagine three short phrases sitting in a list: - 'How do I reverse a linked list?' - 'Explain linked list reversal' - 'What is photosynthesis?' At this point they're just strings. The computer has no idea that the first two are about the same thing. Step 2 — Each phrase gets converted to a vector. An embedding model reads each phrase and outputs a list of numbers. Each number reflects some aspect of the text's meaning as learned during training — the model is not explicitly programmed with rules like 'this is about data structures.' After conversion (illustrative values): - 'How do I reverse a linked list?' → 0.82, 0.91, 0.05, 0.77, ... - 'Explain linked list reversal' → 0.80, 0.89, 0.04, 0.76, ... - 'What is photosynthesis?' → 0.11, 0.03, 0.95, 0.08, ... Notice: the first two vectors look very similar. The third looks completely different. Step 3…