NLP & LLM Interview Master
100+ Natural Language Processing questions covering Transformer architecture, Self-Attention, Tokenization (BPE/WordPiece), BERT, GPT, and Vector Embeddings.
Difficulty Filters
Tools & Options
What is Natural Language Processing (NLP)?
Natural Language Processing (NLP) is a subfield of artificial intelligence, computer science, and linguistics concerned with the interactions between computers and human language, in particular how to program computers to process and analyze large amounts of natural language data.
What is Tokenization?
Tokenization is the process of breaking down a stream of text into smaller components called tokens. These could be words, characters, or subwords. It is usually the first step in an NLP pipeline.
What is Stemming?
Stemming is a crude heuristic process that chops off the ends of words to find their base or root form, even if the root is not a valid word. For example, 'running' becomes 'run'.
What is Lemmatization?
What is Stop Word Removal?
What is a Bag-of-Words (BoW) model?
What is TF-IDF?
What are Word Embeddings?
What is Word2Vec?
What is Part-of-Speech (POS) Tagging?
What is Named Entity Recognition (NER)?
What is Sentiment Analysis?
What are N-grams?
What is Levenshtein Distance?
What is an RNN (Recurrent Neural Network)?
Why use LSTM instead of a basic RNN?
What is the Vanishing Gradient Problem?
What is perplexity in Language Modeling?
What is BLEU score?
What is ROUGE score?
What is a Language Model?
What is Text Generation generation constraints?
Calculate Document Frequency.
What is the GloVe embedding?
Why sequence padding is important?
Explain the Attention mechanism.
What is Self-Attention?
Explain the Sequence-to-Sequence (Seq2Seq) Model.
What is Teacher Forcing?
What is Subword Tokenization?
How does Byte-Pair Encoding (BPE) work?
What is WordPiece?
Explain the concept of Word Sense Disambiguation (WSD).
What is an LLM (Large Language Model)?
What is BERT?
Explain the Masked Language Modeling (MLM) task in BERT.
What is Next Sentence Prediction (NSP) in BERT?
What is fine-tuning in NLP?
What is the difference between Extractive and Abstractive Summarization?
How do Convolutional Neural Networks (CNNs) perform in NLP?
Explain the Skip-gram architecture in Word2Vec.
Explain Continuous Bag of Words (CBOW) architecture.
What is Negative Sampling in Word2Vec?
What is Coreference Resolution?
Difference between Generative and Discriminative models.
What is the ELMo algorithm?
What is Top-K vs Top-P sampling?
What are the common evaluation metrics for NER?
How do you handle Class Imbalance in NLP?
What are Zero-shot and Few-shot learning?
Explain the architecture of a Transformer model.
What is the purpose of Positional Encoding in Transformers?
Explain the calculation of Scaled Dot-Product Attention.
What is Multi-Head Attention?
Difference between GPT architectures and BERT?
Explain Retrieval Augmented Generation (RAG).
What is LoRA (Low-Rank Adaptation)?
What is RLHF (Reinforcement Learning from Human Feedback)?
What is Prompt Engineering vs Prompt Tuning?
Explain the difference between T5 and standard Seq2Seq models.
What are Vector Databases?
Explain the 'Hallucination' problem in LLMs and mitigation strategies.
What are KV (Key-Value) Caches in LLM decoding?
What is FlashAttention?
What is Quantization in neural networks? (e.g. 4-bit, 8-bit)
Differentiate between RoPE and Absolute Positional Encodings.
Explain ALiBi (Attention with Linear Biases).
Explain Directed Acyclic Graphs (DAGs) in Dependency Parsing.
What is the Conditional Random Field (CRF) layer used for in NER?
What is Knowledge Distillation?
Explain Mixture of Experts (MoE) architecture.
How does Semantic Search differ from Lexical/Keyword Search?
What is Cross-Encoder vs Bi-Encoder?
What is Token Healing in LLMs?
Explain Direct Preference Optimization (DPO).
Implement Cosine Similarity in Python.
Calculate TF-IDF for word 'data'.
Write a PyTorch basic Self-Attention calculation.
Code: Convert a list of texts to bag of words.
How to apply Softmax in PyTorch?
Implement a simple bigram character generator.
Extract Named Entities using Spacy.
What is Cross-Entropy Loss formula mathematically?
Load a transformer model via HuggingFace.
Write WordPiece Subword Tokenizer logic pseudo-code.
How to clip gradients in PyTorch to prevent exploding gradients?
Calculate the Jaccard Similarity between two sentences.
Write an Attention Mask for sequence padding.
Implement early stopping loop in PyTorch.
Generate Text using HuggingFace GPT-2.
Pad sequences in raw python.
Implement Levenshtein distance conceptually using recursion.
How to initialize LayerNorm weights.
Calculate output dimension of a 1D Conv Layer over text.
Retrieve embeddings from a PyTorch Embedding layer.
Calculate Parameters in an LSTM relative to Input/Hidden size.
Save and load a PyTorch NLP Model.
Perform Top-K sampling conceptually.
Convert Text to sequence using HuggingFace Tokenizer.
Write an RNN step function loop.
Technical Interview Mastery Blueprint
Proven methodologies and frameworks to succeed in technical and architecture rounds.
1. The Engineering STAR Technique
When responding to architectural or situational questions, structure your answer using Situation, Technical Constraint, Action, and Measurable Result. Rather than jumping straight to syntax, articulate the business problem, why certain patterns (e.g. caching, queuing, immutability) were selected over alternatives, and what latency or throughput improvements were achieved.
2. Defending Architectural Trade-Offs
Senior interviewers evaluate how you weigh trade-offs. Always explain why you chose an approach: e.g., memory overhead vs CPU cycle speed, consistency vs availability (CAP theorem), or normalized schemas vs denormalized fast reads. Stating the drawbacks of your own proposal demonstrates maturity and production experience.
3. Clean Code & Edge-Case Proactivity
In live-coding rounds, communicate your thinking aloud before typing. State edge cases explicitly: null or undefined inputs, extreme boundary values, concurrency races, and network timeouts. Writing modular, well-named functions with deterministic unit tests separates junior candidates from staff-level engineers.
4. Antipatterns to Avoid
Avoid reciting memorized definitions without practical context. Never dismiss non-functional requirements such as security (CSRF, injection, token rotation), observability (logging, metrics), and accessibility (ARIA, semantic standards). Always ask clarifying scope questions before writing complex implementations.
Explore Related Tools
Hand-picked utilities and calculators related to this tool.
