Real-Time AI Technical Interview & Assessment Engine
Simulate real-time FAANG coding interviews: verbal approach discussions, progressive 3-tier hints, test suite runners, and Big-O assessment scorecards.
Given a 1-indexed array of integers `numbers` that is already sorted in non-decreasing order, find two numbers such that they add up to a specific `target` number. Return the 1-based indices of the two numbers as an integer array `[index1, index2]`. You must write an algorithm with $O(N)$ or $O(\log N)$ time complexity and $O(1)$ extra space.
Design a data structure that follows the constraints of a Least Recently Used (LRU) cache. Implement the `LRUCache` class: - `LRUCache(int capacity)` Initialize the LRU cache with positive size `capacity`. - `int get(int key)` Return the value of the key if key exists, otherwise return `-1`. - `void put(int key, int value)` Update the value of key if key exists. Otherwise, add the key-value pair to cache. If keys exceed capacity, evict the least recently used key. Must run `get` and `put` in $O(1)$ average time complexity.
Given a binary tree, find the lowest common ancestor (LCA) of two given nodes `p` and `q` in the tree. The lowest common ancestor is defined between two nodes `p` and `q` as the lowest node in `T` that has both `p` and `q` as descendants (where we allow a node to be a descendant of itself).
You are given an array of integers `nums`, there is a sliding window of size `k` which is moving from the very left of the array to the very right. You can only see the `k` numbers in the window. Each time the sliding window moves right by one position. Return the max sliding window array. Must solve in $O(N)$ time complexity.
Design a scalable, high-throughput distributed URL Shortener service like Bitly or TinyURL. Key Requirements: 1. **Functional Requirements**: - Shorten a long URL to a unique 7-character alias (e.g., `https://tiny.url/abc123X`). - Redirection: Accessing the short link redirects to the original long URL with $< 50\text{ms}$ latency. - Analytics: Track click counts and referrer metrics per link. 2. **Scale & Capacity**: - 100M new URLs created per day ($~1,150\text{ writes/sec}$). - 10B redirects per day ($100:1$ read/write ratio, $~115,000\text{ reads/sec}$). 3. **Availability & Resilience**: - $99.99\%$ uptime, fault-tolerant DB, global CDN caching strategy. Prepare to discuss Base62 encoding vs Key Generation Service (KGS), database schema, caching layer (Redis), and rate limiting.
Behavioral & Leadership STAR Method Scenario: "Tell me about a time when you had a major disagreement with a senior teammate on your team regarding technical architecture during a critical production release outage." Your response should follow the **STAR Framework**: 1. **Situation**: Set the context and timeline. 2. **Task**: What was your responsibility? 3. **Action**: How did you de-escalate disagreement and evaluate trade-offs objectively? 4. **Result**: What was the measurable outcome and long-term learning?