Skip to main content

Welcome to a Grasp lesson

Create a free account to keep studying and create your own study path.

Lesson 7

Responsive Design Adaptation

Recommended resources

Welcome to the final lesson of our first module. Over the past few lessons, we have assembled a complete framework for navigating a system design interview—from clarifying requirements and making back-of-the-envelope estimations to sketching a high-level design and justifying your technology choices with structured trade-off analysis.

Today, we address the most dynamic part of the interview: what happens when the interviewer throws you a curveball. An interview is not a static presentation; it is a collaborative, and sometimes adversarial, technical discussion. An interviewer will almost certainly introduce new requirements or constraints mid-design. Your ability to adapt gracefully and intelligently is one of the strongest signals you can send about your seniority and depth of understanding.

In this lesson, you will learn how to treat these interruptions not as obstacles, but as opportunities to showcase your flexibility and re-evaluate the very trade-offs we've been discussing.

The Interviewer's Intent: A Test of Flexibility

First, it's crucial to understand why interviewers introduce new requirements. It is rarely to trick you. Instead, they are testing for several key senior-level attributes:

  • Flexibility and Adaptability: Are you dogmatically attached to your initial design, or can you pivot when the landscape changes?
  • Depth of Knowledge: Do you understand the second- and third-order effects of your decisions? A new requirement might be specifically designed to stress-test a trade-off you made earlier.
  • Pragmatism: Can you distinguish between a constraint that requires a small tweak versus one that demands a fundamental architectural shift?
  • Communication Under Pressure: How do you reason and articulate your thoughts when faced with an unexpected challenge?

A common mistake is to view these questions as interruptions to your prepared script. Resisting or deferring them can be a red flag. Let's look at a real-world account from an engineer's Meta interview.

I was expecting a rejection from Meta after my System Design interview. But a follow up interview changed the reality. First week of February, I had my first system design interview of Meta. It’s a… | Smit Thakkar

This LinkedIn post and a key comment provide two opposing perspectives on how to handle an interviewer's unexpected questions.

First, read the main post by Smit Thakkar, focusing on his description of the interview and his initial takeaway: "I should always drive the interview... If interviewer has more requirements, ask them to park it for later." Next, read the top comment by Jonathan M. It offers a crucial counterpoint: "This... is not great advice... The interviewer isn’t trying to trick you. They want you to succeed."

Jonathan's perspective is the one to internalize. Pivoting to address the interviewer's question demonstrates confidence and a collaborative mindset. The question about deleting a post wasn't a distraction; it was a prompt to discuss complex topics like soft deletes, asynchronous cleanup jobs, and the performance implications of database operations—all hallmarks of a senior engineer's thinking.


A Framework for Adapting Your Design

When an interviewer introduces a new constraint, avoid panicking. Instead, follow a structured process that turns the challenge into a showcase of your thought process.

This 5-step framework serves as your guide. A new requirement often forces you to loop back from 'Deep-dive' or 'Bottlenecks' to 'High-level system' or even 'Define the problem' to reassess your initial assumptions.

Here is a mental model for reacting to a change:

  1. Acknowledge and Clarify: Verbally confirm you understand the new requirement. Repeat it back in your own words. "Okay, so just to confirm, you're asking how the design would change if we need to provide real-time updates with sub-second latency, instead of the 5-second polling we initially discussed?" This buys you a moment to think and ensures you're solving the right problem.

  2. Assess the Impact: Quickly trace the new requirement through your existing architecture diagram. Which component(s) does it affect? Does it invalidate a key assumption or trade-off you made? For instance, a requirement for transactional consistency might invalidate your choice of an eventually consistent NoSQL database for a particular service.

  3. Propose Options and Trade-offs: Brainstorm 1-2 potential solutions. Don't just give one answer; present them as alternatives with clear trade-offs. This is where you connect back to our previous lessons.

    • Option A (Tweak): "We could stick with our current REST API but switch to long-polling on the client. This is a minimal change, but it can be resource-intensive on the server."
    • Option B (Pivot): "A better approach would be to introduce WebSockets for this specific feature. This adds complexity to our stack, but it's the right tool for true real-time, bi-directional communication, which seems to be the new priority."
  4. Recommend and Justify: State your preferred option and explain why it's the best fit for the new set of constraints. "Given the emphasis on low latency, I recommend we pivot to WebSockets (Option B). While it requires more engineering effort upfront, it provides a much better user experience and is more scalable for this specific real-time feature."


Adaptation in Action: A Mock Interview Analysis

Let's see how this framework plays out in a high-stakes mock interview for a Senior/Staff role. The problem is to design an online auction platform.

OpenAI & Meta Senior/Staff System Design Mock Interview: Design Online Auction

This video is a masterclass in adaptation. The interviewer repeatedly challenges the candidate's design, forcing him to pivot from simple solutions to more robust, scalable ones.

Watch the following key sequences where the candidate is forced to adapt: From Polling to Real-Time: The candidate first suggests polling for bid updates but quickly recognizes its limitations and pivots. Watch his self-correction from a brute-force polling idea to a more robust SSE and Redis Pub/Sub architecture. Notice how he discusses the trade-offs (one-directional vs. bi-directional communication). From Batch to Event-Driven: The candidate initially proposes a simple cron job to determine auction winners. The interviewer challenges the latency of this approach. Observe the pivot from the cron job discussion to an event-driven solution using a message queue with a delay, as suggested by the interviewer here. Handling Added Complexity: The interviewer adds another twist: the auction ends only after a winning bid has been stable for an hour. Watch how the candidate adapts his new message queue design to handle this complex rule in this segment. This shows he can think multiple steps ahead. Advanced Adaptation (Optional): Towards the end, the interviewer introduces an industrial-strength workflow orchestration tool, Temporal.io, as an even more robust alternative. Watch from this explanation to see how such tools can solve complex scheduling and state management problems that arise from new requirements.

In each case, the candidate didn't resist the change. He embraced it, explored the implications, and adapted his design, each time demonstrating a deeper level of architectural maturity.


Case Study: Adapting a Food Delivery Service

Let's look at another example from a detailed walkthrough of a "Design DoorDash" problem. The author structures the entire discussion around adapting to interviewer follow-up questions.

Practice System Design interview question walkthrough - Corey Cleary

This article explicitly shows how to handle "interviewer follow-up questions" which are designed to test your adaptability.

Please read the following sections, paying close attention to the Interviewer follow-up question and the proposed solution. In the section "Feature - the service must allow the user to track their order status and delivery in real-time," after discussing WebSockets vs. SSE, read the follow-up question about handling disconnects. The proposed solution is a pragmatic fallback to polling. In "Feature - users must be able to search for restaurants," after proposing Elasticsearch, read the interviewer's question about a hybrid approach. The response shows flexibility by suggesting different tools for different use cases. In "Feature - the service must prevent orders from being made before or after a restaurant's opening/closing hours," read the final follow-up question about handling concurrent orders for limited stock. This pushes you to think about race conditions and transactional integrity.

These examples highlight a key skill: making pragmatic trade-offs on the fly. The "right" answer isn't always the most complex one. A fallback to polling for disconnected WebSocket clients is a practical solution that balances user experience with implementation cost.


Learning from Mistakes: When Adaptation Goes Wrong

Adapting doesn't mean blindly accepting a new requirement and bolting on a solution. A poor adaptation can be more revealing than no adaptation at all. Let's analyze a critique of a different mock interview.

Senior Engineer Breaks Down Systems Design Interview

This video critiques a candidate's design, highlighting where his adaptations were flawed and what he should have done differently.

Please review these critical moments: Doubling Down on a Flaw: The candidate proposes a stateful design where each user is tied to a specific VM. The interviewer questions this here. Instead of re-evaluating, the candidate doubles down. The narrator then explains why this is a bad idea, leading to an inefficient and brittle system in this critique. Missing a Critical Adaptation: The narrator points out a major data loss vulnerability in the candidate's design here and suggests a simple but crucial adaptation: swap the order of operations to persist data before processing. A Successful Adaptation: Later, when asked about bottlenecks, the candidate correctly identifies the risk of data loss if a server dies mid-process and adapts his design by adding a cache to persist user history, making the system more resilient in this segment.

The key lesson here is that a new requirement should prompt you to re-examine your core assumptions. Is statefulness really necessary? Is this process robust against failure? A good adaptation strengthens the design's reliability and scalability, while a poor one adds complexity without proportional benefit.


Practice Exercise: Adapting the Instagram Design

Let's apply this to the Instagram design we've seen. Below is a high-level architecture for a photo-sharing app. Its core function is to allow users to upload photos and view a simple, chronologically-ordered feed of photos from people they follow.

A simplified architecture for an Instagram-like service, showing components for uploads, profile management, and feed generation.

New Requirement: Your interviewer says, "This is a good start, but a simple chronological feed isn't engaging enough. We now need to implement a ranked feed based on an algorithm that considers factors like post recency, user engagement (likes), and the user's affinity with the poster. How would you adapt your design?"

Take a moment to think through the 4-step adaptation framework before reading the solution below.


Solution Walkthrough:

  1. Acknowledge and Clarify: "Okay, so we're evolving from a simple chronological feed to an algorithmic, ranked feed. The goal is to increase user engagement by showing more relevant content. This will primarily impact the Feed Generator and how it interacts with its data sources."

  2. Assess the Impact: The current Feed Generator likely performs a simple query against a NoSQL store (e.g., "get the latest 20 posts from users I follow"). A ranked feed is much more computationally intensive. It requires gathering many more posts, collecting signals (likes, timestamps, user relationships), running a scoring model, and then ranking. Doing this in real-time when a user requests their feed (a "fan-out-on-read" approach) will be far too slow.

  3. Propose Options and Trade-offs:

    • Option A (Modify at Read-Time): We could try to optimize the read-time ranking, but it will likely not meet latency requirements for users who follow many active accounts. This is the simplest change but the least scalable.
    • Option B (Pre-computation): A more robust approach is to pre-compute the feeds. When a user posts something, we use a "fan-out-on-write" mechanism to push that post into the feeds of their followers. This shifts the computational load from read-time to write-time.
  4. Recommend and Justify:
    "I recommend we pivot to a pre-computed feed model (Option B), as it ensures a fast, low-latency experience for the user when they open the app. The architecture would change as follows:

    • The Uploader service, after saving the photo to Object Storage, will now also publish a newPost event to a message queue (like Kafka or SQS).
    • We will introduce a new set of worker services, let's call them Feed Fan-out Workers. These workers consume events from the queue.
    • For each newPost event, the worker fetches the list of the poster's followers. For each follower, it inserts the new post's ID into a data structure representing their feed (e.g., a Redis list or a dedicated NoSQL table).
    • The Feed Generator's job now becomes much simpler: it just has to read the pre-computed list of post IDs for a given user and then fetch the full post objects.
    • Addressing a new bottleneck: This creates a 'celebrity problem'. If a user with 20 million followers posts, we'd trigger 20 million writes. To handle this, I'd propose a hybrid model: for users with <10k followers, we use fan-out-on-write. For celebrities, we don't pre-compute. Instead, we merge their recent posts into the user's feed at read-time. This balances the trade-offs between write amplification and read latency."

This detailed adaptation not only solves the immediate problem but also anticipates the next bottleneck (the celebrity problem) and previews concepts from more advanced news feed designs.


Conclusion

You have now completed the foundational module on the system design interview framework. You have learned to navigate the entire process, from understanding the problem to defending your solution under pressure.

Key Takeaways from this Lesson:

  • Embrace Change: View new requirements as opportunities to demonstrate your depth, not as interruptions.
  • Use a Framework: When challenged, fall back on the Acknowledge -> Assess -> Propose -> Justify process to structure your thinking.
  • Re-evaluate Trade-offs: A new constraint is a prompt to revisit your initial decisions. Clearly articulate why a new trade-off is now necessary.
  • Adapt Pragmatically: The best adaptation is often the simplest one that meets the new requirement without introducing excessive complexity.

In our next module, we will begin our first end-to-end case study: "Design a URL Shortener." You will apply the entire framework we have just learned to build a complete system from the ground up.