Coding 1: LeetCode 210. The follow-ups were all very easy:
- Add a validity check
- Time/space complexity
- Test cases
- Change the output to a nested list
Coding 2: Implement a URL request handler router that needs to support two functions:
- processHandler(String handler): registers a handler, for example /users/delete or /users/{userId}/photo/{photoId}.
- getHandler(String url): takes a real URL, for example /users/123/photo/456, and returns the previously registered handler that matches that URL. Fields like {userId} and {photoId} mean they can match any single URL segment.
Discussion
Loading comments…