Skip to content

Instantly share code, notes, and snippets.

@kelvinewilliams
Last active December 30, 2015 04:10
Show Gist options
  • Save kelvinewilliams/820e3309652c61c7f357 to your computer and use it in GitHub Desktop.
Save kelvinewilliams/820e3309652c61c7f357 to your computer and use it in GitHub Desktop.
Interview Test
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.
@pabitrad
Copy link

I do not have Linux system. Can I do it on WIndows OS?
-Pabitra Dash from Upwork.com

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment