Google interview question

code python architecture of db mapping.