Design House interview question

Manipulate a python dictionary and optimize it based on changing requirements