← BNSF Interview Insights

BNSF·Software Engineer·Take-home Assignment·Intermediate

IntermediatePrefer not to say
May 2026

Summary

Got a take-home style coding problem for a Software Engineer role at BNSF. It was a REST API build from scratch, nothing crazy on the surface, but the plain-text body parsing requirement ended up being the part that actually separated people who read carefully from those who didn't.

Questions Asked (1)

Q1

Build a REST API with full CRUD operations where the request body uses plain text instead of JSON, and you have to parse it yourself. Cover validation, error handling, idempotency for PUT and DELETE, and how you'd disable automatic body parsing in your framework.

API & IntegrationsSystem DesignTechnical Trade-offs
Author's notes

The plain-text parsing part is what got me.

Create a free account to read the full note

AI HintsAI Generated

Suggested Approach

Start by outlining the API design and the need to disable automatic body parsing, then walk through the implementation of CRUD operations with manual text parsing, validation, and error handling. Emphasize idempotency for PUT and DELETE, and discuss trade-offs and testing strategies.

Pro tip: Mention that idempotency for PUT and DELETE can be ensured by designing operations to be idempotent by nature (e.g., PUT replaces the entire resource, DELETE removes it) and by using idempotency keys for extra safety in distributed systems.

1. Disable automatic body parsing

Explain how to disable built-in body parsers in your chosen framework (e.g., Express: remove express.json() middleware; Flask: access raw data via request.data; Spring: use @RequestBody with String).

2. Implement manual text parsing

Describe how to read the raw request body as a string and parse it according to your custom format (e.g., key-value pairs separated by newlines, CSV, or custom delimiters).

3. Add validation and error handling

Detail validation rules for parsed data (e.g., required fields, type checks) and how to return appropriate HTTP status codes (400 for bad request, 404 for not found, 409 for conflict) with descriptive error messages.

4. Ensure idempotency for PUT and DELETE

Explain that PUT should replace the resource entirely (idempotent by design) and DELETE should remove it; use idempotency keys or conditional requests (ETags) to handle retries safely.

5. Discuss trade-offs and testing

Acknowledge trade-offs of plain text vs JSON (e.g., no schema, harder parsing) and outline testing strategies (unit tests for parsing, integration tests for endpoints).

Key Points to Mention

  • Framework-specific methods to disable body parsing (e.g., Express without express.json(), Flask's request.data, Spring's @RequestBody String).
  • Custom parsing logic: splitting by delimiters, handling edge cases like empty lines or malformed input.
  • Validation: checking required fields, data types, and returning 400 with clear error messages.
  • Idempotency: PUT and DELETE are idempotent by HTTP spec; use idempotency keys for retries.
  • Error handling: consistent error response format, logging, and appropriate status codes.
  • Trade-offs: plain text lacks structure and schema validation, but may be required for legacy systems or specific clients.

AI-generated suggestions, not part of the candidate's original notes. May be inaccurate — verify before relying on them.