Last active
December 30, 2015 04:10
-
-
Save kelvinewilliams/820e3309652c61c7f357 to your computer and use it in GitHub Desktop.
Interview Test
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Create a socket client that will create a query packet (see below) and send to the server, then wait for the response upon receiving the response parse it and print to stdout. | |
THIS MUST RUN ON LINUX! The Dialed Digits and responses are ASCII. | |
Query Packet: | |
[Size][DialedDigits] | |
- Size: 4 bytes, Little Endian, Number of bytes of the Dialed Digits. | |
- Dialed Digits: Ten digit NANP telephone number. | |
- RegEx checks would be nice [2-9][0-9]{2}[2-9][0-9]{2}[0-9]{4} | |
Response Packet | |
[Size][Delimited Response] | |
- Size: 4 bytes, Little Endian, Size of the response. | |
- Response: Pipe (|) delimited response of OCN (4 digits) and LRN (10 digits). | |
- Some responses will not have an LRN. | |
- If the size is 0 then the the number was likely not a valid number. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I do not have Linux system. Can I do it on WIndows OS?
-Pabitra Dash from Upwork.com