Design an In-Memory HTTP API for Auth and Profile Management
Context
Design a minimal, single-node, in-memory HTTP API that supports user registration, authentication, profile retrieval/update, and account deletion. Assume no external database; persistence is lost on restart. Password hashing can be mocked.
Requirements
-
Implement the following endpoints:
-
Register a new user (email + password)
-
Authenticate (login)
-
Retrieve current user profile
-
Update current user profile
-
Delete current user account
-
Provide data models and request/response JSON schemas
-
Include basic validation and error handling conventions
-
Discuss trade-offs and possible extensions (sessions/tokens, password resets, audit logs)
Assumptions
-
Single-process, single-instance server (no clustering)
-
Password hashing is a placeholder function; do not implement real crypto
-
Access control for profile endpoints uses a bearer token returned by login
-
Focus on an MVP suitable for an onsite system design interview