1. How to Approach a Design Question
1.6 What's the difference between functional and non-functional requirements?
At the architect's desk: "Three bedrooms, a kitchen, a balcony" is a list of rooms: what the house has. "Earthquake-safe, cool in summer, ready in six months" is about how good the house is. Both matter, but they're different lists.
In the interview:
- Functional requirements = what the system does. Features a user could press a button for.
- Non-functional requirements = how well it does it. Qualities like speed, uptime and durability.
The quick test: functional requirements are verbs, non-functional ones are adjectives.
Figure: functional requirements are verbs (what it does). Non-functional requirements are adjectives (how well it does it).
For the URL shortener:
- Functional: shorten a long URL; redirect a short URL to the original.
- Non-functional: fast (a redirect feels instant), available (links keep working when a server dies), durable (a saved link is never lost), scalable (billions of links without a redesign).
Why the non-functional list matters more than beginners think: the verbs tell you what to build, but the adjectives decide how. "Shorten a URL" for 100 users fits on one laptop. "Shorten a URL, always available, for billions of links" needs replication, caching and careful ID generation. The adjectives choose the architecture.
Memory code: "Verbs vs adjectives." Functional = what it does (verbs). Non-functional = how well (adjectives). The adjectives pick the architecture.