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
- Specific: Clear and unambiguous
- Testable: Can be verified through testing
- Complete: Covers all expected behaviors
- Consistent: No contradictory requirements
- 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
- Vague requirements: "System should be fast" → Specify exact numbers
- Missing edge cases: What happens with invalid URLs?
- No priority: Not all features are equal
- 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:
- User creates short URL
- User redirects via short URL
- User views click analytics
- User deletes expired URLs
For Chat System:
- User sends message
- User receives real-time messages
- User creates group chat
- 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
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 & reliabilityHow 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 decompositionAnalyze 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 degradationQuiz
1. What do functional requirements describe?
2. Which characteristic makes a functional requirement good?
3. In the MoSCoW prioritization method, what does 'W' stand for?
4. What is the relationship between use cases and system components?
Flashcards
Question
What are functional requirements?
Click to reveal answer
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?
Click to reveal answer
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?
Click to reveal answer
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?
Click to reveal answer
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?
Click to reveal answer
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:
- Specific - Clear and unambiguous
- Testable - Can be verified
- Complete - Covers all behaviors
- Consistent - No contradictions
- 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:
- Identify actors
- List goals
- Define system responses
- Identify data needed
- Design components