Commonwealth Bank Interview Questions

Commonwealth Bank Interview Guides

Click or hover over a slice to explore questions for that topic.
Data Structures & Algorithms
(82)
SQL
(54)
Machine Learning
(46)
Probability
(25)
Business Case
(18)

Commonwealth Bank Interview Questions

Practice for the Commonwealth Bank interview with these recently asked interview questions.

QuestionTopicDifficulty
Data Structures & Algorithms
Hard

Create a function called pool_matching(candidates: list[Candidate]) which accepts a list of candidates and matches pairs of them together based on:

  1. Scheduled availability
  2. Similar interests

Return a list of Itineraries containing the details of the match. Candidates are defined by a class Candidate with the following attributes:

class Candidate:
    def __init__(self, 
                 name: str, 
                 availability: list[datetime], 
                 interests: list[str]):
        self.name = name
        self.availability = availability
        self.interests = interests

On the other hand, itineraries are defined by the following attributes:

class Itinerary:
    def __init__(self, 
                 candidates: list[Candidate], 
		 dates: list[datetime],
		 common_interests: list[str]):
        self.candidates = candidates
        self.dates = dates
        self.common_interests = common_interests

Example:

candidates = []
bob = Candidate(
    "Bob",
    [datetime(2026, 1, 10), datetime(2026, 1, 11)],
    ["rock climbing", "tech", "data science"],
)
joe = Candidate(
    "Joe",
    [datetime(2026, 1, 10), datetime(2026, 4, 9)],
    ["rock climbing", "swimming", "data science"],
)
carolyn = Candidate(
    "Carolyn", 
    [datetime(2026, 1, 11), datetime(2026, 1, 12)], 
    ["data science"]
)
dan = Candidate(
    "Dan", 
    [datetime(2026, 1, 12)], 
    ["rock climbing"]
)

candidates.append(bob)
candidates.append(joe)
candidates.append(carolyn)
candidates.append(dan)
pool_matching(candidates)

Output:

| candidates         | dates          | common_interests                  |
|--------------------|----------------|-----------------------------------|
| ["Bob", "Joe"]     | ["2026-01-10"] | ["rock climbing", "data science"] |
| ["Bob", "Carolyn"] | ["2026-01-11"] | ["data science"]                  |

Note: Two candidates are matched only when they share at least one available date and at least one interest. An itinerary should be created for each unique pair of individuals. If a person (for example, ‘A’) is scheduled to meet with multiple people (such as ‘B’ and ‘C’) on the same day, separate itineraries should be generated: one for the pairing of ‘A’ and ‘B’, and another for ‘A’ and ‘C’.

Behavioral
Medium
Analytics
Medium
Loading pricing options

View all Commonwealth Bank questions

Practice a real interview question

Step-by-step practice

Button AB Test

Work through it one step at a time, with feedback on every wrong turn, then write your full answer.

Start practicing

Discussion & Interview Experiences

?
There are no comments yet. Start the conversation by leaving a comment.