How we Built the Free Destination Quiz

Jason VertreesJason Vertrees
6 min read

To support folks thinking about relocation, I thought it would be neat to provide them with a Free Destination Quiz. The idea is very simple. You input a few preferences, then immediately – no sign up, no email capture, no payment, etc – you get your results. You can take it as many times as you want, changing the input. For a deeper, much more personalized analysis users sign up for the paid product.

Here's a sample question from the Free Destination Quiz, showing the that user indicated they prefer very rainy climates and that factor is also very important to them, but not extremely important:

Screenshot of the Newroots Free Destination Quiz

So, the problem to solve here is, given an input vector indicating user preferences, how can we find the best countries matching those preferences? The results should be deterministic and based on actual mathematical principles. So, how did we build it?

Many readers will already know what we did as I gave away the majority of the implementation in the problem statement; however, I enjoy writing these articles to help newer folks understand some of this stuff. So, let's take a look.

First, the core idea is that we can turn each country into a vector of N-dimensions, where each dimension is a "fact" about the country. Once I have that data set, I will turn the user's input into a vector in this space and find the closest matches.

Dimensions

Some of these dimensions are straightforward, objective metrics—annual rainfall, average temperature, the usual suspects. Others are a bit more nuanced. Take "Economic Performance," for example. We measure GDP per capita and assume everyone prefers a thriving economy over a dumpster fire (shocking, I know). But here’s the twist: we don’t just slap a "like/dislike" on it. Instead, you tell us how much you care—whether it’s a mild preference or a non-negotiable must. See, it's not the same.

Objective dimensions are straightforward: rainfall in millimeters, GDP in dollars, temperatures in degrees. But subjective metrics—Healthcare Quality, Immigration Friendliness—require more finesse. For the free quiz’s sake, we pre-processed these into standardized scores through semantic analysis of trusted indices. No philosophical hand-wringing, just actionable data.

The result? You tell us how much you care about, say, a country’s work-life balance (rated 1–5 by global surveys), and we calculate the matches—rigorously, but without the existential crisis.

So, we head over to our favorite LLM. We first define our country dimensions:

When then set the system prompt – telling the LLM what it's going to be asked, essentially, over and over again and how to act and answer:

And then we ask the questions:

Please and thank you.

How the Destination Quiz Works (With Math You'll Actually Like)

Every country gets distilled into a neat vector of attributes. Let's peek at Andorra's profile:

Andorra is gorgeous. You should visit it. Beware of congestion leaving the country apres ski, though.

The Matching Magic relies on the cosine similarity metric of vector math. Picture two flashlights in a dark room: if they shine in the same direction, that corresponds to +1.0 (an almost perfect alignment); if they shine in exactly opposite directions, that’s -1.0 (something akin to antimatter-level mismatch); and if they’re at right angles, that’s 0.0 (complete indifference). This approach works beautifully for our quiz because it ignores sheer magnitude—so a country’s raw GDP won’t drown out your fondness for frequent rain—and focuses on pure directionality. In other words, the only question is whether your preferences “point” the same way as a country’s attributes. Under the hood, your quiz responses become a “target” vector in an N-dimensional space. We then calculate the cosine similarity between your vector and each country’s vector. We pull the highest scores as your personalized recommendations. No black boxes, no hidden algorithms—just clean geometry that links what you care about to the places you might love.

Fun with Data

Going a step further, I was curious. If we take the raw data, standardize it, then create a correlation matrix we can use that to power a heatmap. Clustering that will show us groups of countries with similar characteristics.

Here's the heatmap.

Heatmaps are used to show similarity. Red boxes indicate two countries are more similar. Blue boxes indicate two countries are dissimilar.

Beautiful, but as you can see not very helpful. Why? The data in this graph are sorted alphabetically not by their country data. So, instead of showing the countries sorted alphabetically, let's show them by their similarity to each other:

See those reddish blocks along the diagonal? Those are clusters of countries with similar characteristics. Super cool. Let's see how countries were grouped and what each cluster tell us.

Let's look at the variance explained, first:

Clearly PCA 1 drives the majority of variance (40%) where as PCA 2 is ~ 10%.

The Seven Tribes of Nations: What Data Groupings Reveal

After standardizing our metrics and running clustering algorithms, the world partitions into seven distinct cohorts—like geopolitical personality types. Let's meet them -- characterized by their cluster centroids:

1. The Balanced Middle (38 countries)

Bahamas, Brazil, India, Thailand...

  • Economic Profile: Emerging ($7,719 GDP/capita)

  • Climate: Year-round temperate (23.5°C avg)

  • Vibe Check: Moderate quality of life with high cultural diversity

  • Signature Trait: Goldilocks rainfall (834mm/yr) – not too dry, not too wet

2. The Elite Circle (33 countries)

USA, Germany, Japan, Switzerland...

  • Economic Profile: Wealthy ($74,778 GDP/capita)

  • Climate: Brisk (10.5°C avg) – pack a sweater

  • Vibe Check: High quality of life, immigrant-friendly

  • Signature Trait: Economic powerhouses with stable politics

3. The Struggle Bus (25 countries)

Afghanistan, Haiti, Somalia, Venezuela...

  • Economic Profile: Distressed ($1,858 GDP/capita)

  • Climate: Surprisingly temperate (23.7°C avg)

  • Vibe Check: Low quality of life, restrictive immigration

  • Signature Trait: Extreme economic challenges despite decent weather

4. The Overlooked Middle (21 countries)

Algeria, Ethiopia, Pakistan, Zambia...

  • Economic Profile: Lower-middle ($5,359 GDP/capita)

  • Climate: Mild (20.7°C avg)

  • Vibe Check: Less immigration flexibility than Cluster 1

  • Signature Trait: Higher rainfall (960mm/yr) than struggling peers

5. The Up-and-Comers (35 countries)

Argentina, Costa Rica, Portugal, Uruguay...

  • Economic Profile: Solid middle ($16,940 GDP/capita)

  • Climate: Comfortable (18.8°C avg)

  • Vibe Check: Immigration-friendly with strong education

  • Signature Trait: Highest rainfall (1,094mm/yr) of any cohort

6. The Diverse Majority (36 countries)

Chile, China, Mexico, Russia...

  • Economic Profile: Growing ($12,432 GDP/capita)

  • Climate: Textbook temperate (20.4°C avg)

  • Vibe Check: Cultural melting pots with balanced policies

  • Signature Trait: Most "average" profile across all metrics

7. And, Malawi!

  • Economic Profile: Extreme hardship ($448 GDP/capita)

  • Climate: Unusually cold for its region (13.0°C avg)

  • Signature Trait: Rainfall data appears anomalous (15,240mm/yr likely error)

Poor Malawi, all by itself with no cluster-friends. Turns out we had a typo in the data. Mali does not get 15.4 meters (50 feet) of rainfall a year! We'll fix that.

This Problem is "Solved," Time for the Next

Well, except for Malawi!

I could go on, but the problem has been solved and we even got to play around with some extended analysis. So, time to stop and move on to our next problem to solve.

Hope you enjoyed this and potentially got something from it. If you're still reading, please respond by giving us a 👍 or 💩 :-) or leaving a comment.

Cheers!

0
Subscribe to my newsletter

Read articles from Jason Vertrees directly inside your inbox. Subscribe to the newsletter, and don't miss out.

Written by

Jason Vertrees
Jason Vertrees