Sometimes you need to transform API responses for frontend use.
Common transformations:
- Normalizing nested data
- Converting date strings to Date objects
- Mapping field names (snake_case to camelCase)
- Filtering unused fields
Where to transform:
- API layer (recommended): Transform once when fetching
- Components (avoid): Duplicates logic
BFF pattern: Backend For Frontend. A thin server layer that shapes data for your frontend. Useful when you can't change the main API.
Interview tip: Mention data transformation. It shows you've worked with real APIs.