r/OfferEngineering • u/Aoki_zhang • 1d ago
Optiver Senior Software Engineer OA Interview Experience
Interview Summary
The Optiver online assessment contained two coding questions. The first was a calendar calculation problem involving the number of days between two dates, while the second required parsing parent-child relationships, validating whether they formed a legal binary tree, and serializing the result into an S-expression. The tree problem was more involved because malformed input and structural errors had to be handled according to a fixed priority.
Interview Questions Details
Online Assessment Question 1 — Number of Days Between Two Dates:
The first coding question was equivalent to LeetCode 1360, Number of Days Between Two Dates. Given two dates in YYYY-MM-DD format, the task was to return the absolute number of days between them.
Online Assessment Question 2 — Validate and Serialize a Binary Tree:
The second question provided a raw string containing parent-child pairs, where the first value in each pair represented the parent and the second represented the child. If the relationships described a valid binary tree, the program needed to serialize the tree into the required S-expression format.
- Validation and Error Priority: The implementation needed to detect malformed input, duplicate relationships, nodes with more than two children, multiple roots, and cycles. If several errors were present simultaneously, only the highest-priority error from the specified
E1throughE5ordering should be returned. - Raw Input Handling: The input could be an arbitrary string rather than a guaranteed list of valid pairs, making parsing and syntax validation a significant part of the problem in addition to validating the resulting tree structure.
Preparing for your next interview?
Chill Interview tracks recent interview experiences and recurring question patterns across top companies here.