@@ -0,0 +1,40 @@
- Your application should accept and validate a 7 or 10 digit phone number. - no formatting is mentioned
- Assuming a standard alpha-numeric telephone keypad please generate a list of all possible combinations of alpha-numeric phone numbers from the input phone number. Display the total count at the beginning. -- assuming
0and1will remain same as they doesn't have any corresponding letter - Implement paging for the output with each page getting it's data from the server. - most tricky part as the application doesn't involve any database operation but in the frontend we needed to have pagination.
- Provide unit tests for your backend implementation. - will do
For example: If the input number is 240 386 6106 then the output is
Total number of combinations:
240 386 610M
240 386 610N
240 386 610O
….
Page links: 1, 2, 3…
- Spring Boot REST API used for backend
- logback used for logging
- Swagger documentation
- All possible combinations generated but couldn't make it work on the pagination part
- Used spring cache to reduce re-processing but got stuck on the total number of combinations
- Frontend using Angular and Angular Material
- Tried to use oboe for async fetching of data - couldn't able to do it in the way I wanted
- Tried using prime table to cache the data locally once received - not good design as it takes time to fetch
I could've used a database to store all the combinations once generated to create the pagination and total count but doesn't seem like a good design to me.
Slightly modified - https://leetcode.com/problems/letter-combinations-of-a-phone-number/
For further reference, please consider the following sections:
- Official Apache Maven documentation
- Spring Boot Maven Plugin Reference Guide
- Create an OCI image
- Spring Boot Actuator
The following guides illustrate how to use some features concretely: