Natural Language Processing Questions

Core natural language processing building blocks: text preprocessing and tokenization (word, character, subword BPE/WordPiece/unigram, multilingual, Unicode and noisy user-generated text), word and sentence embeddings (Word2Vec, GloVe, contextual embeddings, pooling and semantic similarity search), text classification, sentiment and intent detection (including limited labels, active learning and long documents), sequence labeling and named entity recognition (BIO tagging, CRFs, relation extraction, slot filling and semantic parsing), sequence-to-sequence models and machine translation (teacher forcing, exposure bias, beam search, BLEU, low-resource and cross-lingual transfer), topic modeling and theme extraction, language-model basics such as perplexity, and fine-tuning pretrained encoders like BERT for NLP tasks, including task-appropriate evaluation metrics, annotation and error analysis. Excludes transformer architecture internals, LLM pretraining and decoding behavior, retrieval-augmented generation and vector index engineering, parameter-efficient fine-tuning, and model serving or MLOps.

HardSystem Design
24 practiced

Design the text preprocessing for training one machine translation model across 10 languages with different scripts. How would you handle normalization, tokenization and vocabulary, and what are the compute implications of your choices?

MediumTechnical
16 practiced

Implement in Python the core training loop for Byte-Pair Encoding (BPE) merges. Given a tokenized corpus (list of words) where each word is a list of characters (you can add an end-of-word marker), produce merge operations until a target vocabulary size is reached. Focus on correctness: count pair frequencies, choose highest-frequency pair, merge it, and update counts. Explain runtime trade-offs.

HardSystem Design
19 practiced

Design a model that jointly performs named-entity recognition and relation extraction from a shared pretrained encoder. How do you represent entities, balance the two losses, keep one task from hurting the other, and evaluate them together?

MediumTechnical
21 practiced

Compare Byte-Pair Encoding (BPE), WordPiece, and the Unigram Language Model (used by SentencePiece) for subword segmentation. Explain algorithmic differences, what objective each optimizes, typical hyperparameters (e.g., vocab size), and the implications for multilingual models and rare-word handling.

MediumTechnical
24 practiced

Compute BLEU (up to 4-grams) by hand for one reference: 'the cat is on the mat' and candidate: 'the cat cat on mat'. Show n-gram precision for 1-4 grams, apply brevity penalty, and explain why BLEU can be misleading for single sentence evaluation. Suggest two alternatives or complements to BLEU for sentence-level quality.

Unlock Full Question Bank

Get access to all 24 Natural Language Processing interview questions and detailed answers.

Sign in to Continue

Join thousands of developers preparing for their dream job.