Skip to main content
All Questions

Implement an in-memory record store with fetch, TTL and backup and restore.

Unlock detailed company stats for this questionUpgrade

Implement a data storage system that supports basic operations, filtering and point-in-time recovery, in levels. Level 1: SET_OR_INC(key, field, value) updates a string field or increments an integer field; GET(key, field); DELETE(key, field) removes a field, or the whole key if no fields remain. Level 2: FETCH(field, value) scans records and returns matches, formatted as a string like "field1(val1), field2(val2)" and sorted alphabetically by key. Level 3: either TTL on SET (expired records behave as deleted on GET or FETCH) or multi-field filtering by prefix or range. Level 4: BACKUP() captures state and returns a backupId; RESTORE(backupId) reverts instantly. A plain deepCopy may fail the hidden performance tests; versioned maps or copy-on-write work better.

Format · CodeSignal industry coding assessment, scored out of 600.

Community answers

No answers contributed by the community yet.

Related courses

Course

Software Engineering Interview Prep

Land your dream software engineering role at Google, Amazon, Microsoft, Meta, Apple, and other top companies. Learn from mock interviews, frameworks, and advice from senior candidates—practice data structures, algorithms, system design, people management, behavioral interviews, and more.

Course

System Design Interviews

Learn how to answer the latest system design questions across product, infrastructure, and AI domains. Features in-depth video examples, written breakdowns, and helpful reference patterns. Watch senior engineers and managers answer these questions in mock interview videos.