API and optimization Flashcards

(14 cards)

1
Q

Definition of an API in software engineering

A

A functional abstraction layer and contract for software communication

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

Primary benefit of Connection Pooling

A

Reduces overhead by reusing existing TCP connections

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

Asynchronous I/O benefit

A

Allows a single thread to handle multiple concurrent I/O-bound tasks

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

Data Parallelism vs Task Parallelism

A

Data parallelism splits data across tasks

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

Difference between Over-fetching and Under-fetching

A

Over-fetching is receiving unneeded data

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

Purpose of an API Gateway

A

Centralized entry point for routing, rate limiting, and security

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

The ‘Circuit Breaker’ pattern

A

Prevents a system from trying to execute an operation that’s likely to fail

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

What is ‘Chatty’ API behavior

A

Making many small requests instead of a few bulk/batched requests

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

Benefit of using Gzip or Brotli in APIs

A

Reduces payload size to improve transfer speed

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

Role of ETag in API caching

A

A unique identifier for a resource version used to validate if a cache is still fresh

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

Rate Limiting vs Throttling

A

Rate limiting sets a hard cap

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

Idempotency in APIs

A

The property where multiple identical requests have the same effect as a single request

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

Optimizing ‘N+1’ query problem

A

Using batching or eager loading to fetch related data in one call

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

Horizontal vs Vertical scaling for APIs

A

Horizontal adds more instances

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