Stripe Interview Question

Given a database, records are HashMaps, implement min by key, min/max by key, use comparator to implement min/max by key, use comparator to implement min/max by several keys