'What are some good ways to tackle generic system design question?

Lately I was going over system design questions in order to test my knowledge and things went pretty smooth as long as the question is well structured, same as in my day job, we first write full specification and then start a design.

With that, some of the questions I've found on the internet that came from interviews were really confusing to me. I've found the following question reported in leetcode:

Design an application that allows users to find new outfits using clothes they already have in their closet

Now I am trying to imagine myself being in such interview, how should I react to such a question? It seems way too generic without even basic specification.

I want to share with you my thoughts on how I would tackle this question and hear your thoughts if I am missing anything.

When I see generic problems without specification, I do what we do in our job and I talk more about the feature. So in this case if a teammate was suggesting this is the application we need to design I would ask him first to show me an example, maybe even a use-case of why it is needed. Then we would build the functional requirements and create a confluence document where we describe exactly what is the problem and show use-cases where we can point a solution. Then we would go and talk about the non functional requirements.

So if I were talking to an interviewer I would try to understand first who this application should serve and how much users should we expect using our application.

Basically solving this problem, leaving non functional requirements aside, I would setup an HTML website where the user can send HTTP request with clothes they have as argument and then in the server side I would use SQL to query new outfits. something like this:

select DISTINCT o.name
from 
    outfits o
    inner join cloths_index i
    on o.cloth_id = r.cloth_id
where i.cloth_id IN ([SOMERANGE]);

where outfits is the table containing all the outfits and clothes_index is a table containing outfit column and cloth column where for each outfit we would specify the required cloth so that we have this matching.

But if the interviewer would tell me that SQL is not enough to fill the non functional requirements because we may need to support a large amount of users simultaneously, then what should I suggest next?

I feel this open question confuses me and I'm not able to arrange my thoughts.



Solution 1:[1]

I personally find it very useful to start an architecture / system design always the same way. That is by asking:

  1. What is the fundamental goal of the system? Why do we need it? What is the top use case?
  2. What are the stakeholders? Who uses it? Who wants it? Who makes decisions? Who provides input?
  3. What is the scope? What is part of the system, what is outside / external systems? What is out of scope?
  4. What are top functional and non-functional requirements?
  5. Are there constraints like team size/skill, languages, regulatory or compliance rules?

This is pretty much the initial chapters of arc42 - a template to document and communicate architectures. Of course this is just the starting point, but in my experience these basic questions served at least me well.

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 spa