The Brex technical screen involved implementing a card-purchase system inspired by the board game Splendor. The problem progressed from basic affordability checks and purchases to applying card-based discounts, followed by a concurrency discussion around handling multiple simultaneous purchase requests for the same player.
Interview Details
Coding — Card Purchase System
Players own gems in five colors:
Blue
White
Green
Red
Yellow
Blue
White
Green
Red
Yellow
Each card has:
A purchase cost expressed in gems
A color associated with the card
The exact data model and class structure were left up to the candidate.
Part 1 — Check Whether a Card Can Be Purchased
Implement: can_purchase(card, player_gems). Given a card and the player's current gem inventory, determine whether the player has enough gems to cover the card's cost. Return true if the purchase is possible and false otherwise.
**Part
Unlock Full Details
Create a free account to unlock this interview experience report.