Prototype: RecordStore stores string fields by record key; empty strings are valid. set/get/scan(key,prefix) overwrite, return null when absent, and return fresh name-sorted Field records.

Final: TemporalDatabase methods take nonnegative nondecreasing ts; every valid read or failed conditional advances time, equal times allowed. set(ts,key,field,value,ttl) uses null for no TTL; positive TTL gives visibility [ts,ts+ttl). delete appends absence only for a visible field. compareAndSet writes only on matching visible expected string and replaces lifetime. getAt(ts,key,field,at) requires 0 <= at <= ts and reads already processed history. TTL/lookback validation precedes time changes. scan(ts,key,prefix) returns visible sorted Field records. Invalid calls preserve accepted time/history.

The complete public API is in Exercise.java. All domain classes are public static nested classes of Exercise; construct them as new Exercise.ClassName(...). Do not implement a solution in the test runner. Each instance owns independent state. Unless explicitly allowed, null inputs are outside the domain. Failed operations leave state unchanged; validation happens before mutation.

Drag or use the arrow keys to resize. Home collapses the question; End collapses the editor. Enter or double-click resets the split.
Loading editor…
No results yet.

Complete the starter code, then run the checks.
Results and errors will appear here.

Java runs on this device with CheerpJ 4.3.