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.

MediumTechnical
18 practiced

Given an original string and its WordPiece-tokenized version (with '##' denoting subword continuation), implement a Python function that maps each token back to the original character span(s). Explain how you'd use this mapping to align token-level NER predictions back to original text spans, and discuss normalization pitfalls (unicode, whitespace normalization).

MediumTechnical
19 practiced

You're adapting a pretrained Transformer encoder for document classification, and input lengths range from a couple of sentences to several thousand tokens. How would you turn the per-token representations into a single vector for the classifier, and what would push you toward one pooling strategy over another as the length variance grows and the input gets noisier?

MediumTechnical
17 practiced

You have precomputed sentence embeddings for a corpus of 100k sentences. Write code that returns the top-k sentences most similar to a query, and explain how you would reduce memory and latency if the corpus grew a hundredfold.

HardTechnical
20 practiced

A product that works well in English performs poorly in other languages, and you have very different amounts of labeled data per language. Propose a prioritized plan covering tokenizer and model choice, transfer, data balancing, per-language evaluation, and whether to serve one multilingual model or several.

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?

Unlock Full Question Bank

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

Sign in to Continue

Join thousands of developers preparing for their dream job.