AI & machine learning quiz

NLP Quiz: Natural Language Processing MCQs from TF-IDF to Transformers

Test your natural language processing knowledge: text preprocessing, bag of words and TF-IDF, word embeddings, classic NLP tasks, transformers (BERT vs GPT), Hugging Face, evaluation metrics and LLM-era tokenisation and RAG.

✅ Free · no login60 questions⏱ Timer📝 Explanations🖨 Mark sheet & PDFIntermediate
NLP Quiz: free online quiz with timer and mark sheet by Codanics
Loading…

NLP Quiz

60 questions · 7 topics · timer · instant explanations · printable mark sheet.

  • Questions60 in the bank, 10–30 per attempt
  • Levels20 easy · 24 medium · 16 hard
  • TimeAbout 5–20 minutes
  • PriceFree, no login needed
  • Made byDr. Aammar Tufail, Codanics
  • Updated18 November 2026

In short: the NLP Quiz is a free online multiple-choice quiz by Codanics with 60 questions on text preprocessing; text representation; classic NLP tasks; transformers: BERT and GPT; Hugging Face basics; evaluating NLP models; and subwords, LLMs and RAG. You choose the number of questions and the difficulty, answer against a timer, see an explanation after every answer and finish with a printable mark sheet.

🚀 Follow Codanics for more free quizzes and lessonsNew quizzes, free lessons, scholarships and PhD positions, straight to your phone.

What the NLP Quiz covers

Natural language processing went from counting words to large language models in a decade, but the foundations still matter: tokenisation, representations and evaluation decide whether a text model works.

This quiz moves from classic NLP (stemming, TF-IDF, named entity recognition) to transformers, Hugging Face pipelines and retrieval-augmented generation.

  • Text preprocessing 8 questions
  • Text representation 10 questions
  • Classic NLP tasks 9 questions
  • Transformers: BERT and GPT 9 questions
  • Hugging Face basics 8 questions
  • Evaluating NLP models 8 questions
  • Subwords, LLMs and RAG 8 questions

Who it is for: AI and data science students, developers building chatbots or text classifiers and readers of the Codanics NLP mastery guide.

How the quiz works

  1. Type your name if you want it printed on the mark sheet (optional; it never leaves your browser).
  2. Choose 10, 20 or 30 questions, a difficulty (Easy, Mixed or Hard) and the timer: Standard, Relaxed or none.
  3. Answer each question before the timer runs out. Press A–D or 1–4 on a keyboard, or tap an option on your phone.
  4. Read the explanation after every answer, then press Next.
  5. At the end, get your score, grade, topic-wise breakdown and a full answer review. Print it or save it as a PDF.
  6. Retake the quiz for a fresh random set, or practise only the topics you found hard.

Free video lessons from Codanics

Score lower than you hoped? These free lessons from the Codanics YouTube channel cover the same topics, explained step by step.

▶ Full playlist: Advanced machine learning
Free on the Codanics YouTube channel, taught in Urdu/Hindi.

Sample questions with answers

Here are 9 questions from the bank, with answers and explanations. The quiz above draws from all 60.

1. What is tokenisation in NLP?
  1. Splitting text into smaller units such as words or subwords
  2. Translating text into another language
  3. Removing all numbers from a text
  4. Counting the sentences in a document

Answer: A. Splitting text into smaller units such as words or subwords
Tokenisation breaks raw text into tokens, the basic units a model or vectoriser works with. Tokens can be words, subwords or characters.

2. In a bag-of-words representation, what is lost?
  1. The count of each word
  2. The vocabulary of the corpus
  3. The order of the words
  4. The number of documents

Answer: C. The order of the words
Bag of words only counts how often each word appears, so 'dog bites man' and 'man bites dog' get the same vector.

3. What is a word embedding?
  1. A dense vector that captures a word's meaning
  2. A list of a word's synonyms
  3. The position of a word in the dictionary
  4. A one-hot vector of the vocabulary size

Answer: A. A dense vector that captures a word's meaning
Embeddings map words to dense, low-dimensional vectors so that words used in similar contexts, like 'doctor' and 'nurse', end up close together.

4. Labelling 'Lahore' as a location and 'Codanics' as an organisation in a sentence is which task?
  1. Part-of-speech tagging
  2. Sentiment analysis
  3. Named entity recognition
  4. Machine translation

Answer: C. Named entity recognition
NER finds spans of text that name real-world things and assigns types such as PERSON, ORGANISATION, LOCATION or DATE.

5. BERT is mainly which type of transformer?
  1. Decoder-only
  2. Encoder-only
  3. Encoder-decoder
  4. Recurrent network

Answer: B. Encoder-only
BERT stacks transformer encoders and reads the whole sentence in both directions, which suits understanding tasks such as classification and NER.

6. What is the Hugging Face Model Hub?
  1. A tool for drawing neural networks
  2. An online library of shared pre-trained models
  3. A GPU sold by Hugging Face
  4. A Python package for web scraping

Answer: B. An online library of shared pre-trained models
The Hub hosts many pre-trained models, datasets and demos that you can download and use with a few lines of code.

7. In the output of a Hugging Face tokenizer called with padding=True, what does the attention_mask show?
  1. Which words in the text are nouns and verbs
  2. How much attention each head paid to a token
  3. Which tokens were removed as stop words
  4. Which positions are real tokens and which are padding

Answer: D. Which positions are real tokens and which are padding
attention_mask has 1 for real tokens and 0 for padding, so the model ignores the padded positions.

8. A language model assigns probability 1/4 to every correct next token. What is its perplexity?
  1. 4
  2. 0.25
  3. 1
  4. 16

Answer: A. 4
Perplexity is the exponential of the average negative log-likelihood: exp(ln 4) = 4. It is like choosing uniformly among 4 options; lower is better.

9. What does RAG (retrieval-augmented generation) add to a language model?
  1. Extra layers added to the network
  2. A larger vocabulary of tokens
  3. Relevant documents retrieved and placed in the prompt
  4. Random noise to improve creativity

Answer: C. Relevant documents retrieved and placed in the prompt
RAG searches a knowledge source for passages related to the question and gives them to the model as context, so answers can be grounded in that content.

Free guides and blogs to study

Free tools for your studies and research

Codanics also has 160+ free online tools for students and researchers: statistics calculators, meta-analysis, PDF and writing tools. They run in your browser, with no login.

Browse all free tools →

Frequently asked questions

Is the NLP Quiz free?

Yes. The NLP Quiz is completely free, with no sign-up, no login and no limit on attempts.

How many questions are in the NLP Quiz?

The question bank has 60 multiple-choice questions (20 easy, 24 medium and 16 hard) across 7 topics. Each attempt draws 10, 20 or 30 of them at random, so every attempt is different.

How does the timer work?

Each question has its own countdown: about 25 seconds for easy, 40 for medium and 55 for hard questions, plus 15 seconds when there is code to read. Choose Relaxed to double the time or switch the timer off to study at your own pace. Unanswered questions count as skipped.

Can I get a certificate or mark sheet?

Yes. When you finish, you get a mark sheet with your name, score, grade, time, topic-wise performance and every answer explained. Use Print or save as PDF to keep it. It is a self-assessment result, not an official certificate.

Are the answers and explanations correct?

Every question was written and reviewed for one clearly correct answer, and code questions were checked by running the code. If you think an answer is wrong, tell us on the Codanics WhatsApp channel or in the YouTube comments and we will fix it.

Does the NLP quiz cover large language models?

Yes. It covers subword tokenisation, encoder-only versus decoder-only transformers, context windows and the basics of RAG, alongside classic NLP.

What should I study if I score low?

Start with the Codanics NLP mastery guide with Hugging Face, then retake the quiz on Easy and work up to Hard.

Is my data stored anywhere?

No. The quiz runs entirely in your browser. Your name, answers and score are not uploaded. Your best score and settings are remembered only in this browser so you can track your progress.

More free quizzes

See all Codanics quizzes → · Courses · Free tools · Blog

Follow Codanics

Created by Dr. Muhammad Aammar Tufail, Codanics. Published 18 November 2026, last updated 18 November 2026. Found a mistake or want a quiz on another topic? Tell us on the WhatsApp channel or contact us.