CoreWeave | SDE 2 | Interivew
Summary
I participated in a 60-minute CoderPad interview at CoreWeave for an SDE 2 role, which focused on building a CLI tool to reboot remote servers via API, encompassing basic functionality, robust error handling, concurrent operations, and a verbal discussion on unit testing.
Full Experience
Format: 60 min CoderPad, Python, 4 parts
Scenario: Build a CLI tool for field technicians to reboot remote servers via API.
Setup they provide:
- Backend service running on http://localhost:3000
- Endpoint: /reboot (POST)
- Request: {"serial": "<server_id>"}
- Response: {"result": "success/failure", "reason": "..."}
Part 1: Basic reboot client
- Send POST request to reboot endpoint
- Parse response, print result
Part 2: Error handling
- Handle timeouts, connection errors, invalid JSON
- Print meaningful output on failures
Part 3: Concurrent fleet reboot
- Reboot multiple servers in parallel
- They noted async + requests is a common trap (blocks event loop)
- ThreadPoolExecutor + requests works cleanly
Part 4: Unit testing (verbal)
- Explain how you'd test this
- Mocking requests, testing error cases, etc.
Good luck to whoever uses this. The ThreadPoolExecutor pattern is clutch for part 3
Interview Questions (4)
Build Basic Server Reboot Client
Implement a basic Python CLI client to send POST requests to a backend service at http://localhost:3000/reboot. The request payload is {"serial": "<server_id>"} and the response is {"result": "success/failure", "reason": "..."}. The client should parse the response and print the result.
Implement Error Handling for Server Reboot Client
Enhance the existing server reboot CLI client to robustly handle various failure scenarios. This includes implementing error handling for network issues such as timeouts and connection errors, as well as gracefully managing cases of invalid JSON responses from the backend service. The client should provide meaningful output upon encountering any failure.
Implement Concurrent Fleet Reboot
Extend the CLI client to support rebooting multiple servers concurrently. It was noted that using async with the requests library can lead to event loop blocking, and a cleaner approach involves utilizing ThreadPoolExecutor with requests for parallel operations.
Discuss Unit Testing for Server Reboot Client
Verbally explain how you would approach unit testing the implemented CLI tool. The discussion should cover strategies for mocking external dependencies, particularly the requests library's interactions with the backend service, and how to effectively test various error cases identified in the error handling part.