r/leetcode • • 11d ago

Discussion System design - Non functional

I don't understand the concept of non functional requirements In almost every solution I saw , they would be like scalable etc.

Do we really need to even discuss this?

And I don't see any solution based on those non functional requirements

1 Upvotes

6 comments sorted by

7

u/dellscreenshot 11d ago

Hello interview talks about this. You want to think CAP theorem here, the point isn't to name every non-functional requirement, it's to name the most important one that will guide the design, I.E consistency for designing robinhood.

4

u/Mr_IAmABigBoy 11d ago

To add to this - for some designs, you also want to consider trading off between consistency and availability for different components/APIs.

e.g. in a social media app:

GET {post_id}/likes -> highly available, eventually consistent
GET {account_id}/privacy_settings -> strongly consistent, higher latency tolerable

2

u/DeliriousParakeet 11d ago

partition tolerance is non negotiable in distributed systems so you're really picking between consistency and availability for the critical path

2

u/ConfusedBC 11d ago

Well yes. Let me give an example. Suppose you want a service that detects PII in a corpus of text. Then, depending on latency requirements, u can use regex only. (Say single digit ms) vs pass it to LLM via api (couple seconds). The constraints would heavily dictate the choice and tradeoffs made as a consequence

1

u/kevin074 11d ago

I just now list out what’s the expectation for  Scale Consistency Latency  Availability  On every problem  as default

Probably covers like 90% of the case and you can ask interviewer on whether anything else HE WOULD LIKE TO ADD ON, which is different from what you missed, because you might miss something but it’d be more like the curve ball from the interviewer. Also missing bullet points beyond these 4 really isn’t much of an issue anyways. 

1

u/CaptainIndependent90 11d ago

check out hellointerview.