SDE
Interview Date
31-08-2026
Result
Selected
Difficulty
Easy
Rounds
01
Drive Type
Off-Campus
Topics asked
Detailed experience
PART 1: ALGORITHMIC PROBLEM - REAL-TIME STOCK TRADING ENGINE (ORDER BOOK) BASE PROBLEM You are building the core matching engine for a stock exchange. You receive a continuous stream of orders. Each order has a Type (Buy or Sell), a Price, and a Quantity. A trade occurs when a Buy order's price is greater than or equal to a Sell order's price. Trades should be matched prioritizing the best prices: Buy orders with the highest price and Sell orders with the lowest price. If prices are tied, prioritize the order that arrived first (First-In-First-Out). Task: Design the data structures and the algorithm to maintain the "Order Book" and match incoming orders. What is the time complexity of adding a new order and matching it? FOLLOW-UP 1 Traders frequently change their minds. The system must now support order cancellations and order quantity modifications in real-time. Task: How do you modify your data structures to efficiently support finding, canceling, and updating a specific order by its unique OrderID? How do you ensure this doesn't drastically slow down the matching process, and how do you handle the queue prioritization if a quantity is updated? FOLLOW-UP 2 Institutional investors want to hide their massive trades so they don't panic the market. Introduce "Iceberg Orders." An iceberg order has a total quantity (e.g., 10,000 shares) but a much smaller visible "tip" quantity (e.g., 500 shares). When the visible tip is completely traded, a new tip of 500 shares is automatically replenished into the order book from the hidden total. Task: How do you modify your matching logic to handle Iceberg Orders? Crucially, when an iceberg order replenishes its visible tip, it must lose its original time priority and be placed at the back of the line for that specific price level. PART 2: AI DISCUSSION & TERMINOLOGY Practical Application & Scaling: If you were tasked with using an LLM to help migrate a massive, 100,000-line legacy codebase to a modern framework, how would you handle the model's limited context window? How do you feed it the right information without it forgetting the rest of the project? General Knowledge: Many modern state-of-the-art models (like GPT-4 or Gemini 1.5 Pro) use an architecture called "Mixture of Experts" (MoE). In simple terms, what does this mean, and why is it more efficient than having one giant, dense neural network? Basic Terminologies (Briefly explain the following concepts): LoRA (Low-Rank Adaptation): A highly efficient method for fine-tuning large AI models. Instead of retraining every single parameter (which requires supercomputers), LoRA freezes the original model and only trains a tiny, attached layer of new parameters, saving massive amounts of time and money. Grounding: The process of linking an AI's abstract knowledge to concrete, verifiable reality or real-time data sources. RAG (Retrieval-Augmented Generation) is a common way to "ground" an AI by forcing it to cite specific documents. Tokenizer: The specialized software layer that runs before the AI model. It chops raw human text into chunks (tokens) that the neural network can process, and turns the AI's mathematical output back into human-readable text. Zero-Day Hallucination: A scenario where an AI is asked about a highly recent event that occurred after its training data cutoff, and instead of admitting it doesn't know, it convincingly fabricates a completely fake news story or outcome.