Search⌘ K
AI Features

Quiz: Design Patterns

Test your knowledge of design patterns.

We'll cover the following...
Match The Answer
Statement
Match With
A

We need to create multiple resources that are very similar but complex to initialize every time.

Singleton pattern

B

We need to create instances of a type that have common and predictable features and functionalities but with slight variations.

Object pool

C

We need to create a resource once and then use it throughout our application.

Prototype pattern

D

We need to control the number of resources of the same nature that we spend on a particular activity.

Factory pattern


Low-level design scenario

Let us walk through a thought exercise similar to what we might encounter while doing the low-level design of a back-end application.
Let us say we want to connect a service to a database. We know our data is stored in MongoDB, and we need to write code to integrate with it and perform CRUD operations.

Setup

1.

What would be the first thing you would set up in this situation? Which design pattern(s) would you use, if any?

Show Answer
Did you find this helpful?
...