Natural Language Processing (NLP) MCQs for the NSCT

By the NSCT Exam Editorial Team · Updated 2026-11-24 · Facts checked against official sources on 2026-11-24

Natural Language Processing (NLP) is the part of AI that turns human text into numbers a model can learn from: splitting text into tokens, weighting words with TF-IDF, representing meaning with embeddings and modelling context with Transformers. It is one of the 17 topics in the AI, Machine Learning & Data Analytics area, which carries 10% of the NSCT according to HEC's Areas of Competencies. In 2026 candidates averaged 50.8% accuracy in this area, per the HEC NSCT report and APP.

The topic builds on data pre-processing and the deep learning ideas in Advanced Deep Learning.

Tokenisation

Tokenisation splits raw text into units called tokens. These can be words, subwords or characters. Whitespace tokenisation of "NSCT prep is hard" gives four tokens: NSCT, prep, is, hard.

Modern models such as BERT and GPT use subword tokenisation (WordPiece or byte-pair encoding). Frequent words stay whole, and rare words split into known pieces, so almost nothing becomes an unknown [UNK] token.

Two clean-up steps often follow:

Step What it does Example
Stemming Chops suffixes by rule; result may not be a real word studies → studi
Lemmatisation Returns the dictionary form using vocabulary and part of speech better → good, studies → study
Stop-word removal Drops very common function words the, is, of

Exam angle: expect "which technique maps X to Y" questions. An irregular form such as better → good always points to lemmatisation.

TF-IDF

TF-IDF (term frequency–inverse document frequency) weights a word by how often it appears in a document and how rare it is across the corpus:

Example: a 100-word article mentions "cricket" 3 times, and 10 of 1,000 documents contain it. tf = 0.03, idf = log10(100) = 2, so TF-IDF = 0.06. A word in every document gets idf = log(1) = 0.

Exam angle: read the formula given in the stem. Textbooks and libraries differ on the log base and on smoothing (scikit-learn adds 1 to idf), so use exactly what the question states.

Embeddings

A one-hot vector is as long as the vocabulary, with a single 1. Every pair of one-hot vectors is orthogonal, so "car" and "automobile" look completely unrelated.

Embeddings fix this with dense, learned vectors (often 100–300 numbers) in which similar words sit close together. Word2Vec learns them either with skip-gram (predict context from the centre word) or CBOW (predict the centre word from context). Similarity is measured with cosine similarity: for [1, 1, 0] and [1, 0, 1] it is 1 ÷ (√2 × √2) = 0.5.

Representation Dense? Keeps word order? Captures meaning?
Bag-of-words No No No
TF-IDF No No Weights importance only
Word2Vec / GloVe Yes No Yes, one vector per word
BERT-style contextual Yes Yes (via position) Yes, per occurrence

Exam angle: static embeddings give "bank" one vector whether it means a river bank or a bank loan. Contextual models give each occurrence its own vector.

Transformers

The Transformer (Vaswani et al., 2017) drops recurrence and uses self-attention: each token compares its query with every token's key, and the scores are scaled by √d_k, passed through softmax, and used to mix the value vectors. Because attention ignores order, positional encodings are added to the embeddings.

BERT stacks encoders and learns by filling in masked words. GPT stacks decoders and predicts the next token. A sequence of n tokens produces an n × n score matrix per head, so cost grows quadratically with length.

Exam angle: if a question asks why Transformers train faster than LSTMs, the answer is parallel processing of all positions, not fewer parameters.

Common traps

Worked examples

1. Understanding. Why do one-hot vectors fail to show that "car" and "automobile" are related? Answer: Any two different one-hot vectors are orthogonal, so their cosine similarity is 0. They carry no notion of meaning; dense embeddings place related words close together.

2. Application. A 20-word document contains "visa" 5 times. The corpus has 10,000 documents and "visa" appears in 100. Using tf = count ÷ length and idf = log10(N ÷ df), what is the TF-IDF? Answer: 0.5. tf = 5 ÷ 20 = 0.25, idf = log10(10,000 ÷ 100) = 2, and 0.25 × 2 = 0.5.

3. Analysis. A job-search site uses TF-IDF keyword matching. Searching "software engineer" misses adverts that only say "developer". What change helps most? Answer: Move to embedding-based (semantic) search. TF-IDF only matches exact tokens, while embeddings place "engineer" and "developer" close together, so cosine similarity finds the related adverts.

Practise

The quiz below has 100 Natural Language Processing questions you can filter by tier and difficulty.

Practise: 100 questions

Interactive quiz loading. The first 10 questions are shown below.

  1. In NLP, what does tokenisation do?

    1. Converts each word to its dictionary root form
    2. Splits text into smaller units such as words or subwords
    3. Removes common words such as "the" and "is"
    4. Assigns a grammatical category to each word
    Show answer

    Answer: B. Splits text into smaller units such as words or subwords

    Tokenisation breaks raw text into tokens (words, subwords or characters), usually the first step of an NLP pipeline. Root forms come from lemmatisation, removing common words is stop-word removal, and tagging grammar is POS tagging.

  2. Which group of words is most likely to be removed as stop words in a typical English pre-processing step?

    1. the, is, of, and
    2. Lahore, Karachi, Quetta
    3. excellent, terrible, boring
    4. run, running, ran
    Show answer

    Answer: A. the, is, of, and

    Stop words are very frequent function words such as "the", "is", "of" and "and" that carry little topic meaning, so many pipelines drop them. Place names are named entities, sentiment words carry meaning, and run/running/ran are inflections that stemming or lemmatisation would handle.

  3. Which technique would map the word "better" to "good"?

    1. Stemming
    2. Tokenisation
    3. One-hot encoding
    4. Lemmatisation
    Show answer

    Answer: D. Lemmatisation

    Lemmatisation uses a vocabulary and morphological analysis (often with the part of speech) to return the dictionary form, so "better" as an adjective becomes "good". Stemming only chops suffixes by rule and cannot produce an irregular form like "good".

  4. A vocabulary has V words. What does the one-hot vector for a single word look like?

    1. Length V with real values learned during training
    2. Length 1 holding the word's index
    3. Length 300 with mostly non-zero values
    4. Length V with exactly one 1 and all other entries 0
    Show answer

    Answer: D. Length V with exactly one 1 and all other entries 0

    A one-hot vector has one position per vocabulary word, so it is V long, with a 1 at the word's index and 0 elsewhere. It is sparse and encodes no similarity between words; learned dense vectors are embeddings.

  5. Which information does a plain bag-of-words representation throw away?

    1. How often each word appears
    2. Which words appear in the document
    3. The order of words in the document
    4. The size of the vocabulary
    Show answer

    Answer: C. The order of words in the document

    Bag-of-words keeps only which vocabulary words occur and how often, so "dog bites man" and "man bites dog" get identical vectors. Word order is lost; counts, presence and vocabulary size are all still represented.

  6. A term gets a high TF-IDF score in a document when it is:

    1. Frequent in that document but rare across the corpus
    2. Rare in that document but frequent across the corpus
    3. Frequent in that document and in every other document
    4. Absent from that document
    Show answer

    Answer: A. Frequent in that document but rare across the corpus

    TF rewards frequency inside the document, and IDF = log(N/df) rewards terms that appear in few documents. Both are high when the term is common locally but rare globally, which makes it a good keyword for that document.

  7. Which Word2Vec architecture predicts the surrounding context words from the centre word?

    1. CBOW (continuous bag of words)
    2. GloVe
    3. Skip-gram
    4. TF-IDF
    Show answer

    Answer: C. Skip-gram

    Skip-gram takes the centre word as input and predicts the words around it. CBOW does the reverse, predicting the centre word from its context. GloVe is a separate count-based embedding method and TF-IDF is not an embedding model.

  8. Finding "Imran Khan", "HEC" and "Islamabad" in a sentence and labelling them as person, organisation and location is called:

    1. Named entity recognition
    2. Part-of-speech tagging
    3. Sentiment analysis
    4. Stemming
    Show answer

    Answer: A. Named entity recognition

    Named entity recognition (NER) locates spans of text that name real-world entities and classifies them into types such as PERSON, ORG and LOC. POS tagging labels grammatical roles like noun or verb, not entity types.

  9. Labelling each word in "She reads books" as pronoun, verb and noun is an example of:

    1. Named entity recognition
    2. Lemmatisation
    3. Machine translation
    4. Part-of-speech tagging
    Show answer

    Answer: D. Part-of-speech tagging

    Part-of-speech (POS) tagging assigns a grammatical category such as noun, verb or adjective to each token. NER is about named entities, and lemmatisation changes word forms rather than labelling them.

  10. What is the core mechanism of the Transformer architecture introduced in "Attention Is All You Need" (2017)?

    1. Recurrent LSTM cells with gates
    2. Convolution over character sequences
    3. Hidden Markov states with transition probabilities
    4. Self-attention, with no recurrence
    Show answer

    Answer: D. Self-attention, with no recurrence

    The Transformer replaces recurrence with (multi-head) self-attention, letting every token attend directly to every other token. This allows parallel training over the whole sequence, unlike RNNs and LSTMs which process tokens one step at a time.

FAQs

Is NLP a separate area in the NSCT?

No. HEC lists Natural Language Processing as one topic inside the AI, Machine Learning & Data Analytics area, which carries 10% of the test. Expect it alongside deep learning, computer vision and evaluation questions, so study it as part of the whole area rather than in isolation.

Do I need to memorise the TF-IDF formula?

Yes, learn tf × idf with idf = log(N ÷ df), and know that a word in every document gets an idf of 0. Questions usually state the log base, so read the stem carefully. Some libraries add smoothing, which gives slightly different values from the textbook formula.

What is the difference between Word2Vec and BERT?

Word2Vec learns one fixed vector per word from its neighbours, so a word with two meanings shares one vector. BERT is a Transformer encoder that builds a vector for each occurrence from the whole sentence, so "bank" gets different vectors in different contexts.

Will I need to write NLP code?

Code reading is more likely than code writing. Be ready to trace short Python snippets that lower-case, split and count tokens, for example with collections.Counter. The Python for AI topic covers the library basics.

Next step

Continue with Computer Vision MCQs, go back to the AI & ML MCQs hub, or test yourself under time pressure in an NSCT mock test.