Senior Backend Engineer Interview Questions

2,034 senior backend engineer interview questions shared by candidates

In elections that use the ballot box system for voting, each voter writes the name of a candidate on a ballot and places it in the ballot box. The candidate with the highest number of votes wins the election. If two or more candidates have the same number of votes, then the tied candidates' names are ordered alphabetically and the last name in the alphabetical order wins. For example, votes are in the names ['Joe', 'Mary', 'Mary', 'Joe']. Each candidate received two votes, but Mary is alphabetically later than Joe, so she wins. Complete the function electionWinner in the editor below. The function must return a string denoting the name of the winning candidate. electionWinner has the following parameter(s): votes[votes[0],...votes[n-1]]: an array of strings representing the names of the candidates as voted by the ith voter.
avatar

Senior Backend Engineer

Interviewed at Boost Insurance

4.5
Mar 5, 2019

In elections that use the ballot box system for voting, each voter writes the name of a candidate on a ballot and places it in the ballot box. The candidate with the highest number of votes wins the election. If two or more candidates have the same number of votes, then the tied candidates' names are ordered alphabetically and the last name in the alphabetical order wins. For example, votes are in the names ['Joe', 'Mary', 'Mary', 'Joe']. Each candidate received two votes, but Mary is alphabetically later than Joe, so she wins. Complete the function electionWinner in the editor below. The function must return a string denoting the name of the winning candidate. electionWinner has the following parameter(s): votes[votes[0],...votes[n-1]]: an array of strings representing the names of the candidates as voted by the ith voter.

Viewing 361 - 370 interview questions

Glassdoor has 2,034 interview questions and reports from Senior backend engineer interviews. Prepare for your interview. Get hired. Love your job.