Implement an in-memory record store with fetch, TTL and backup and restore.
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.


