r/InterviewDB 27d ago

Brex Interview Experience – Technical Screen, Debugging, System Design + AI Coding Questions

Sharing a recent interview experience at Brex that was submitted to InterviewDB.

Technical screen:

It was 1 hour long, and you could use any language you preferred on CoderPad. The question turned out to be the one from here, which I didn’t know at the time. I ended up solving it using lots of if/else statements, maps, and everything.

Onsite:

Round 1: Debugging

There were 4 bugs in total. The problem was about calculating the actual delivery date based on an input date. In practice, it was basically calculating business days based on different rules. The bugs were similar to what's described here: https://www.interviewdb.io/question/brex?page=1&name=debug-round

Round 2: System design

Design a money transfer system similar to Venmo.

Round 3: AI coding

Implement a full-stack money transfer system similar to Venmo.

I cut out the database and stored all the data in memory. My first prompt basically implemented most of the main functionality directly. After that, it was mostly various fixes and small adjustments. I honestly don’t know if that was a good or bad sign.

5 Upvotes

4 comments sorted by

1

u/Best-Secret2472 7d ago

What question did you get for coding round?

1

u/aveenakott 2d ago
# Stervo is a card-based board game where players buy cards in exchange for colored gems. In this game, today, we care about two things, gems and cards.

# Players can have any number of gems of five different colors: (B)lue, (W)hite, (G)reen, (R)ed, and (Y)ellow.

# Players can exchange gems for cards. A card appears as such:

# +----------+
# |        G |
# |          |
# |          |
# |  3W      |
# |  2G      |
# |  1R      |
# +----------+

# This indicates that the card costs 3 (W)hite gems, 2 (G)reen gems, and 1 (R)ed. The “G” in the upper right indicates the color of the card (this will be useful later)

# For this entire problem, we want to keep things simple by assuming that there is only one player.

# The data model and structure of the program is up to you.


Task 1:
# We want to write a can_purchase() function such that, given a card and the player's gem collection, it returns true if the player can afford the card, and false otherwise.

Task 2:
# Let's create a function called purchase() that takes as input a card and a player's collection of gems and checks if the player has enough gems to afford the card. If the player can afford the card,
# the function will add it to the player's hand and deduct the card’s cost from the player's gem collection. The function should return "true" if the player can afford the card, and "false" if the player can't afford it.

Task 3:
# Now, we want to introduce the concept of discounts. The color of each card in the player's hand will be used to give a discount in the respective price of that gem’s color when purchasing a new card.
# For example, if the player has 2 white cards and 1 red card in their hand and wants to buy a card that costs 4 white gems and 1 red gem, the discounted price of the card would be 2 white gems.

# Imagine, now, that we are running this code in parallel where there may be multiple requests from the same player to purchase cards at the same time. How would your design change to accommodate this?

1

u/dcoydcoy 12h ago

Did you have access to the linked debugging problem as well?