Interviewed for Software Engineer II, Growth at Brex based in New York City. Below is an outline of my process:
Typical chit-chat with recruiter and asking about my past experience and why Brex. Ask the recruiter for tips on the process so that you know how to stand out and succeed
Implement a TaskScheduler system in an iterative way.
Milestone 1: Add Task
Milestone 2: Introduce pre-requsite task
Extend your Task Scheduler to support adding tasks while specifying prerequisites
Milestone 3: Completion plan
Given an added task, identify a valid sequence of tasks to complete prior to finishing the given task
# scheduler = TaskScheduler()
# coffee_task = Task("Brew some coffee")
# print(f"coffee task: {coffee_task}")
# scheduler.add_task(coffee_task)
# next_task = scheduler.get_next_task() # Should be coffee_task
# print(f"next task: {next_task}")
# scheduler.complete_task(next_task)
# print(f"completed next task: {next_task}")
# scheduler = TaskScheduler()
# coffee_task = Task("Brew some coffee")
# scheduler.add_task(coffee_task)
# toast_task = Task("Make a toast")
# scheduler.add_task(toast_task)
# brainstorm_task = Task("Brainstorm project ideas", [coffee_task, toast_task])
# scheduler.add_task(brainstorm_task)
# print(scheduler.get_all_tasks())
# next_task = scheduler.get_next_task() # Should be coffee_task or toast_task
# print(f"first task: {next_task}")
# scheduler.complete_task(next_task)
# print(f"first task update: {next_task}")
# next_task = scheduler.get_next_task() # Should be coffee_task or toast_task
# print(f"second task: {next_task}")
# print(f"brainstorm task state: {brainstorm_task}")
# scheduler.complete_task(next_task)
# print(f"second task update: {next_task}")
# next_task = scheduler.get_next_task() # Should be brainstorm_task
# print(f"third task: {next_task}")
# scheduler.complete_task(next_task)
# print(f"third task update: {next_task}")
scheduler = TaskScheduler()
yoga_task = Task("Do morning yoga")
scheduler.add_task(yoga_task)
coffee_task = Task("Brew some coffee", [yoga_task])
scheduler.add_task(coffee_task)
toast_task = Task("Make a toast", [yoga_task])
scheduler.add_task(toast_task)
brainstorm_task = Task("Brainstorm project ideas", [coffee_task, toast_task])
scheduler.add_task(brainstorm_task)
# Should be [yoga_task, coffee_task, toast_task, brainstorm_task] or [yoga_task, toast_task, coffee_task, brainstorm_task]
plan = scheduler.get_completion_plan_for(brainstorm_task)
print(f"completion plan: {plan}")I was able to solve in full and interviewer was very chill
You are given a transactions API that lets you fetch a paginated series of transaction data. Your goal is to use this API to perform the following computations. Some clarifying questions I asked:
You can use your language and client of choice to retrieve the data. For example:
curl --request GET \
--url https://platform.brexapis.com/interview/v1/transactions \
--header 'Accept: application/json'
Here’s a sample of the output:
{
"next_cursor":"bGltaXQ9MjAmb2Zmc2V0PTE",
"data":[
{
"id":"ptx_1234",
"source_type":"CARD",
"status":"POSTED",
"amount": {
"amount": 33314,
"currency": "usd"
},
"balance":{
"...": "..."
},
"description":"Uber",
"initiated_at":"2019-09-01T00:00:00Z",
"posted_at":"2019-09-03T00:00:00Z",
"statement_id":"st_123",
"method":{
"type":"CREDIT_CARD",
"credit_card": {
"id":"card_1234",
"network":"VISA",
"last_four":"7890",
"first_six":"123456",
"cardholder_name":"First Last"
}
},
"card_transaction_details":{
"type":"PURCHASE",
"purchase":{
"raw_descriptor":"PAYPAL *UBER",
"mcc_code":"145"
}
}
},
{
"amount": {
"amount": 33314,
"currency": "usd"
},
"balance":{
"...": "..."
},
"cash_transaction_details": {
"payment": {
"bai2_code": null,
"counterparty": {
"name": "test sender"
}
},
"type": "PAYMENT"
},
"description": "test sender",
"id": "sdtxns_ck687clcr00938hrw7xspnqcj",
"initiated_at": "2019-10-08T20:17:48Z",
"method": {
"ach": {},
"type": "ACH"
},
"posted_at": "2019-10-08T20:17:49Z",
"source_type": "CASH",
"statement_id": "ststmts_ck62lkrcf0002012ckev8iw4a",
"status": "POSTED"
}
]
}Part 1: How many transactions?
Should be relatively straightforward. No special filtering here! Just get the target number of 179 (given to you in the problem)
Part 2: Peak Card Spend
Identify the month, year with the highest total card spend. Interviewer was ok with me giving a dict mapping from month/year --> total card spend based on a clarifying question I asked RE the use case
Part 3: Recurring Transactions
In Brex, we want to detect recurring transactions as part of our forecasting models on what future spend for a company could look like.
Identify the list of merchants that either have a recurring weekly card transaction (every 7 days) or a recurring monthly transaction (same day of the month)? NOTE that we only care about card transactions with type PURCHASE
HINT: Try to figure out how to get the merchants with recurring weekly card transaction? Once you have that, how can you get recurring monthly
I was able to solve Parts 1 and 2 flawlessly. Part 3, I solved half of it (ie: recurring weekly), but with 5 more minutes, I could adapt my solution for recurring monthly. Despite solving 2.5/3, interviewer still moved me forward b/c communication and only feedback was "increase velocity"
This round was really fun in my opinion. You are debugging a holiday calculator application:
Context
You have an application that takes in a date (Y-m-d format) along with a num_days (in business days) parameter and your goal is to calculate estimated delivery date. You will be working with the year of 2020.
Think of it like "expected delivery date for amazon order"
The pieces are:
NOTE: The estimator skips over holidays, weekends b/c those DO NOT count as business day! You can also assume the calendar itself is working
You have 5 unit tests that are failing. Your goal is to get them to pass. The bugfixes are small 1-2 line changes. DO NOT do any big refactor or alter the unit test in any way! The interviewer gave me a strong yes rating here because of these behaviors:
Bugs were things like typos, minor logical errors in if condition, incorrect parsing for certain edge cases, etc. Was able to get all 5 unit tests to pass in the nick of time!
Done on google drawings. Your goal is to design a system where you had to support points accumulation and redemption functionality when a consumer makes transactions on Brex card (think like credit card points). There is an existing transaction authorization service given to you and you can consume the transaction data via API request or event stream
This part went okay in my opinion and I leveraged the interviewer a lot for collaboration
Typical Hiring Manager round for Growth team. Be prepared to talk about why Brex, a project you're most proud of, critical feedback you received, disagreement, etc. typical behavioral interview questions
I completed all the rounds and fingers crossed for an offer