sde
Interview Date
19-08-2026
Result
Selected
Difficulty
Easy
Rounds
01
Drive Type
Off-Campus
Topics asked
Detailed experience
PART 1: ALGORITHMIC PROBLEM - GAME THEORY & DYNAMIC PROGRAMMING BASE PROBLEM You are designing an AI for a zero-sum, perfect-information game. Two players take turns removing stones from a single pile. On each turn, a player can remove 1, 2, or 3 stones. The player who removes the last stone wins. Task: Given `N` stones in the pile, design an algorithm to determine if the first player is guaranteed to win assuming both players play optimally. While you can solve this mathematically for this specific rule set in O(1) time, how would you model this generally as a state-space tree using the Minimax algorithm and Memoization to solve it in strictly O(N) time for any arbitrary set of allowed moves? FOLLOW-UP 1 The game expands. Instead of a single pile, there is a sequence of stone piles arranged in a line (represented by an array of integers). On a player's turn, they can only remove a pile of stones from either the extreme left or the extreme right of the remaining line. The goal is to maximize the total number of stones collected. Since a greedy approach (taking the largest of the two ends) fails against an optimal opponent, how do you design a 2D Dynamic Programming matrix to track the maximum score differential for any subarray `[L, R]`, solving the game in strictly O(N^2) time? FOLLOW-UP 2 The rules change drastically. There are now `K` independent piles of stones (where `K <= 10^5`), and each pile has up to `10^9` stones. On a player's turn, they must choose exactly one pile and remove any number of stones from it (at least 1, up to the entire pile). The player to take the very last stone across all piles wins. A multi-dimensional DP state will immediately result in an Out of Memory (OOM) error, and calculating the state space is impossibly slow. How do you apply the Sprague-Grundy Theorem and the concept of Nim-Sum (XOR sum) to determine the winner in strictly O(K) time and O(1) space? ------------------------------------------------ PART 2: SYSTEM DESIGN - DISTRIBUTED JOB SCHEDULER BASE PROBLEM You are designing a distributed task scheduling system (similar to Apache Airflow or AWS CloudWatch Events) capable of executing millions of scheduled tasks per day for thousands of microservices. Tasks can be one-off delays or recurring cron jobs. Design the high-level architecture to durably store task metadata, queue jobs at the precise time they are due, and distribute the execution across a fleet of worker nodes. FOLLOW-UP 1 At exactly midnight (00:00:00 UTC), a massive "thundering herd" occurs—tens of thousands of recurring daily batch jobs trigger in the exact same second. If your time-polling service attempts to push all these jobs into the distributed queue simultaneously, the database and queue ingestion endpoints will crash. How do you design a partitioned, hierarchical timing wheel or a distributed time-bucketing strategy to gracefully spread and parallelize this spike without missing execution windows? FOLLOW-UP 2 A worker node pulls a highly critical payment-processing job from the queue and begins execution. Five seconds later, the worker node undergoes a hard hardware crash and completely drops off the network. How do you design a heartbeat mechanism, visibility timeouts (e.g., using an SQS-like architecture), and idempotency keys to ensure the stalled job is safely reassigned to a healthy worker, while strictly guaranteeing the payment isn't processed twice? ------------------------------------------------ PART 3: AI / LLM DISCUSSION QUESTIONS How does Weight-Decomposed Low-Rank Adaptation (DoRA) differ from standard LoRA, and how does decoupling the magnitude and direction of the pre-trained weights allow for better learning stability during fine-tuning? What is "Reward Hacking" (or Specification Gaming) in the context of Reinforcement Learning from Human Feedback (RLHF), and how do researchers use KL-Divergence penalties to constrain the policy model from drifting too far from the base model? Explain the mechanical bottleneck of the "Attention Sink" phenomenon. How does StreamingLLM leverage initial tokens to maintain stable generation over near-infinite sequence lengths without recomputing the entire KV cache or suffering from catastrophic performance collapse? In distributed infrastructure for LLM training, what is the specific purpose of the ZeRO (Zero Redundancy Optimizer) framework, and how do ZeRO Stages 1, 2, and 3 differ in terms of partitioning optimizer states, gradients, and model parameters across a GPU cluster?