2027 Interview Question Bank • Page 1 of 4

Core AI, LLMs, Prompt Engineering & Agentic Loops (30 Q&As + Code)

Prefix KV caching math, reasoning latency vs TTFT, LoRA/QLoRA, MCP stdio/HTTP tooling, indirect prompt injection, idempotency, state checkpoints, and context compaction.

Back to 20 Companies
Vault Answers Locked — Complete 4 More Company Interviews (0/4 Passed)

2 sample answers are open below to preview. Finish all 5 rounds + Final Loop Completion on any 4 companies to unlock all 120 Q&As & production code snippets!

Q1StaffAsked at: OpenAI · Anthropic · StripeFree Sample

Why does placing Current UTC Time or user_id on line 1 of a 6,500-token agent system prompt multiply your monthly LLM bill?

Prompt/KV caches hash prefixes sequentially starting from token 0. If even 1 character changes near the top of the prompt, the cache miss cascades through all 6,500 static instructions and tool JSON schemas below it, forcing full uncached prefill billing on every turn. Always freeze static rules + tool schemas first and inject timestamps/user context at the bottom of the user message.

Production Pattern
// BAD: breaks 90% prefix cache hits on every call
const badPrompt = `Time: ${new Date().toISOString()}\n${STATIC_SYSTEM_RULES}`;

// GOOD: identical token prefix shares KV cache across all users
const messages = [
  { role: 'system', content: STATIC_SYSTEM_RULES },
  { role: 'user', content: `[Time: ${new Date().toISOString()}]\n${userQuery}` }
];
Interviewer Rejection Signal: Claiming caching matches substrings dynamically regardless of prefix offset.
Q2SeniorAsked at: Anthropic · Cursor · Scale AIFree Sample

Why do local Stdio MCP servers break silently when engineers use console.log() or Python print() for debugging?

MCP Stdio transport sends newline-delimited JSON-RPC 2.0 frames strictly over stdout. Writing human log lines into stdout corrupts JSON framing and crashes the host parser. Always route debug logs to stderr (console.error or sys.stderr).

Production Pattern
import sys, json
# BAD: print("Starting MCP server...") -> corrupts stdout JSON-RPC
print("MCP server booting...", file=sys.stderr, flush=True)
sys.stdout.write(json.dumps({"jsonrpc": "2.0", "id": 1, "result": {}}) + "\n")
sys.stdout.flush()
Interviewer Rejection Signal: Debugging Stdio MCP transport with bare stdout print statements.
Q3CoreAsked at: DeepMind · Meta · Hugging Face

In Transformer Scaled Dot-Product Attention, why do we divide Q * K^T by sqrt(d_k) before softmax?

Locked (0/4 Loops)
Answer & production code fix locked until 4 company interviews are passed (you have 0/4).Go Pass a Company Loop →
Q4SeniorAsked at: Meta · Databricks

In LoRA fine-tuning (W + B * A), why is matrix A initialized with Gaussian noise while matrix B is initialized strictly to zeros?

Locked (0/4 Loops)
Answer & production code fix locked until 4 company interviews are passed (you have 0/4).Go Pass a Company Loop →
Q5StaffAsked at: OpenAI · Google Gemini

Why does test-time reasoning scaling hurt Time to First User-Visible Token (TTFT) even on a 20ms fiber link?

Locked (0/4 Loops)
Answer & production code fix locked until 4 company interviews are passed (you have 0/4).Go Pass a Company Loop →
Q6SeniorAsked at: Anthropic · Infosys Topaz

Why does Progressive Disclosure (SKILL.md loaded on demand) beat stuffing 40 tool guides into an initial system prompt?

Locked (0/4 Loops)
Answer & production code fix locked until 4 company interviews are passed (you have 0/4).Go Pass a Company Loop →
Q7StaffAsked at: Amazon · Stripe · Anthropic

Why must state-mutating AI agent tools (issue_refund, create_order) enforce idempotency_key arguments?

Locked (0/4 Loops)
Answer & production code fix locked until 4 company interviews are passed (you have 0/4).Go Pass a Company Loop →
Q8CoreAsked at: OpenAI · Scale AI

Why should reasoning / justification fields come BEFORE score inside Structured JSON LLM outputs?

Locked (0/4 Loops)
Answer & production code fix locked until 4 company interviews are passed (you have 0/4).Go Pass a Company Loop →
Q9SeniorAsked at: DeepMind · ServiceNow

How do Anthropic MCP and Google A2A solve completely different layers of agent architecture?

Locked (0/4 Loops)
Answer & production code fix locked until 4 company interviews are passed (you have 0/4).Go Pass a Company Loop →
Q10SeniorAsked at: Infosys · Microsoft · Uber

When should you build a deterministic LangGraph State Machine instead of an unconstrained autonomous ReAct loop?

Locked (0/4 Loops)
Answer & production code fix locked until 4 company interviews are passed (you have 0/4).Go Pass a Company Loop →
Q11StaffAsked at: OpenAI · Anthropic

What concrete controls stop runaway autonomous agents from entering infinite tool-call loops and burning $500 on one broken ticket?

Locked (0/4 Loops)
Answer & production code fix locked until 4 company interviews are passed (you have 0/4).Go Pass a Company Loop →
Q12CoreAsked at: Meta · TCS

What is the practical difference between Temperature, Top-p (Nucleus), and Greedy (temp=0) decoding?

Locked (0/4 Loops)
Answer & production code fix locked until 4 company interviews are passed (you have 0/4).Go Pass a Company Loop →
Q13SeniorAsked at: Anthropic · LangChain

How does Context Compaction prevent "Context Rot" inside 40-turn coding agents without wiping active task goals?

Locked (0/4 Loops)
Answer & production code fix locked until 4 company interviews are passed (you have 0/4).Go Pass a Company Loop →
Q14SeniorAsked at: Anthropic · Meta

Why are Persistent Checkpoints (Postgres/Redis graph snapshots) mandatory for Human-in-the-Loop (HITL) enterprise workflows?

Locked (0/4 Loops)
Answer & production code fix locked until 4 company interviews are passed (you have 0/4).Go Pass a Company Loop →
Q15StaffAsked at: Infosys · Salesforce · Zapier

An agent has 100 MCP tools across Jira, SAP, GitHub, and PagerDuty. Injecting all schemas uses 18,000 tokens per call. How do you fix both spend and tool accuracy?

Locked (0/4 Loops)
Answer & production code fix locked until 4 company interviews are passed (you have 0/4).Go Pass a Company Loop →
Q16CoreAsked at: OpenAI · Google

How do Structured Outputs (Constrained Grammar / CFG Decoding) guarantee zero broken JSON in production?

Locked (0/4 Loops)
Answer & production code fix locked until 4 company interviews are passed (you have 0/4).Go Pass a Company Loop →
Q17SeniorAsked at: Hugging Face · Meta

Compare LoRA vs QLoRA vs Full Fine-Tuning when adapting an 8B model on 25,000 customer support tickets on one 24GB GPU.

Locked (0/4 Loops)
Answer & production code fix locked until 4 company interviews are passed (you have 0/4).Go Pass a Company Loop →
Q18SeniorAsked at: Anthropic · Stripe · EY

Why is Indirect Prompt Injection far trickier to defend than direct jailbreaks typed by users?

Locked (0/4 Loops)
Answer & production code fix locked until 4 company interviews are passed (you have 0/4).Go Pass a Company Loop →
Q19CoreAsked at: OpenAI · Deloitte

Why must LLMs never perform unassisted multi-step ledger arithmetic in voice/text generation?

Locked (0/4 Loops)
Answer & production code fix locked until 4 company interviews are passed (you have 0/4).Go Pass a Company Loop →
Q20StaffAsked at: Anthropic · OpenAI

Contrast Plan-and-Execute vs ReAct loops for multi-step research and coding agents.

Locked (0/4 Loops)
Answer & production code fix locked until 4 company interviews are passed (you have 0/4).Go Pass a Company Loop →
Q21CoreAsked at: Google · Microsoft

Why do Few-Shot examples sometimes backfire when fine-tuned reasoning models (o-series / R1-style) solve complex logic?

Locked (0/4 Loops)
Answer & production code fix locked until 4 company interviews are passed (you have 0/4).Go Pass a Company Loop →
Q22SeniorAsked at: TCS · NVIDIA

What makes Activation-Aware Weight Quantization (AWQ) preserve coding accuracy much better than naive Round-to-Nearest INT4?

Locked (0/4 Loops)
Answer & production code fix locked until 4 company interviews are passed (you have 0/4).Go Pass a Company Loop →
Q23SeniorAsked at: Stripe · Amazon

How should an AI microservice expose real-time token streaming cleanly to browsers and handle partial mid-stream disconnects?

Locked (0/4 Loops)
Answer & production code fix locked until 4 company interviews are passed (you have 0/4).Go Pass a Company Loop →
Q24StaffAsked at: Google · Cohere

When is Knowledge Distillation strictly superior to Prompt Engineering or RAG?

Locked (0/4 Loops)
Answer & production code fix locked until 4 company interviews are passed (you have 0/4).Go Pass a Company Loop →
Q25CoreAsked at: OpenAI · Accenture

Why do XML delimiters (<untrusted_doc>, <instructions>) dramatically lower instruction hierarchy leaks compared to Markdown headings?

Locked (0/4 Loops)
Answer & production code fix locked until 4 company interviews are passed (you have 0/4).Go Pass a Company Loop →
Q26SeniorAsked at: Anthropic · Perplexity

How do you handle long-running multi-agent handoffs cleanly when Subagent B fails a tool schema 3 times?

Locked (0/4 Loops)
Answer & production code fix locked until 4 company interviews are passed (you have 0/4).Go Pass a Company Loop →
Q27CoreAsked at: Meta · DeepMind

What does RoPE (Rotary Position Embeddings) solve relative to original fixed sinusoidal positional additions?

Locked (0/4 Loops)
Answer & production code fix locked until 4 company interviews are passed (you have 0/4).Go Pass a Company Loop →
Q28SeniorAsked at: Microsoft · Salesforce

Explain Memory Tiers inside a production Enterprise Copilot: Working vs Episodic vs Semantic vs Procedural Memory.

Locked (0/4 Loops)
Answer & production code fix locked until 4 company interviews are passed (you have 0/4).Go Pass a Company Loop →
Q29StaffAsked at: Google · OpenAI

How do you eliminate "Tool Argument Hallucination" when models invent plausible-looking UUIDs or enum values not present in retrieved context?

Locked (0/4 Loops)
Answer & production code fix locked until 4 company interviews are passed (you have 0/4).Go Pass a Company Loop →
Q30CoreAsked at: Wipro · Infosys

Why does Multi-Provider Model Fallback (OpenAI -> Anthropic -> Self-Hosted vLLM) require normalizing prompts/schemas via an abstraction gateway?

Locked (0/4 Loops)
Answer & production code fix locked until 4 company interviews are passed (you have 0/4).Go Pass a Company Loop →