FastPrepCompetition Winner and Runner-Up (Forward Deployed Engineer)
Problems/Competition Winner and Runner-Up (Forward Deployed Engineer)

Competition Winner and Runner-Up (Forward Deployed Engineer)

Boston Consulting Group logoBoston Consulting Group● EasyFULLTIMEOA

Updated Nov 2026

QuestionFunctionExamplesConstraints

Problem statement

Source note: Reported in a Boston Consulting Group online assessment for an AI Forward Deployed Engineer role. It was one of four coding tasks. Teams get points for wins and draws, and you return the winner and the team in second place. A tie on points goes to the team with the better goal difference.

The report gives the full rules, but its example is cut off and it shows no input limits. Here, the examples are our own, there are 2 to 100 teams, and every count is from 0 to 1000.

Our version is about 90% the same as the reported question.

Given four arrays wins, draws, scored and conceded that describe the teams in a competition, return the indices of the winning team and the team in second place as [winner, secondPlace].

Team i won wins[i] matches, tied draws[i] matches, scored scored[i] goals and conceded conceded[i] goals, for each i from 0 to wins.length - 1. A won match gives a team 3 points, a tied match gives 1 point, and a lost match gives 0 points.

The team with the most points ranks first. When teams have the same number of points, the one with the higher goal difference ranks higher. The goal difference of team i is scored[i] - conceded[i].

Note: a solution with time complexity no worse than O(wins.length^3) is fast enough.

Function

solution(wins: int[], draws: int[], scored: int[], conceded: int[]) → int[]

Examples

Example 1

wins = [2,1,3]draws = [1,4,0]scored = [5,6,4]conceded = [3,2,6]return = [2,1]

The teams have 7, 7 and 9 points. Team 2 has the most points, so it wins. Teams 0 and 1 tie on 7 points. Team 1 has the higher goal difference, 4 against 2, so it is second.

Example 2

wins = [2,2,1]draws = [1,1,2]scored = [3,8,5]conceded = [4,2,5]return = [1,0]

Teams 0 and 1 both have 7 points. Team 1 has a goal difference of 6 and team 0 has -1, so team 1 wins and team 0 is second. Team 2 has a better goal difference than team 0, but only 5 points.

Example 3

wins = [3,0,2]draws = [0,10,1]scored = [9,1,4]conceded = [0,1,3]return = [1,0]

Team 1 never won a match, but its 10 draws give it 10 points. That is more than team 0, which has 9 points from 3 wins. Team 2 has 7 points.

Constraints

  • 2 <= wins.length <= 100
  • draws.length == scored.length == conceded.length == wins.length
  • 0 <= wins[i], draws[i], scored[i], conceded[i] <= 1000
  • Exactly one team ranks first and exactly one team ranks second. No other team has both the same points and the same goal difference as the winner, and the same holds for the team in second place.

More Boston Consulting Group interview questions

  • Build Taxi Driver Performance FeaturesOA · Seen Nov 2026
  • Summarize Taxi Drivers and RidesOA · Seen Nov 2026
  • Count Belt Sections With K Fruit Pairs (Forward Deployed Engineer)OA · Seen Nov 2026
  • Robot Stops Left or Right (Forward Deployed Engineer)OA · Seen Nov 2026
  • Split a Matrix Into Four Partitions by Average (Forward Deployed Engineer)OA · Seen Nov 2026
  • Predict Taxi Driver ClassesOA · Seen Oct 2026
  • Prepare Taxi Driver Classification DataOA · Seen Oct 2026
  • Even-Position MonotonicityOA · Seen Jul 2026
  • Shortest Distances From an Adjacency MatrixPHONE SCREEN · Seen Sep 2026

Similar questions at other companies

  • Count User Mentions in Chat MessagesRamp · OARamp interview questions
  • Catch Fish with Reusable BaitsSusquehanna International Group (SIG) · OASusquehanna International Group (SIG) interview questions
  • Word Frequency Counts in Alphabetical OrderAbridge · OAAbridge interview questions
  • Rank Football TeamsCapital One · OACapital One interview questions
  • Maximum Apples That Fit in a BoxVirtu Financial · OAVirtu Financial interview questions
  • Rank Football TeamsPersona · OAPersona interview questions
  • Meandering ArrayVerisk · OA
  • Minimum Magic Stones After MergesElevenLabs · OAElevenLabs interview questions
  • Find Top Two TeamsAutodesk · OAAutodesk interview questions
  • Total Server DowntimeVisa · OAVisa interview questions
All Boston Consulting Group interview questionsSee Boston Consulting Group hiring insights
Saved
class Solution {
    public int[] solution(int[] wins, int[] draws, int[] scored, int[] conceded) {
        // Write your code here.
    }
}
Checking account…