Bird
Raised Fist0
LLDsystem_design~7 mins

Requirements analysis in LLD - System Design Guide

Choose your learning style10 modes available

Start learning this pattern below

Jump into concepts and practice - no test required

or
Recommended
Test this pattern10 questions across easy, medium, and hard to know if this pattern is strong
Problem Statement
Projects often fail because the final system does not meet user needs or business goals. This happens when requirements are unclear, incomplete, or misunderstood, leading to costly rework and delays.
Solution
Requirements analysis gathers, clarifies, and organizes what users and stakeholders need from the system. It breaks down goals into clear, testable requirements that guide design and development, ensuring the final product matches expectations.
Architecture
┌───────────────┐      ┌───────────────┐      ┌───────────────┐
│ Stakeholders  │─────▶│ Requirements  │─────▶│ System Design │
│ (Users, Biz)  │      │ Analysis Team │      │ & Development │
└───────────────┘      └───────────────┘      └───────────────┘
       ▲                      │                      │
       │                      ▼                      ▼
       └───────────── Feedback Loop ────────────────┘

This diagram shows how stakeholders provide input to the requirements analysis team, which produces clear requirements that guide system design and development, with feedback loops to refine needs.

Trade-offs
✓ Pros
Ensures the system meets actual user and business needs.
Reduces costly changes during development by clarifying requirements early.
Improves communication between stakeholders and developers.
Provides a clear foundation for testing and validation.
✗ Cons
Can be time-consuming and delay project start if overdone.
May require skilled analysts to avoid misinterpretation.
Incomplete or changing requirements still pose risks despite analysis.
Use when building new systems or major features where user needs are complex or unclear, especially for projects with multiple stakeholders or long timelines.
Avoid heavy upfront analysis for small, simple projects or prototypes where speed is more important than completeness.
Real World Examples
Amazon
Amazon uses detailed requirements analysis to align new features with customer expectations and business goals, reducing costly redesigns in their e-commerce platform.
Uber
Uber performs requirements analysis to understand diverse user needs across cities, ensuring their app supports local regulations and rider-driver interactions.
LinkedIn
LinkedIn applies requirements analysis to design new social networking features that meet professional users' needs and privacy concerns.
Code Example
The before code stores requirements as unstructured data, making it hard to manage or prioritize. The after code defines Requirement objects with clear fields and a RequirementsAnalysis class to organize and prioritize them, improving clarity and maintainability.
LLD
### Before: No clear structure for requirements
class Project:
    def __init__(self):
        self.details = {}

project = Project()
project.details['feature'] = 'fast login'

### After: Structured requirements analysis using classes
class Requirement:
    def __init__(self, id, description, priority):
        self.id = id
        self.description = description
        self.priority = priority

class RequirementsAnalysis:
    def __init__(self):
        self.requirements = []
    def add_requirement(self, req):
        self.requirements.append(req)
    def list_requirements(self):
        priority_order = {'High': 1, 'Medium': 2, 'Low': 3}
        return sorted(self.requirements, key=lambda r: priority_order.get(r.priority, 4))

analysis = RequirementsAnalysis()
analysis.add_requirement(Requirement(1, 'User can login within 2 seconds', 'High'))
analysis.add_requirement(Requirement(2, 'Support multi-factor authentication', 'Medium'))

for req in analysis.list_requirements():
    print(f"Req {req.id}: {req.description} (Priority: {req.priority})")
OutputSuccess
Alternatives
Agile User Stories
Focuses on lightweight, iterative requirement gathering through user stories rather than upfront detailed analysis.
Use when: Choose when requirements are expected to evolve rapidly and early delivery of working software is prioritized.
Prototyping
Uses early mockups or prototypes to gather feedback instead of formal requirement documents.
Use when: Choose when visualizing ideas quickly helps clarify needs and reduce misunderstandings.
Summary
Requirements analysis prevents project failure by clarifying user and business needs early.
It organizes goals into clear, testable requirements that guide design and development.
Effective analysis improves communication, reduces rework, and aligns the final system with expectations.

Practice

(1/5)
1. What is the main purpose of requirements analysis in system design?
easy
A. To deploy the system to users
B. To write the system code
C. To test the system performance
D. To define what the system must do

Solution

  1. Step 1: Understand the role of requirements analysis

    Requirements analysis focuses on understanding and defining the system's needs and functions.
  2. Step 2: Differentiate from other phases

    Writing code, testing, and deployment happen after requirements are clear.
  3. Final Answer:

    To define what the system must do -> Option D
  4. Quick Check:

    Requirements analysis = Define system needs [OK]
Hint: Requirements analysis = What system must do [OK]
Common Mistakes:
  • Confusing requirements analysis with coding
  • Thinking testing is part of requirements
  • Mixing deployment with requirements gathering
2. Which of the following is a correct step in requirements analysis?
easy
A. Writing deployment scripts
B. Compiling source code
C. Gathering user needs
D. Running system tests

Solution

  1. Step 1: Identify key activities in requirements analysis

    Gathering user needs is essential to understand what the system should do.
  2. Step 2: Exclude unrelated activities

    Deployment scripts, compiling code, and testing happen after requirements are set.
  3. Final Answer:

    Gathering user needs -> Option C
  4. Quick Check:

    Requirements analysis = Gather needs [OK]
Hint: Gather user needs first in requirements analysis [OK]
Common Mistakes:
  • Mixing coding or deployment with requirements
  • Ignoring user input during analysis
  • Confusing testing with requirements gathering
3. Given these requirements:
- System must handle 1000 users simultaneously
- Data must be encrypted
- Users can reset passwords

Which requirement type is "Data must be encrypted"?
medium
A. Non-functional requirement
B. Functional requirement
C. Business requirement
D. User interface requirement

Solution

  1. Step 1: Classify the requirement "Data must be encrypted"

    This describes a quality or constraint on the system, not a specific function.
  2. Step 2: Understand requirement types

    Functional requirements describe actions; non-functional describe qualities like security.
  3. Final Answer:

    Non-functional requirement -> Option A
  4. Quick Check:

    Encryption = Non-functional requirement [OK]
Hint: Security needs are non-functional requirements [OK]
Common Mistakes:
  • Confusing security with functional features
  • Mixing business goals with technical details
  • Assuming all requirements are functional
4. A requirements document states: "Users must login with username and password." Later, it says: "Users can login using email and password." What is the main issue here?
medium
A. Performance bottleneck
B. Ambiguous requirements
C. Security vulnerability
D. Scalability problem

Solution

  1. Step 1: Identify conflicting statements

    The document gives two different login methods without clarifying which is correct.
  2. Step 2: Understand impact of ambiguity

    Ambiguous requirements confuse developers and cause design errors.
  3. Final Answer:

    Ambiguous requirements -> Option B
  4. Quick Check:

    Conflicting login info = Ambiguity [OK]
Hint: Conflicting info means ambiguous requirements [OK]
Common Mistakes:
  • Assuming security or performance issues without evidence
  • Ignoring requirement conflicts
  • Thinking scalability relates to login methods
5. You are designing a messaging app. Which of these is the best way to gather requirements to ensure scalability and user satisfaction?
hard
A. Interview users, analyze competitors, and document clear functional and non-functional needs
B. Start coding immediately based on your assumptions
C. Only focus on UI design without backend planning
D. Ignore user feedback and add features later

Solution

  1. Step 1: Identify best practices in requirements gathering

    Interviewing users and analyzing competitors helps understand real needs and market standards.
  2. Step 2: Emphasize clear documentation of all requirements

    Clear functional and non-functional requirements guide scalable and user-friendly design.
  3. Final Answer:

    Interview users, analyze competitors, and document clear functional and non-functional needs -> Option A
  4. Quick Check:

    User research + clear docs = good requirements [OK]
Hint: Gather user input and document clearly before coding [OK]
Common Mistakes:
  • Skipping user research
  • Starting development without clear requirements
  • Ignoring backend needs for scalability