Home › Interviews › PwC

PwC Gen AI interview questions & answers

Real PwC interview experience for the Generative AI Engineer (walk-in drive) role. Process: a technical and system design round with a live pandas task, and a second round on ownership, mentoring and fitment.

17 questions3 roundsGenerative AI Engineer (walk-in drive)

Part 1 — Technical Round (POC vs Production, RAG Basics, Agents, Fine-Tuning)

Since you said production — what is the difference between a POC and a production-grade Gen AI architecture? What tech stack changes?
A POC is for quickly testing an idea, using light local tools — like ChromaDB or FAISS running on a local disk. It has no proper security, authentication, error handling, monitoring or load balancing. In production, we use a distributed, cloud-managed vector database — like Pinecone, Qdrant, Weaviate or enterprise pgvector — which can scale and handle many queries at the same time. And we add an API gateway, async queues like Celery and Redis, secrets management, role-based access control, monitoring with LangSmith or Phoenix, and cost and rate-limit guardrails.
Follow-up: If someone says "we used ChromaDB in production" —
Then the interviewer will definitely push back, sir. ChromaDB in local mode is fine for a POC, but not for real production scale.
How do you handle PDF ingestion and cost in production?
For ingestion, I use structured parsers like Unstructured or LlamaParse to split complex PDFs into clean text, tables and image metadata. And incremental indexing — only new or changed PDFs are embedded, not the full store again. For cost — semantic caching in Redis for similar questions, model routing so simple tasks go to cheaper models like GPT-4o-mini or Claude Haiku, and a token budget — only the top-K relevant chunks go into the prompt, not full pages.
What is the difference between tokenization and chunking?
Tokenization breaks text into small sub-word units called tokens, using a tokenizer like BPE or tiktoken, so the model can process them as numbers. Chunking is higher level — it splits a big document into meaningful sections, like 500 to 1000 tokens, before we create embeddings for retrieval.
What are vectors and tokens? And can an AI system work without a vector database?
Tokens are the text pieces the LLM reads and writes. Vectors are lists of numbers — embeddings — that represent the meaning of text. And yes, an AI system can work without a vector database. We can put the data directly in the context window if it fits, use keyword search like Elasticsearch with BM25, query a SQL database for structured data, or use a graph database with GraphRAG. But for RAG on millions of unstructured passages, a vector database is preferred because it gives very fast similarity search.
How does retrieval work during a RAG query? And what is the role of top-K and top-P?
The question is converted into an embedding. The vector database does an approximate nearest neighbor search against the stored chunks. The top K most relevant chunks are picked, maybe with a metadata filter, and added to the prompt. Now, top-K in retrieval means how many chunks we fetch — like K equal to 5. But top-K and top-P in generation are different — they are sampling settings that control how the LLM picks the next token.
Point. What is the basic difference between standard RAG and agentic AI?
Standard RAG is a straight line — query, retrieve chunks, build prompt, answer. Agentic AI uses the LLM in a loop, like ReAct. It plans multiple steps, decides which tools or APIs to call, looks at the results, and adjusts by itself until the goal is done.
How does an agent make decisions? Explain the full workflow.
The agent gets the task, reads the tool descriptions and system rules in its prompt, and reasons about the next step. Step one, thought — it checks the current state and the goal and chooses an action. Step two, action — it creates JSON parameters to call a tool, like a database search, calculator or API. Step three, observation — it gets the tool output. Step four, reflection — it checks if the goal is met, and either repeats or gives the final answer.
How do you score LLM or RAG outputs? And what are the steps in fine-tuning?
For scoring — context precision and context recall for retrieval, and faithfulness and answer relevancy for generation, using RAGAS or DeepEval. We combine LLM-as-a-judge with human feedback. For fine-tuning — first, prepare good quality instruction and response pairs. Second, use PEFT with LoRA — freeze the base model and train only small low-rank adapter matrices, so GPU memory is much lower. Third, QLoRA — load the base model in 4-bit, so fine-tuning can even run on a consumer GPU.

Part 2 — System Design, ML Fundamentals & Pandas Coding

Please sketch and explain a production RAG chatbot, from user query to final answer.
Sure. First, ingestion — documents are extracted, chunked into 500 to 1000 tokens, embedded and stored in the vector database with access-control metadata. When a user asks, the request comes through an API gateway with authentication. We first check a semantic Redis cache — if a similar answer exists, return it. If not, we create the query embedding, or use HyDE — hypothetical document embeddings. Then ANN search in the vector database with metadata filters, and a cross-encoder reranker picks the top-K chunks. These chunks and the question go to the LLM in a grounded system prompt. Before sending, a groundedness check runs, and then the answer is streamed using server-sent events.
How is an agent different from a linear pipeline?
A linear pipeline is fixed — input, search, prompt, output — no decisions. An agent runs in a loop with the LLM as the reasoning engine. It breaks the query into sub-tasks — thought, action, observation. It routes to tools like SQL, web search or a calculator using JSON schemas. And it reflects — if the tool output is wrong or incomplete, it corrects itself and tries again, up to a maximum step limit, then gives the final answer.
Why do you think we still ask traditional ML questions in a Gen AI interview?
Because Gen AI systems don't work alone. Query routing, content moderation, document categorization and reranking often use classic ML classifiers instead of heavy LLM calls, to keep latency and cost low.
Follow-up: Then tell me — loss function versus cost function, and classification versus regression.
Loss function is the error for one single data point — like binary cross-entropy or MSE. Cost function is the average loss over the whole dataset. Classification predicts a category — like routing a query to Legal or HR. Regression predicts a continuous number.
How do you detect and handle outliers before feeding data to a model?
For detection — Z-score, where points more than 3 standard deviations from the mean are outliers, for normal data. IQR — below Q1 minus 1.5 IQR or above Q3 plus 1.5 IQR, which works for non-normal data too. And Isolation Forest for high-dimensional data. For handling — remove records that are really corrupt, or winsorize, which means capping extreme values at, say, the 1st and 99th percentile, so we keep the data but reduce the skew.
You have a pandas DataFrame with Student and Marks columns. Students with marks less than 30 should get a new Result column with "Fail."
Okay. I will first create the Result column with the default value "Pass" for everyone. Then I use df dot loc with the condition df Marks less than 30, and set Result to "Fail" for those rows. This is vectorized, so no loop is needed. So if Bob has 22 and David has 12, they get Fail, and Alice, Charlie and Eve get Pass.

Part 3 — Technical Leadership & Fitment Round

Tell me about the ownership you had in your project.
Sir, I owned the system end to end — from the architecture and RAG pipeline design to deployment and monitoring. I also took care of cost and latency optimization, like caching and streaming.
In this role you may need to train client teams and mentor juniors. Are you comfortable with that?
Yes sir, very comfortable. I enjoy explaining concepts in simple language, and I have mentored junior team members on RAG and agent development.

💡 Preparation tips

  • Don't call local tools like ChromaDB 'production' — they will push back immediately.
  • Practise drawing a full RAG architecture and an agent workflow on paper.
  • Revise classic ML and pandas — loss vs cost, outliers, and df.loc filtering were asked.
Want the full written guide? See the complete question bank with code and diagrams on GitHub. New company interviews every week on YouTube.