← Blog

What ____ Are You?

Personality quiz generator for any category, powered by the Wikipedia API

Those "What kind of X are you?" quizzes are everywhere online. What sandwich are you. What 90s sitcom character are you. They're dumb and people love them, myself included. The thing I noticed is that they always have the same structure: a fixed set of multiple-choice questions, a mapping from answers to results, and a big reveal at the end. The questions are generic personality questions that could map to anything. The category doesn't actually matter.

A Camponotus flavomarginatus ant
You might be this ant. Answer 10 absurd questions and a Wikipedia article is chosen from your selected category. Wikimedia Commons

So I built a version where the category is a parameter. You pick a topic from a dropdown and the quiz generates itself. Animals, countries, foods, sports, musical instruments, whatever. The questions are the same regardless. What changes is the result, which gets pulled live from Wikipedia.

How the result is determined

The quiz presents 10 questions drawn randomly from a pool of about 500. Each question has four multiple-choice answers. The questions are intentionally absurd ("How many bees could you fit in your mouth?") because the goal is entertainment, not psychometric accuracy.

When you finish, your answers are fed into a hash function. Each answer's numeric value is multiplied by its question position (1-indexed), and the products are summed. The total is then taken modulo the number of available results. This produces a deterministic mapping: the same answers always give the same result, which makes it feel like the quiz "knows" something about you even though it's just arithmetic.

Wikipedia integration

The 25 available categories (Animals, Countries, Foods, etc.) each correspond to a Wikipedia category. When you select one, the app queries the MediaWiki API for up to 100 category members. It filters out disambiguation pages, list articles, redirects, and subsection entries so the results are all real, concrete things.

Once the hash picks a result, a second API call fetches that article's summary text and thumbnail image. The reveal screen shows the image, a paragraph of Wikipedia description, and a link to the full article. This means the result set updates whenever Wikipedia does. If someone adds a new animal to the Animals category, it becomes a possible quiz result without any change to the code.

The Jeopardy theme

There's an audio file bundled with the project: the Jeopardy! think music. It starts playing on the first user interaction (browsers require a gesture before autoplaying audio) and gradually speeds up as you progress through the questions. By question 8 or 9 the music is noticeably fast. This was added purely for comedic effect but it turned out to be the feature people mention most when they share the link.

Design

The UI is dark-themed with blue accent buttons. A progress bar fills as you answer questions. The transitions between the title screen, quiz, and results use CSS fade animations. The whole app is a single HTML file with inline JavaScript and CSS. No framework, no build step. The only external dependency is the Wikipedia API.