Background
- ~4 YOE in systems/backend with C++
- Interview process: 3 technical rounds + HR
Round 1 — Core C++ & Multithreading (60 min)
Heavy on C++ internals. Not textbook theory — they wanted real understanding.
Q1: Smart Pointers
- Types (unique_ptr, shared_ptr, weak_ptr) and use cases
- Follow-up: Demonstrate a memory leak while using smart pointers (circular reference with shared_ptr)
- Follow-up: How would you identify and resolve it? (weak_ptr to break cycle, tools like Valgrind/ASAN)
Struggled on the "demonstrate a memory leak" follow-up — I knew the concept but couldn't write the exact code quickly.
Q2: Const Member Function + Call Counter
- Given a
constmember function — how would you count how many times it's called? - Answer:
mutablekeyword on the counter variable, since const member functions can't modify non-mutable members.
Q3: Multithreading Basics
- What is multithreading?
- Difference between concurrency (interleaving on single core) and parallelism (simultaneous on multiple cores)
Q4: Thread-Safe Producer-Consumer Queue
- Design with mutex + condition variables
- Follow-up: What if no producer has started but all consumers are already waiting? (Spurious wakeups, proper predicate in
wait(), potential starvation)
Q5: Rule of Five
- When you define any of destructor, copy constructor, copy assignment, move constructor, or move assignment — you should define all five.
- Required when managing raw resources (memory, file handles, sockets)
Round 2 — DSA & Problem Solving (60 min)
Straightforward DSA but expected clean implementation.
Q1: Sort array of 0s, 1s, and 2s
- Dutch National Flag algorithm. O(n) time, O(1) space, single pass with three pointers.
Q2: Reverse a stack recursively
- No external data structure allowed. Use recursion itself as the "stack" — pop all, insert at bottom recursively.
Q3: Shortest path in a grid
- BFS from source to destination. Standard grid traversal with visited array.
Q4: Implement shared_ptr
- Reference counting with a control block
- Handle copy constructor, assignment operator, destructor decrementing count
- Delete managed object when count hits 0
This was the hardest question — implementing clean memory management in 15 minutes under pressure.
Round 3 — LLD + System Design + Debugging (60 min)
Q1: Design a Thread-Safe Message Queue
- Similar to Round 1's producer-consumer but more design-focused
- Follow-up: What happens when the destructor is called while threads are blocked/waiting? (Need graceful shutdown: set a flag, notify all, join threads before destroying the queue)
Q2: Design Microsoft Word (simplified)
- Support: multiple font types, styles, sizes, bold/italic, images, undo/redo
- Discussed: Composite pattern for document structure, Command pattern for undo/redo, Strategy pattern for formatting
- Interviewer cared about extensibility — how to add new features without modifying existing code
Q3: Debugging
- Given two functions with bugs:
- Memory leak — allocated resource not freed on an early return path
- Mutex issue — lock acquired but not released before an exception, needed RAII lock guard
Tips for Adobe MTS-2 (C++)
- C++ depth is non-negotiable — they won't accept "I know it conceptually." You need to write code demonstrating smart pointer leaks, implement shared_ptr, etc.
- Multithreading is half the interview — producer-consumer, thread safety, condition variables, graceful shutdown. Practice implementing these from scratch.
- Rule of Five and const correctness — these seem basic but follow-ups go deep (mutable, move semantics, copy elision)
- LLD questions expect design patterns — Command (undo/redo), Composite (document tree), Strategy (formatting). Know when to apply each.
- Debugging questions are common — practice reading code and finding memory leaks + concurrency bugs by inspection.
- Follow-ups are where it matters — the base question is easy, the follow-up is what differentiates hire from no-hire.