Design House Interview Question

Manipulate a python dictionary and optimize it based on changing requirements