DevPrep

All topics › Databases & storage

Realm

Middle PRO

Essence

Realm is an object (NoSQL) mobile database with its own storage engine (not on top of SQLite). Models are classes inheriting from Object with @Persisted properties; objects are live: they're read lazily straight from the file (zero-copy via mmap), and when the database changes they update automatically and emit notifications. Queries go through lazily evaluated Results and where { $0.done == false }.

The rest of this answer, with code and interview follow-ups, is in the DevPrep app.

Read the full answer in DevPrep

Practice this before your interview

DevPrep turns these answers into one-minute challenges: what does this code print, find the bug, mock interviews. One challenge a day.

Get DevPrep on the App Store