Daily iOS
iOS system design

Feature skeleton (DI, offline, experiments)

Sketch a single "save bookmark" feature as a Swift code skeleton. Instead of a whiteboard, work at the level of type and protocol signatures, and focus on how you inject dependencies to keep it testable.

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

Put a local store and a remote API behind a BookmarkRepository protocol, pass dependencies through initializer injection, and plug in InMemoryBookmarkStore and FakeBookmarkAPI in tests. Experiments read a variant from an ExperimentClient protocol and branch in a view factory, logging exposure at the same spot.

Share a question