Technical Screen
Money Distribution Problem:
Given an integer total and a map of recipients to the integer amounts owed to them, write a function that distributes the funds as evenly as possible.
- No recipient can receive more than the amount owed.
- The distribution must be as even as possible.
- All amounts are integers.
Sample inputs and outputs:
Input: {'ryan': 10, 'stephanie': 10, 'quentin': 10, 'upeka': 10}, total=40
Output: {'ryan': 10, 'stephanie': 10, 'quentin': 10, 'upeka': 10}
Input: {'ryan': 10, 'stephanie': 10, 'quentin': 10, 'upeka': 10}, total=20
Output: {'ryan': 5, 'stephanie': 5, 'quentin': 5, 'upeka': 5}
Input: {'ryan': 2, 'stephanie': 10, 'quentin': 10, 'upeka': 10}, total=21
Output: {'ryan': 2, 'stephanie': 6, 'quentin': 7, 'upeka': 6}
Input: {'ryan': 2, 'stephanie': 10, 'quentin': 10, 'upeka': 10}, total=22
Output: {'ryan': 2, 'stephanie': 7, 'quentin': 7, 'upeka': 6}
Onsite: Technical Screen
Log Parsing:
Go through all the logs and return a list of objects, each containing:
- Response URL.
- Number of calls.
- Mean response time.
- Median response time.
Requirements:
- There are only six possible URL-matching patterns.
- Use regular expressions to extract the relevant fields from each log line and match the corresponding URL pattern.
- Maintain a map from URL pattern to a list of response times. Update it while reading the logs, then calculate the statistics above.
Onsite: Pair Programming
Federal Income Tax Return Calculator:
CoderPad initially contained only a main function. I had to write the complete tax-calculation logic from scratch, using the official IRS federal income tax rates and brackets as reference material.
- This was mainly an object-oriented design problem. Create a TaxBuckets class to represent tax brackets.
- Use BigDecimal for all numbers to calculate precisely.
- Given total income for a tax year, iterate through TaxBuckets, calculate the tax for each bracket, and sum it.
Follow-ups:
- How would the design support different filing statuses, such as single or married, and different tax years?
- The solution was a TaxFilingYear interface and a FilingStatus enum. Instantiate the interface to represent a particular filing year, provide a method that accepts filing status and W-2 data, and return the calculated tax.
Onsite: System Design
Scheduling Service:
Design a service to help managers schedule employees' shifts for the following week.
- The interviewer cared a lot about the data model and API design. Scalability was not required.
- The system was small, around 50 restaurants with 50 employees each.
- A black-box algorithm could return the employees available for a given shift.
- Prioritize consistency over availability.
Onsite: Hiring Manager
Behavioral interview:
- Why Gusto?
- How do you handle ambiguous work? How do you normally use AI at work, and how do you use AI tools to improve efficiency?
- Give an example of finding a bug or problem in another engineering team's work and taking the initiative to fix it.
- How do you handle disagreements and persuade others?
- Describe a time a customer gave you feedback.
- Explain how you resolve disagreements with stakeholders.
- How have you affected the whole engineering organization?
- Explain how you helped a team member who had stopped making progress grow.
Discussion
Loading comments…