Implement agent voting with average and sorting | Atlassian Interview Question