This chrome extension helps you to solve leetcode questions on your own by providing insightful questions according to the socratic teaching philosophy
project made for devfolio's "GenAI Exchange Hackathon by Google"
Download the package socratic-code.zip
from Releases
Extract it
# USE unzip
unzip socratic-code.zip
# OR USING 7z
7z x socratic-code.zip
Open chrome, go to chrome://extensions/
and enable developer mode
Click on Load unpacked and navigate to the build
folder you just extracted
This project aims to create a reliable teaching assistant for Data Structures and Algorithms questions. The project is further narrowed down to create an assistant for Leetcode, which is the most popular website for interview and DSA prep. It is deployed as a Chrome Browser Extension.
This teaching assistant will never tell the user the answer completely, as it is based on the Socratic teaching method, in which the teacher asks insightful questions to guide the pupil towards the answer instead of telling them the answer.
problem name
->problem description
It was quite hard to get the input data of the leetcode website. This is because chrome runs the content scripts of the extension in a secluded environment which doesnot have the the properties of the window
element in the webpage.
The code editor input that leetcode uses is called monaco
, and we can easily get the input data in correct formatting by entering window.monaco.editor.getModels()[0].getValue()
in the leetcode website. But this was not the case for the extension, as it doesnot have the properties of window
element.
Although we can get the properties of this window
element by using the "MAIN"
WORLD
in the content script, it is then not possible to send this data to the outside environment due to security reasons.
This was solved by identifying the correct elements and selecting them with document.querySelector()
Due to my inexperience with Continuous Integration, it took me quite a lot to set it up.
This includes:
pnpm
and releasing it with github Releasesghcr
registry, or Github's docker registryThe following images represesnt the working of the extension