SDE
Interview Date
10-08-2026
Result
Selected
Difficulty
Medium
Rounds
01
Drive Type
Off-Campus
Topics asked
Detailed experience
PART 1: ALGORITHMIC PROBLEM - IN-MEMORY CACHE (LRU) BASE PROBLEM You are building an in-memory cache to speed up database queries. The cache has a maximum capacity of 'C' items. Task: Design a data structure that supports the following operations in strictly O(1) time complexity: get(key): Return the value of the key if it exists in the cache, otherwise return -1. put(key, value): Update the value of the key if it exists, or insert the key-value pair if it does not. If the number of keys exceeds the capacity 'C' from this operation, evict the Least Recently Used (LRU) key. Discuss the combination of data structures required to achieve O(1) time for both operations. FOLLOW-UP 1 The caching requirements have been updated. Data becomes stale quickly, so you need to add a Time-To-Live (TTL) feature. Task: Modify your put operation to accept a ttl_seconds parameter. A key should be considered invalid and treated as if it doesn't exist if its TTL has expired. How do you handle the eviction of expired keys? Discuss the trade-offs between "lazy eviction" (checking expiration only when get is called) and "active eviction" (running a background process to clear expired keys). FOLLOW-UP 2 Your application is incredibly popular, and the cache must now be distributed across a cluster of 50 separate caching servers (like Redis or Memcached). Task: How do you decide which server gets which key-value pair? Discuss the "modulo hashing" approach (hash(key) % 50) and its massive flaw if a server crashes or if you need to add a 51st server. How does "Consistent Hashing" solve this problem and minimize cache misses during scaling? PART 2: AI DISCUSSION & TERMINOLOGY Practical Application & Architecture: When using an AI tool to help you design the architecture for a large-scale system, what are the primary limitations of the AI's advice? How do you provide the AI with enough "system context" so it doesn't just give you a generic textbook answer? General Knowledge: What is "Transfer Learning" in the context of Artificial Intelligence, and why is it considered one of the most important concepts for making AI accessible to smaller companies? Basic Terminologies (Briefly explain the following concepts): Diffusion Models: The AI architecture primarily used for generating highly realistic images and video (like Midjourney or DALL-E). It works by taking an image, gradually corrupting it with random static (noise) until it's unrecognizable, and then training a neural network to reverse the process and "denoise" it back into a specific picture. Hyperparameters: The structural settings chosen by a human engineer before the AI begins training (such as the learning rate, the batch size, or the number of layers in the network). This is different from "parameters" (the internal weights that the AI adjusts on its own during training). Self-Attention: The mathematical mechanism at the heart of the Transformer architecture. It allows the AI to look at a single word in a sentence and instantly calculate how heavily it relates to every other word in that same sentence, providing deep contextual understanding. RLAIF (Reinforcement Learning from AI Feedback): An evolution of RLHF. Instead of relying on expensive, slow human raters to grade an AI's answers during training, a completely separate, highly advanced AI model acts as the "judge" to score and guide the training of the new model.