No description
Find a file
2024-05-24 22:31:07 +05:30
README.md docs: more details 2024-05-24 22:31:07 +05:30

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 can implement this functionality using either Node.js or 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 either Node.js or Go to handle HTTP requests.
  • 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 the multicast bit is cleared. (The multicast bit is the least significant bit of the first byte.)
  • 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 host your solution and share the link with us. (Please ensure the link is accessible and the application is running.)

Evaluation Criteria

  • Code quality and organization.
  • Correctness of the implementation.
  • Handling of edge cases and error conditions.
  • Documentation and comments.
  • Test coverage and quality.

Signing Bonus

For a signing bonus of 33377 INR, implement the MAC address generation algorithm in WebAssembly (WASM) using a system language like Rust or C++ or Go. Integrate the WASM module with the Node.js server to generate the MAC addresses.