Skip to content

About

Basic chrome extension using the sm-2 algorithm for spaced repetition of leetcode problems; doing problems aren't enough, being able to go back and try again is an important part of the learning process.

Resources

Stars

2 stars

Watchers

0 watching

Forks

Repository files navigation

Neetcode/Leetcode Spaced Repetition

A modern Chrome Extension (Manifest V3) designed to optimize your coding interview preparation by bringing Anki-style spaced repetition directly to Neetcode.io and Leetcode.com.

Instead of manually tracking which problems you need to review and when, this extension automatically detects when you successfully solve a problem on either platform and schedules it for review using the proven SuperMemo-2 (SM-2) algorithm.

Key Features

  • Automated Detection: Injects lightweight content scripts that use MutationObserver to silently detect when you pass all test cases on NeetCode or LeetCode, automatically adding the problem to your review queue.
  • Platform-Aware Deep Linking: Saves problem links dynamically according to the platform where you solved it (NeetCode or LeetCode), providing one-click access to review problems in the popup.
  • SM-2 Algorithm Integration: Implements the SuperMemo-2 spaced repetition algorithm. Rate your difficulty (Again, Hard, Good, Easy) and let the math determine your optimal review interval.
  • Cross-Device Syncing: Built on chrome.storage.sync. To respect Chrome's strict 100KB sync quota, the extension uses a heavily compressed data schema (interval|ease|repetitions|nextReview|platform), allowing you to flawlessly sync over 1,000 problems across multiple operating systems.
  • Premium UI Dashboard: Features a beautiful, responsive popup built with React and Tailwind CSS to manage your daily "Due Today" queue, add manual entries with platform selection, and view your entire problem library.

Tech Stack

  • Framework: React 19
  • Build Tool: Vite + CRXJS (Hot Module Replacement for Extensions)
  • Styling: Tailwind CSS v3 + Lucide React (Icons)
  • Language: TypeScript (Strict typing for algorithms and Chrome APIs)
  • Extension API: Chrome Manifest V3

How It Works Under The Hood

  1. Content Scripts: Run silently on *://*.neetcode.io/* and *://*.leetcode.com/*. When an "Accepted" DOM element renders, the script extracts the problem slug and passes a message with the platform type to the Background Service Worker.
  2. Background Worker: Intercepts messages, checks chrome.storage.sync to prevent duplicates (or updates the target platform link), and initializes the problem's metadata with an immediate due date.
  3. Popup Interface: Reads synchronized storage and calculates which problems are past their nextReview Unix timestamp, filtering them into the "Due Today" tab for the user to practice and re-rate.

Installation & Local Development

Want to test it out or contribute?

1. Install Dependencies

npm install

2. Build the Extension

For hot-reloading development:

npm run dev

For production build:

npm run build

3. Load into Chrome

  1. Open Chrome and navigate to chrome://extensions/
  2. Enable "Developer mode" in the top right corner.
  3. Click "Load unpacked" and select the /dist directory generated by the build step.
  4. Pin the extension to your toolbar, head over to Neetcode, and solve a problem!

Note on the key in manifest.config.ts: There is a public RSA key hardcoded into the manifest. This is an intentional best-practice for unpacked extensions. It safely locks the Extension ID so that Chrome Sync works perfectly if you use this extension across multiple computers (e.g., Ubuntu and Windows) logged into the same Google Account. It poses zero security risk.

About

Basic chrome extension using the sm-2 algorithm for spaced repetition of leetcode problems; doing problems aren't enough, being able to go back and try again is an important part of the learning process.

Resources

Stars

2 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages