README.md |
Full-Stack Interview
Objective
Develop a web application where users can input a 128-bit hexadecimal string (e.g., "11010030303847423000afbe9a30292f"). The application should extract the last 64 bits of this string and use them to generate two MAC addresses. You should do this project in both Node.js and Go.
Problem Description
Using the last 64 bits of the provided 128-bit CID, you are required to implement a function that generates a primary MAC address and a secondary MAC address (which is the primary address incremented by one, managing byte overflow).
Detailed Requirements
Frontend
- Implement an HTML5 page with a text input field for the 128-bit CID.
- Include a submit button that triggers the MAC address generation.
- Add some basic styling to the webpage.
Back-End
- Set up a server using bare minimum amount of dependencies, if possible only the stdlib in Go and
http
module in Node.js. - The server should extract the last 64 bits from the input string and use this data to generate the MAC addresses.
- The server should return the generated MAC addresses to the front-end.
Server Operation
- Extract the last 64 bits of the CID input.
- Generate the primary MAC address by converting the 64-bit integer to a 48-bit MAC address.
- Use bitwise operations to generate the initial MAC address ensuring that the address is unicast.
- Implement an algorithm to increment the MAC address (for the second one), carefully managing overflow from the least significant byte upwards.
Integration
- The server receives the generated MAC addresses and sends them back to the front-end.
- Display the generated MAC addresses on the web page after processing.
Considerations
- Ensure your code handles the hexadecimal input validation.
- Outline test cases for both the front-end input validation and the back-end logic.
Submission
You can submit your solution as a ZIP file containing the project files (mail it to hayzam@difuse.io). Include a README file with instructions on how to run the application and any additional information you consider relevant.
** OR **
You can put it on a git repository and give read access to hayzam.
Evaluation Criteria
- Code quality and organization.
- Correctness of the implementation.
- Handling of edge cases and error conditions.
- Documentation and comments.
- Test coverage and quality.