Natural Language Processing (NLP) MCQs for the NSCT
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:
- tf = count of the term in the document ÷ words in the document
- idf = log(N ÷ df), where N is the number of documents and df is how many contain the term
- TF-IDF = tf × idf
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
- Confusing stemming with lemmatisation. Only lemmatisation gives real dictionary words.
- Forgetting that a term in every document has an idf of 0, so a high count does not mean a high TF-IDF.
- Adding vocabulary size and dimension instead of multiplying them when counting embedding weights.
- Swapping skip-gram and CBOW.
- Assuming bag-of-words understands negation. "Not good" and "good" share the feature "good".
- Fitting a TF-IDF vectoriser on the full dataset before the train/test split, which leaks test information.
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
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.