Data persistence interview questions
Scenario-style prompts with sample answer outlines. Focus is on how you would design and reason in real codebases.
- 01Choosing the right storage strategyYou're building a feature with structured data, user settings, and large media files. How do you decide what goes in Core Data/SwiftData vs files vs Keychain?
- 02Designing a scalable data modelYou're designing a local database for a feature with relationships (such as users, posts, and comments). How do you model it to balance performance, flexibility, and future changes?
- 03Handling migrations in productionYou need to evolve your data model after shipping. How do you handle migrations safely without data loss or breaking existing users?
- 04Offline support and syncingYour app needs to work offline and sync with a backend. How do you design your persistence layer to handle conflicts and ensure consistency?
- 05Performance with large datasetsYour database grows to thousands of records and performance degrades. How do you diagnose and optimize reads/writes?
- 06Normalized vs denormalizedIn simple terms, what does normalized mean for a database? What does denormalized mean? Give a couple of real-world examples.
- 07SwiftData, concurrency, and data racesHow do you avoid data races when reading and writing SwiftData from Swift concurrency (async/await, actors, background work)?



