Skip to content
intermediatePhase 43 · System Design Foundations

Functional Requirements

Define what the system must do from the user's perspective.

45m
0 problems
Topic Progress0%

What are Functional Requirements

Functional requirements describe what the system should do. They define the specific behaviors, features, and functions of the system.

Simple Definition

Functional Requirements = WHAT the system does
Non-Functional Requirements = HOW WELL the system does it

Examples

For a URL shortener:

  • The system shall generate a short URL from a long URL
  • The system shall redirect short URLs to original URLs
  • The system shall allow users to specify custom aliases
  • The system shall expire URLs after a configurable period

Characteristics of Good Functional Requirements

  1. Specific: Clear and unambiguous
  2. Testable: Can be verified through testing
  3. Complete: Covers all expected behaviors
  4. Consistent: No contradictory requirements
  5. Traceable: Links to business needs

Where Functional Requirements Come From

Business Needs
├── Stakeholder interviews
├── User stories
├── Market research
├── Competitor analysis
└── Regulatory requirements
         ↓
Functional Requirements
├── Feature specifications
├── Use cases
├── User flows
└── API contracts

Functional Requirements vs User Stories

Format Example
FR "The system shall allow users to search products by name"
User Story "As a shopper, I want to search products so I can find what I need"

Both describe the same feature, but FRs are more formal and precise.

Defining Features

Good system design starts with clearly defined features. Here's how to approach feature definition.

Feature Decomposition

System: Social Media Platform
│
├── User Management
│   ├── Registration
│   ├── Authentication
│   ├── Profile Management
│   └── Privacy Settings
│
├── Content
│   ├── Create Post
│   ├── Edit/Delete Post
│   ├── Like/React
│   └── Comment
│
├── Feed
│   ├── Home Feed
│   ├── Trending
│   └── Search
│
└── Messaging
    ├── Direct Messages
    ├── Group Chat
    └── Notifications

Prioritizing Features

Use MoSCoW method:

Priority Description Example
Must Have Core functionality User registration, posting
Should Have Important but not critical Notifications, search
Could Have Nice to have Custom themes, advanced analytics
Won't Have Out of scope for now Video calls, marketplace

Feature Specification Template

Feature: URL Shortening

Description:
Generate a unique short URL (6-8 characters) from a long URL.

Inputs:
- Long URL (required)
- Custom alias (optional)
- Expiration time (optional)

Outputs:
- Short URL
- QR code (optional)

Rules:
- Short URL must be unique
- Custom alias must not conflict with existing URLs
- Default expiration: never
- Maximum URL length: 2048 characters

Common Mistakes in Feature Definition

  1. Vague requirements: "System should be fast" → Specify exact numbers
  2. Missing edge cases: What happens with invalid URLs?
  3. No priority: Not all features are equal
  4. Implicit assumptions: Document everything explicitly

Use Cases

Use cases describe how users interact with the system to achieve specific goals.

Use Case Diagram

[User] ──→ (Login)
[User] ──→ (Create Account)
[User] ──→ (Post Content)
[User] ──→ (View Feed)
[Admin] ──→ (Moderate Content)
[Admin] ──→ (View Analytics)

Use Case Template

Use Case: Shorten URL

Actor: Registered User
Precondition: User is logged in

Main Flow:
1. User enters long URL
2. System validates URL format
3. System generates unique short code
4. System stores mapping in database
5. System returns short URL to user

Alternative Flows:
2a. Invalid URL format → Show error message
3a. Custom alias provided → Check availability
3a1. Alias available → Use custom alias
3a2. Alias taken → Suggest alternatives

Postcondition: Short URL is created and accessible

Mapping Use Cases to Components

Use Case Components Needed
Shorten URL API, URL Generator, Database
Redirect URL API, Cache, Database
View Analytics API, Analytics Service, Database
Delete URL API, Authorization, Database

Use Cases for Interview Problems

For URL Shortener:

  1. User creates short URL
  2. User redirects via short URL
  3. User views click analytics
  4. User deletes expired URLs

For Chat System:

  1. User sends message
  2. User receives real-time messages
  3. User creates group chat
  4. User searches message history

From Use Cases to System Design

Use Cases → Components → Interfaces → Data Models → Architecture

1. Identify actors (users, services)
2. List their goals
3. Define system responses
4. Identify data needed
5. Design components to support each use case

Practice Problems

0/3solved
Design Functional Requirements System

Design a scalable Functional Requirements system. Cover high-level architecture, data model, and API design.

Solution
// Complete system design:
// - Functional + Non-functional requirements
// - Capacity estimation
// - Data model (SQL/NoSQL choice)
// - API endpoints
// - Component architecture
// - Scaling strategy
// - Monitoring & reliability
Functional Requirements Scaling

How would you scale Functional Requirements to handle 10x the current load? Identify bottlenecks and solutions.

Solution
// Scaling approach:
// 1. Load balancing
// 2. Database sharding/replication
// 3. Cache layer (Redis)
// 4. CDN for static assets
// 5. Async processing (queues)
// 6. Microservices decomposition
Functional Requirements Failure Modes

Analyze potential failure modes for Functional Requirements and design mitigation strategies.

Solution
// Failure mitigation:
// 1. Redundancy (multi-AZ)
// 2. Circuit breakers
// 3. Retry with backoff
// 4. Dead letter queues
// 5. Health checks
// 6. Graceful degradation

Quiz

1. What do functional requirements describe?

Question 1 options

2. Which characteristic makes a functional requirement good?

Question 2 options

3. In the MoSCoW prioritization method, what does 'W' stand for?

Question 3 options

4. What is the relationship between use cases and system components?

Question 4 options

Flashcards

Question

What are functional requirements?

Answer

Functional requirements describe WHAT the system should do - its specific behaviors, features, and functions. They define the expected inputs, outputs, and behaviors.

Question

What are the 5 characteristics of good functional requirements?

Answer

Specific, Testable, Complete, Consistent, and Traceable. Each requirement should be clear, verifiable, cover all cases, not contradict others, and link to business needs.

Question

What is the MoSCoW method?

Answer

A prioritization technique: Must have, Should have, Could have, Won't have (this time). It helps prioritize features by importance.

Question

How do use cases help in system design?

Answer

Use cases describe user interactions with the system. They help identify required components, data models, and interfaces needed to support each user goal.

Question

What is Functional Requirements?

Answer

Functional Requirements is a key concept in system design.

Revision Notes

Key Takeaways

  • 1.Functional requirements define WHAT the system should do
  • 2.Good requirements are specific, testable, and complete
  • 3.Use MoSCoW to prioritize features by importance
  • 4.Use cases help identify required system components
  • 5.Always document assumptions and edge cases

Interview Tips

  • Start by clarifying which features are must-haves vs nice-to-haves
  • Write requirements that are testable - you should be able to verify them
  • Use concrete examples when defining features

Cheat Sheet

Functional Requirements - Cheat Sheet

Definition:
WHAT the system does (behaviors, features, functions)

5 Characteristics:

  1. Specific - Clear and unambiguous
  2. Testable - Can be verified
  3. Complete - Covers all behaviors
  4. Consistent - No contradictions
  5. Traceable - Links to business needs

MoSCoW Prioritization:

Priority Description
Must Core functionality
Should Important but not critical
Could Nice to have
Won't Out of scope

Use Case Flow:

  1. Identify actors
  2. List goals
  3. Define system responses
  4. Identify data needed
  5. Design components