पाठ 3 / 25
Functional and Non-Functional Requirements
Turn a vague prompt into a spec.
Ask, then write it down
Functional requirements are what the system does (create a short link, redirect, show analytics). Non-functional requirements are qualities: scale (users, requests per second), latency targets, availability, consistency needs, durability, security and cost. Ask about read/write ratio, data retention, global users and which features are out of scope. Write the agreed list on the board; it justifies every later decision.
Example: "Design a URL shortener"
Questions and the resulting assumptions.
Q: custom aliases? expiry? analytics? -> custom alias yes, expiry optional, basic click counts
Q: how many new links per day? -> ~10 million
Q: read/write ratio? -> ~100:1 (redirects dominate)
Q: latency target for redirect? -> p99 < 50 ms
Q: availability vs consistency? -> redirects must be highly available;
a new link visible within seconds is fine
Out of scope: user accounts UI, spam detection (mention as follow-up)State assumptions when unsure
If the interviewer says "you decide", pick a sensible number, say it aloud and move on.
त्वरित जाँच: Which is a non-functional requirement?
- Links can expire
- Users can create short links
- Users can set a custom alias
- Redirects must have p99 latency under 50 ms
Answer
Redirects must have p99 latency under 50 ms — Qualities, not features.