
Decoded Message
On Monday, April 7th, while scrolling through LinkedIn late at night, I came across a message from Data Annotation regarding a data annotating opportunity. Intrigued by the fact that data annotation is a critical step in training AI, I decided to take a look at the application.
The process started with a standard application, followed by a section where I had to identify the best solutions to problems presented in coding or pseudocode. The core of the assessment, however, involved decoding a message hidden within a published Google Doc.
The document contained x and y coordinates paired with specific characters—essentially a set of instructions for a 2D grid. I was excited to see the final decoded message. I initially thought that reading a published Google Doc programmatically would be straightforward; I planned to use Python’s requests library to fetch the response and extract the data.
However, when I received the data, it wasn't the well-formatted JSON or HTML I expected. Instead, I was met with obfuscated JavaScript. I spent some time looking for ways to bypass this, first trying BeautifulSoup to parse the HTML. When I printed the text version of the "soup", it still returned gibberish. I then pivoted to more complex tools, attempting to use an OAuth 2.0 authorization flow. This required setting up credentials in the Google Cloud Platform and registering an application to use curl. After facing multiple "Authorization Denied" errors, I realized I was overcomplicating the task.
I went back to BeautifulSoup for a second look. This time, I ignored the raw text and targeted the <tr> tags specifically. Lo and behold, it worked! I encountered one more hurdle: printing the grid without collapsing the coordinates that didn't have characters. I solved this by initializing the grid with empty spaces before populating it.
Ultimately, what I thought would be a 3-4 hour task took a day and a half. Despite the extra time, I was thrilled to finally see the decoded message. Interestingly, the terminal in Visual Studio Code had a bit of an "optical nuance" that led me to submit "HCMIDEO" instead of the actual message, "HCMIDBO". Regardless, it was a rewarding experience working with ASCII art!
Link to the code.