System Design Flashcards

1
Q

Define: relational database. Give an example.

A
  • Database built around tables.
  • They often have keys that point to other values in other tables.
  • MySQL is an example
  • example implementation: set of tables for a blog: posts, comments, hashtags each have their own table, all linked via some key like ID
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

Define: non-relational database Give an example.

A
  • does not use a table
  • all data linked in one hierarchy
  • NoSQL is an example, Firebase Store is an example
  • example implementation: blog object, that has posts, comments, and hashtags within it
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

What type of database uses tables, rows, and keys?

A

Relational db

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

Give an example of a relational db

A

MySQL

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

Give an example of a non-relational db

A

NoSQL

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

You’re given a prompt to design some app, what questions do you ask understand the problem statement?

A
  • what are we being asked to design?
  • who is the user and how will they use this system?
  • which parts of the system are we expected to design? ie only the core UX? mobile vs web?
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

Give an example of how you would narrow down the scope of a prompt to system design an app such as netflix

A

We could look at the purchasing UX, or the core viewer UX, or the media producer UX. Let’s start with core viewer UX. What features within the coreUX do we wanna focus on? So maybe we can start from the content-detail screen, as well was the viewing experience, the post-viewing exerperience UX

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

is this an example of relational or non relational db? why?

https://imgur.com/XjVAe2V

A

relational bc there are tables and they are linked by some key

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

is this an example of relational or non relational db? why?

https://imgur.com/tKpEeyu

A

Non relational bc there are no tables and bc there is a hierarchy of data

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

Define concurrency

A

Executing multiple tasks at the same time but not necessarily simultaneously

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

What are message queues used for?

A
  • makes it possible for applications to communicate and perform work asynchronously
  • example, if posting a tweet, the tweet could be instantly posted to your timeline, but it could take some time before your tweet is actually delivered to all of your followers.
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q

Give an example of what a message queue could be used for

A

For example, if posting a tweet, the tweet could be instantly posted to your timeline, but it could take some time before your tweet is actually delivered to all of your followers.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
13
Q

Give an example of a message queue tool

A

Redis (can also do other things)

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
14
Q

Define: queue. Give an example.

A

A line of things waiting to be handled, such as a messaging queue that holds a list of messages to deliver asynchronously.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
15
Q

What are some problems with concurrency?

A
  • race conditions

- deadlocks

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
16
Q

When should you use a relational db?

A

When you need to store predictable, structured data with a relational use-case, such as a social network

17
Q

When should you use a non-relational database?

A

When you have flexible, dynamic, changing data storage requirements.