BRAIN CORP Interview Question

Provide code to dispatch two types of messages, given a packet format. Code will be evaluated based upon it's correctness and maintainability. Discuss how you would change the packet and message structures to make communication more robust.

Interview Answer

Anonymous

Mar 12, 2020

I spent more time on it than I probably should have (~8 hours), writing code according to my current job's production code requirements, designed for maintainability and scaling to more message types. Separated configuration data from code and documented all APIs in detail. Wrote a few basic test cases including the given examples as well as creating some code to generate more test cases.

1