Daily iOS
Persistence

Server and local models

A phone screen asked how you design data models on the backend and how you handle them on mobile. If you use the server's response JSON structure as your local database entity as is, what goes wrong when the response format changes later?

How would an interviewer hear this answer? You'll see whether they'd move on, dig in, or say no, and which sentences would trip you up. Your score doesn't change.
See the short answer

The server schema changes for the server's reasons, so using it as your entity turns every field change into a local migration, and storing a nested response as it arrives duplicates the same object in several places and they drift apart.

Share a question