Interview problem for database engineers