The interview process was roughly this: first confirm the boundaries of each handler with the interviewer, and once they were clearly defined, ask the AI to implement it, then ask the AI to write the unit tests.
Build a logger that passes every logged message to a set of handlers. The logger must support four handler types:
- Remove: removes every occurrence of a configured string from the message, then prints the result.
- Truncate: truncates the message to its first N characters, then prints the result.
- Uppercase: converts the whole message to uppercase, then prints the result.
- Store: keeps the message in an internal array without printing anything.
Follow up: search the stored messages. (Use the store's messages from above to perform a search.)
Next follow up (discussion): how would you handle messages that contain punctuation?
Discussion
Loading comments…