Pinned Tweet
Classic pagination bug: a product search feels instant on the first few pages, then gets slower the deeper it goes. A few hundred pages in, response times stretch into seconds and CPU usage goes up. OFFSET is the culprit, and the fix is a one-line change to the query.
The Happy Path retweeted
A request with a valid token hits an admin-only endpoint, and the user doesn't have the admin role.
A) 401 Unauthorized
B) 403 Forbidden
Which status code should come back?
A request with a valid token hits an admin-only endpoint, and the user doesn't have the admin role.
A) 401 Unauthorized
B) 403 Forbidden
Which status code should come back?
The Happy Path retweeted
SQL quiz.
A table orders with 4 rows: amount is 10, NULL, 20 and 30. What's the output of this query?
SELECT AVG(amount)
FROM orders;
SQL quiz.
A table orders with 4 rows: amount is 10, NULL, 20 and 30. What's the output of this query?
SELECT AVG(amount)
FROM orders;
A. 401 means the server can't tell who is calling: the credentials are missing or can't be verified.
B is 403 Forbidden, C is 404 Not Found, D is 429 Too Many Requests.
HTTP quiz.
What does 401 Unauthorized means?
A) credentials missing or invalid
B) valid credentials, access denied
C) resource not found at this URL
D) rate limit exceeded for client
4
260
HTTP quiz.
What does 401 Unauthorized means?
A) credentials missing or invalid
B) valid credentials, access denied
C) resource not found at this URL
D) rate limit exceeded for client
PATCH is the one that’s not idempotent. RFC 5789 doesn't make it idempotent: a patch that appends an item to a list adds it again on every retry.
GET, PUT and DELETE are idempotent: repeating them leaves the server in the same state.
An idempotent request leaves the server in the same state whether it's sent once or three times.
Three of these HTTP methods are idempotent by definition:
- GET
- DELETE
- PATCH
- PUT
Which one is NOT idempotent?
1
5
338
An idempotent request leaves the server in the same state whether it's sent once or three times.
Three of these HTTP methods are idempotent by definition:
- GET
- DELETE
- PATCH
- PUT
Which one is NOT idempotent?
Sending file uploads through the backend means every byte crosses the server twice: in from the browser, then out to storage.
Presigned S3 URLs avoid that. The backend checks the user's permissions and signs a URL for one file key, and the browser sends the file straight to S3.
A. git revert adds a new commit that undoes the bad one. Everyone's history still matches.
git reset moves main back to an earlier commit. Pushing that takes a force push, and teammates who pulled still have the bad commit in their copies.
A bad commit is already on main, and teammates have pulled it. How do you undo it?
A) git revert
B) git reset
8
405
A bad commit is already on main, and teammates have pulled it. How do you undo it?
A) git revert
B) git reset
List, tuple, set and dict are the four main built-in collections in Python.
Three questions tell them apart: is it ordered, can it be modified, and are duplicates allowed?
Lie.
localhost is a hostname, and the OS looks it up like any other name.
On many systems the lookup also returns ::1, the IPv6 loopback address, and some clients try ::1 first.
A server listening only on 127.0.0.1 refuses those connections.
4
364
DSA Basics: BFS.
BFS (breadth-first search) allows to go through the nodes of a tree level by level.
A queue is the data structure that enables it:
1. Visit a node, starting with the root
2. Add its children to the back of the queue
3. Take the next node from the front
2
258
A SQL query for the customers who spent over 1000 in total, with one keyword missing:
SELECT customer_id, SUM(amount)
FROM orders
GROUP BY customer_id
____ SUM(amount) > 1000
Which keyword goes in the blank?
REST API or RESTful API? The two terms get used interchangeably, and in daily talk that’s fine.Strictly, REST is an architectural style defined by a set of constraints. An API is RESTful when it follows them, while “REST API” often labels any HTTP + JSON service.
4
12
707




















