This is the G-Research coding Assessment.
In starting I have used one library JSON so please install this library in your machine before running. Mostly its a builtin module so it might not produce any errors.
- Run the file ans.py, which will prompt a file path to be inserted. Note: Please add complete file path, and the file should be in .txt format.
- Please check the Final_Output_File.txt, that summarizes all the session data as required.
- I have used .txt files for the sake of simplicity and and final_output_File will be generated in the same directory.
I have used data.txt as a form of testing data.
Step-by-Step intuition:
So, as this is one of my internship project, I completed it within 2 hours but I started on Monday, itself somewhat 3 hours back. I had the strategy already developed in my mind that what would be the exact steps and functions required to complete this challenge. Inorder for optimiztions in the JSON capturing phase I developed a Finite State Machine (Always favourite) to complete the Capturing of JSON embeedings, thereafter I have assumed that for every START session there will be END session. So, the embeddings will be in that format where I have assumed that the length of these embeddings will be even. Moreover, no two Session ID's will have same name.
Thereafter I have written down the comments in ans.py for step-by-step explanation of each function.
Hope, you got a preliminary idea of the project.