SDE
Interview Date
10-08-2026
Result
Selected
Difficulty
Easy
Rounds
01
Drive Type
Off-Campus
Topics asked
Detailed experience
PART 1: ALGORITHMIC PROBLEM - MANACHER'S ALGORITHM & PALINDROMIC TREES (EERTREE) BASE PROBLEM You are processing a massive stream of genomic string data (length `N = 10^6`). Task: Design an algorithm to find the exact length of the Longest Palindromic Substring in the stream. A standard Dynamic Programming or Expand-Around-Center approach takes O(N^2) time, which will result in a Time Limit Exceeded (TLE) error. How do you implement Manacher's Algorithm—injecting dummy characters (like `#`) to handle even/odd lengths and utilizing a mathematical "center" and "right boundary" pointer—to find the longest palindrome in strictly O(N) time? FOLLOW-UP 1 The analysis requires deeper structural insights. You now need to find the total count of strictly *distinct* palindromic substrings within the sequence. Manacher's Algorithm identifies lengths but does not inherently deduplicate overlapping distinct palindromes. How do you design a Palindromic Tree (Eertree), which manages two distinct root nodes (for even and odd lengths) and suffix links, to construct the automaton and count all distinct palindromes in strictly O(N) time? FOLLOW-UP 2 The data sequence must be segmented. You are given a string of length `N = 10^5`. Task: Find the minimum number of cuts needed to partition the string such that every single resulting substring is a palindrome. A standard DP approach takes O(N^2) time by checking every prefix. To achieve ultra-low latency in a C++ backend without dynamic memory allocation overhead, how do you utilize a flat-array Eertree and optimize the DP transitions using "Series Links" (slink)—which jump over arithmetic progressions of palindromic suffixes—to solve the partitioning problem in strictly O(N log N) time? ------------------------------------------------ PART 2: SYSTEM DESIGN - GLOBALLY DISTRIBUTED SQL DATABASE (NEWSQL / SPANNER) BASE PROBLEM You are designing a globally distributed, NewSQL relational database designed to span multiple continents while maintaining strict ACID guarantees and full SQL support (similar to Google Spanner or CockroachDB). The data is horizontally sharded. Design the high-level architecture, focusing on how data is partitioned into ranges, and how a consensus algorithm (like Raft or Multi-Paxos) is deployed strictly at the shard level to guarantee high availability across data centers. FOLLOW-UP 1 A user initiates a massive financial transfer involving two rows that live on completely different shards (e.g., Shard A in Tokyo, Shard B in New York). Standard Two-Phase Commit (2PC) is notoriously slow and susceptible to blocking. How does introducing a synchronized physical time-keeping system (like TrueTime using Atomic Clocks and GPS receivers) allow the database to assign globally ordered, lock-free timestamps to distributed transactions, thereby guaranteeing External Consistency (Strict Serializability) without centralized lock managers? FOLLOW-UP 2 Enterprise analysts frequently run massive analytical `SELECT` queries (e.g., "Sum all account balances") that take 30 seconds to execute. If these reads lock the rows, the entire global financial system halts. How do you design Multi-Version Concurrency Control (MVCC) tied to the TrueTime timestamps to ensure these analytical queries can read a globally consistent "Snapshot" of the database in the past, entirely bypassing read-locks and completely avoiding interference with the primary replica's write path? ------------------------------------------------ PART 3: AI / LLM DISCUSSION QUESTIONS In the evolution of foundational architectures, how do hybrid models (like Jamba) intertwine Transformer layers with State Space Model (SSM / Mamba) layers to balance the infinite-context memory efficiency of SSMs with the superior retrieval and in-context learning capabilities of Self-Attention? What is the "Self-Rewarding Language Models" (SRLM) paradigm, and how does enabling the model to iteratively generate its own preference data and act as its own Reward Model bypass the bottleneck of relying entirely on expensive, static human-annotated RLHF datasets? Explain the memory allocation mechanics of "Prefix Sharing" (or RadixAttention) in highly concurrent LLM inference servers. When 5,000 distinct API requests are queued simultaneously, and all 5,000 share the exact same 2,000-token system prompt, how does the inference engine physically deduplicate the KV cache at the GPU block level to prevent catastrophic VRAM exhaustion? When utilizing the "LLM-as-a-Judge" framework for automated evaluation, what are "Positional Bias" and "Verbosity Bias"? How do these phenomena skew the evaluator model's ability to accurately compare two candidate responses, and what prompting or algorithmic techniques (like swapping candidate order) are required to mathematically debias the final score?