Backend Flashcards

(15 cards)

1
Q

What is an endpoint?

In the context of APIs.

A

A location where an API receives requests for resources on its server - typically URLs.

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

What is a path parameter?

A

Variable components of a URL path which are typically used to identify a specific resource.

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

Which library (+ associated method) allows you to access query parameters given by a user?

A

request.args from the flask library.

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

What does the enabling the optional debug mode do when running an API using Flask?

A

It enables monitoring for changes in the code and automatically reloads the server when changes are detected.

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

You are making an endpoint which takes GET requests - why may you use the .route decorator instead of .get?

A

So that single endpoint can handle multiple HTTP methods if you choose to add functionality later.

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

Features of RESTful APIs: Describe client-server separation.

A

The client and server operate independently. The client is responsible for making requests, the server processes them and sends back responses.

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

Features of RESTful APIs: Describe statelessness.

A

Each request from the client contains all the necessary information - no client-specific data is maintained on the server.

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

What is cacheability - a feature of RESTful APIs?

A

The support for caching, the process of storing copies of frequently accessed data to reduce reponse times.

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

Features of RESTful APIs: Describe uniform interface.

A

The server for a RESTful API should transfer information in a standard format, so it can be interacted with in the same way regardless of device or type of application.

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

Features of RESTful APIs: Describe layered system.

A

Components only engage with layers they directly need to; clients can connect to authorized intermediaries between itself and the server.

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

Why is building things in a consistent way - like using the principles of REST - important?

A

It provides a framework for the structure and maintenance of software programs so they are easier to understand, scale and update.

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

What does ‘mocking’ mean in a testing context?

A

Creating fake objects that mimic the behaviour of real objects to remove impurities - so units of code can be tested without managing external dependencies.

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

Why do we use api.test_client() when testing API programs?

A

It simulates the responses of the real API, allowing a developer to isolate unit tests from external dependencies.
Also helps save money when using a paid API service.

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

What is web scraping?

A

An automated process for extracting data from web pages.

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

Which Python library do you use for web scraping?

A

BeautifulSoup

There are other libraries like Selenium, Scrapy, Playwright too.

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