backend developement Flashcards

(12 cards)

1
Q

Explain why backend is considered more than “just a server.” Use Osisi to illustrate what could go wrong without a solid backend.

A

Backend is the logic, data, and infrastructure that powers functionality. Without it, apps suffer from security holes, data inconsistencies, poor performance, and bad developer experience. In Osisi, a weak backend could mean family data leaks, duplicate relatives, or failed real-time sync between members.

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

List the three pillars of backend development and explain how each applies to Osisi.

A

Data Management – storing family trees, members, and relationships.

Business Logic – enforcing rules (e.g., no one can be their own parent).

Security & Authentication – verifying users before granting access to sensitive family data.

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

In Osisi, one user owns many families, and one family has many members. How would you design this schema to avoid duplication and ensure efficient queries?

A

Normalization: Store each family member once, reference them in relationships.

Relationships & Indexes: Use foreign keys (family_id) and indexes for fast queries.

Validation: Enforce constraints (valid email, max name length).

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

APIs are called the “contract” between frontend and backend. What makes a good API in Osisi?

A

Clear Endpoints: e.g., createFamily(), getFamilyMembers().

Defined Input Parameters: e.g., createFamily(name, owner_id, is_public).

Consistent Return Values: e.g., getFamilyMembers returns array of member objects.

Error Handling: Return meaningful messages when input is invalid.

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

Give two examples of business logic rules in Osisi and explain why they are critical.

A

Data Integrity Rule: A person cannot be their own parent → prevents corrupted family trees.

Cascading Operation: Deleting a member removes their relationships → ensures consistency.

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

Differentiate authentication and authorization in Osisi. Provide examples of roles.

A

Authentication: Verifying identity (login with email/password).

Authorization: Determining permissions.

Owner: full CRUD.

Editor: add/edit members.

Viewer: read-only.

Limited: restricted view.

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

Validation happens at multiple levels. Apply each type to Osisi.

A

Type Validation: Ensure age is a number.

Format Validation: Email must match valid format.

Business Rules Validation: No duplicate family names.

Existence Validation: Family must exist before adding members.

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

How would you optimize queries in Osisi when retrieving members of a large family tree?

A

Use indexes on family_id.

Apply selective queries (fetch only needed fields).

Implement pagination (load members in chunks).

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

Osisi suddenly grows to 1 million users. What backend strategies ensure scalability?

A

Caching: Store frequently accessed family data in memory.

Database Optimization: Proper indexes and query design.

Async Operations: Offload long-running tasks (e.g., matching relatives).

Rate Limiting: Prevent abuse of APIs.

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

Provide examples of four error types in Osisi and how backend should respond.

A

Validation Error: “Family name must be 2–100 characters.”

Authorization Error: “You don’t have permission to delete this family.”

Server Error: “Something went wrong. Please try again later.”

Not Found Error: “Family not found or has been deleted.”

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

Differentiate unit, integration, and edge case testing in Osisi.

A

Unit Test: Test createFamilyMember() validates name length.

Integration Test: Add member → create relationship → query descendants.

Edge Case Test: Handle circular relationships or empty families.

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

Imagine you are the backend architect for Osisi. Write a short design proposal covering:

Data modeling principles

API design

Business logic rules

Authentication/authorization strategy

Scalability considerations

A

Normalize entities (users, families, members, relationships).

APIs with clear endpoints, parameters, return values.

Business logic: enforce integrity, cascade deletes, workflows for collaboration.

Auth: role-based access (owner, editor, viewer, limited).

Scalability: caching, async operations, rate limiting.

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