Handle two teams duplicating work | Google Interview Question