Bird
Raised Fist0
LLDsystem_design~25 mins

Requirements and use cases in LLD - System Design Exercise

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
Design: Requirements and Use Cases Analysis
Focus on gathering and analyzing requirements and use cases for a new system. Out of scope are detailed system architecture and implementation.
Functional Requirements
FR1: Identify and document functional requirements clearly
FR2: Capture non-functional requirements such as performance, scalability, and availability
FR3: Define user roles and their interactions with the system
FR4: Create use cases that describe how users achieve goals with the system
FR5: Ensure requirements are testable and measurable
Non-Functional Requirements
NFR1: Requirements must be realistic and achievable within project scope
NFR2: Use cases should be simple and understandable by non-technical stakeholders
NFR3: Requirements must support scalability to handle up to 10,000 concurrent users
NFR4: Latency targets for key operations should be under 200ms
NFR5: Availability target is 99.9% uptime
Think Before You Design
Questions to Ask
❓ Question 1
❓ Question 2
❓ Question 3
❓ Question 4
❓ Question 5
Key Components
User personas and roles
Functional requirement lists
Non-functional requirement definitions
Use case diagrams or narratives
Requirement traceability matrix
Design Patterns
User story mapping
Use case modeling
Requirement prioritization (MoSCoW)
Acceptance criteria definition
Stakeholder interviews and workshops
Reference Architecture
  +-------------------+
  |   Stakeholders    |
  +---------+---------+
            |
            v
  +-------------------+
  | Requirements Team |
  +---------+---------+
            |
            v
  +-------------------+
  | Use Case Analysis |
  +---------+---------+
            |
            v
  +-------------------+
  | Requirement Docs  |
  +-------------------+
Components
Stakeholders
Interviews, Workshops
Provide input on needs and goals
Requirements Team
Requirement Management Tools (e.g., Jira, Confluence)
Gather, document, and validate requirements
Use Case Analysis
Use Case Diagrams, User Stories
Define user interactions and system behavior
Requirement Documents
Text Documents, Spreadsheets
Store and communicate requirements and use cases
Request Flow
1. Stakeholders provide input on needs and goals
2. Requirements team collects and documents functional and non-functional requirements
3. Use case analysts create use cases describing user interactions
4. Requirements and use cases are reviewed and validated with stakeholders
5. Final documents are stored and used for system design and development
Database Schema
Entities: - Stakeholder(id, name, role, contact_info) - Requirement(id, type [functional/non-functional], description, priority, status) - UseCase(id, title, description, actor_id, preconditions, postconditions) Relationships: - Stakeholder to Requirement: 1:N (a stakeholder can provide many requirements) - UseCase to Stakeholder: N:1 (each use case involves one primary actor/stakeholder)
Scaling Discussion
Bottlenecks
Difficulty managing large numbers of requirements and use cases as system grows
Ensuring all stakeholder inputs are captured and conflicts resolved
Maintaining traceability between requirements and use cases
Keeping documentation up to date with changing requirements
Solutions
Use specialized requirement management tools with filtering and tagging
Establish clear communication channels and regular review meetings
Implement traceability matrices linking requirements to use cases and tests
Adopt agile practices for continuous requirement refinement and validation
Interview Tips
Time: Spend 10 minutes understanding the problem and clarifying requirements, 15 minutes discussing use case creation and documentation, 10 minutes on challenges and scaling, and 10 minutes on summarizing and answering questions.
Importance of clear, testable requirements
Role of use cases in understanding user interactions
Balancing functional and non-functional requirements
Handling conflicting stakeholder needs
Maintaining documentation and traceability

Practice

(1/5)
1. What is the main purpose of requirements in system design?
easy
A. To write the system's source code
B. To describe how users interact with the system
C. To design the user interface layout
D. To specify what the system must do

Solution

  1. Step 1: Understand the definition of requirements

    Requirements define the functions and features the system must provide.
  2. Step 2: Differentiate from use cases

    Use cases describe user interactions, not the system's core functions.
  3. Final Answer:

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

    Requirements = system functions [OK]
Hint: Requirements = what system must do, not how users act [OK]
Common Mistakes:
  • Confusing requirements with use cases
  • Thinking requirements include UI design
  • Assuming requirements are code instructions
2. Which of the following best describes a use case in system design?
easy
A. A scenario showing user interaction with the system
B. A code module for user authentication
C. A diagram of system architecture
D. A detailed list of system features

Solution

  1. Step 1: Define use case

    A use case is a story or scenario describing how a user uses the system.
  2. Step 2: Eliminate unrelated options

    System features list, architecture diagrams, and code modules are not use cases.
  3. Final Answer:

    A scenario showing user interaction with the system -> Option A
  4. Quick Check:

    Use case = user scenario [OK]
Hint: Use case = user story or interaction example [OK]
Common Mistakes:
  • Mixing use cases with system features
  • Confusing use cases with technical diagrams
  • Thinking use cases are code components
3. Given a system that allows users to upload photos and comment, which of the following is a valid use case?
medium
A. System stores photos in a database
B. User uploads a photo and receives confirmation message
C. Database schema includes photo metadata fields
D. Server runs a nightly backup process

Solution

  1. Step 1: Identify user actions in options

    User uploads a photo and receives confirmation message describes a user action and system response, fitting a use case.
  2. Step 2: Recognize system internals vs user interaction

    Options A, C, and D describe internal system details, not user interactions.
  3. Final Answer:

    User uploads a photo and receives confirmation message -> Option B
  4. Quick Check:

    User action + system response = use case [OK]
Hint: Use case = user action plus system reaction [OK]
Common Mistakes:
  • Choosing system internal processes as use cases
  • Ignoring the user perspective
  • Confusing data storage details with use cases
4. A system design document lists: "Users can reset passwords via email." Which of the following is a problem in this use case description?
medium
A. It includes too much technical detail about email servers
B. It lacks the steps describing how users reset passwords
C. It incorrectly describes a system requirement instead of a use case
D. It is missing the database schema for password storage

Solution

  1. Step 1: Analyze the use case description

    The statement is a high-level feature but lacks detailed user steps.
  2. Step 2: Understand use case completeness

    Use cases should describe user actions step-by-step, not just state features.
  3. Final Answer:

    It incorrectly describes a system requirement instead of a use case -> Option C
  4. Quick Check:

    Use case needs detailed user steps [OK]
Hint: Use cases must show user steps, not just features [OK]
Common Mistakes:
  • Confusing requirements with use cases
  • Expecting technical details in use cases
  • Ignoring the need for step-by-step user actions
5. You are designing a ride-sharing app. Which of the following best combines requirements and use cases for the feature "Request a ride"?
hard
A. Requirement: The system must match riders with drivers within 2 minutes. Use case: Rider opens app, enters destination, and confirms ride request.
B. Requirement: The app must have a blue color theme. Use case: Driver updates profile picture.
C. Requirement: The system stores all ride data for 1 year. Use case: Admin views system logs.
D. Requirement: The app sends promotional emails weekly. Use case: Rider rates driver after ride.

Solution

  1. Step 1: Identify relevant requirement for ride request

    Matching riders with drivers quickly is a key system requirement for this feature.
  2. Step 2: Identify matching use case

    The use case describes the rider's interaction to request a ride step-by-step.
  3. Step 3: Verify other options

    Other options mix unrelated requirements or use cases not tied to "Request a ride" feature.
  4. Final Answer:

    Requirement: The system must match riders with drivers within 2 minutes. Use case: Rider opens app, enters destination, and confirms ride request. -> Option A
  5. Quick Check:

    Requirement + user steps = correct combination [OK]
Hint: Match system needs with user steps for correct design [OK]
Common Mistakes:
  • Mixing unrelated requirements and use cases
  • Ignoring user interaction details
  • Choosing cosmetic or admin features instead of core ones