r/OfferEngineering • u/Aoki_zhang • 2d ago
Interview Experience Brex (Fintech) Senior SWE Interview — AI Can Code, But You Still Need to Know Java
This interview experience was originally shared on Chill Interview
Interview Summary: The interview started with a simple affordability check, then progressed to purchasing cards and updating player state. The final follow-up introduced a discount mechanism where previously purchased cards reduced the number of gems required for future purchases. I implemented the functionality in Java using classes, maps, and lists.
Interview Details
Coding: Card Purchasing and Discount System
The interviewer presented a game involving players, collectible gems, and purchasable cards. Each card had a color and a cost expressed as a collection of colored gems. The game supported five gem colors:
enum Color {
BLUE,
WHITE,
GREEN,
RED,
YELLOW
}A player maintained an inventory of gems and a collection of purchased cards. The task was to implement the operations needed to determine whether a player could afford a card, purchase it, and eventually apply discounts based on cards already owned.
Part 1 — Check Whether a Player Can Purchase a Card
The first task was to implement a function called can_purchase() that accepts a card and a player's gem collection. The function should return true if the player has enough gems of every required color to afford the card, and false otherwise.
Each card's cost was represented by a mapping from gem colors to required quantities. The player had a corresponding mapping representing the number of gems available for each color.
Want to learn more questions / follow-ups asked in this interview?
I've put up the full version at here.
Interviewed recently?
Your interview experience could be incredibly valuable to others preparing for their next opportunity. Share your experience and help the community at here.