Brex·Software Engineer·Technical Phone Screen
- You have a card trading game where each card has a gem cost broken down by color and is itself associated with a color. Players hold a gem inventory and a hand of owned cards. Given two existing functions for checking affordability and executing a purchase, update both to account for a new rule: each card a player already owns reduces the cost of its associated color by 1 (stacking, floored at 0) for all future purchases.
“The setup took me a minute to internalize.”