I Auto-Save Every Accepted HackerRank Solution to GitHub — Here's How

calendar_today agoschedule4 min read
— Originally published at dev.to

Cover image showing accepted HackerRank code submissions are automatically captured by PrepPush Chrome extension and are pushed to the user's GitHub.

I practice on HackerRank a lot. The problems are fine, but I kept losing my own work.

I'd solve something, move on, and weeks later I couldn't remember:

  • What trick I used
  • The time/space complexity of my solution
  • Where I even saved the code

Copy-pasting into random files didn't scale. I wanted a GitHub repo that looked like interview prep, not a junk drawer.

So I built PrepPush — a Chrome extension that watches for Accepted submissions and pushes them to your GitHub repo automatically.

Screenshot showing the split Chrome window, where the right window showing a HackerRank submission and the left window shows the code submission, including AI analysis as code comments, in the user's dedicated GitHub repository.


The workflow I wanted

  1. Solve a problem on HackerRank
  2. Click Submit Code until it's Accepted
  3. Code lands on GitHub — organized, labeled, ready to revise before interviews

No manual copy-paste. No forgetting which approach was approach1 vs approach2.


What shows up on GitHub

Each accepted solution goes here:

solutions/{language}/{difficulty}/{problem-slug}/solution-approach1.py

If you solve the same problem with a different algorithm, you get solution-approach2.py, and so on.

Re-submitting the same logic updates the same file — no duplicate spam.

Example header PrepPush adds to the file:

# Link        https://www.hackerrank.com/challenges/alternating-characters/problem?isFullScreen=true
# Problem     Alternating Characters 
# Difficulty  Easy
# Subdomain   Strings
# Language    python3
# Submitted   2026-07-25, 10:46 a.m.
# Technique   linear-scan-adjacent-comparison
# Time        O(n)
# Space       O(1)
# Insight     The algorithm counts the total number of adjacent character pairs that are identical, which corresponds to the minimum number of deletions required to eliminate all consecutive duplicates.
# Interview   Before: "I could use a stack to track characters and pop duplicates." After: "A linear scan is more efficient at O(n) time and O(1) space, as we only need to compare each character with its immediate predecessor to identify necessary deletions."
# Pitfalls    (1) Failing to handle empty strings or single-character strings, which the code explicitly guards against to return zero.  (2) Incorrectly indexing the loop by starting at zero instead of one, which would cause an index out of bounds error when accessing the previous character.

The HackerRank link is the first row so you can jump back to the problem anytime.


How PrepPush captures submissions

PrepPush runs only on hackerrank.com — including contest and prep-kit pages.

When your submission is accepted:

  1. PrepPush captures the solution from HackerRank's submission data
  2. It pushes to your GitHub repo (it can create the repo on first push if your token allows)
  3. Optionally, Gemini adds technique, Big-O, trick, and hint in the header

A small toast appears on the page when capture succeeds. Open the extension from your toolbar if you want to see status or the AI analysis — push and analysis still run in the background either way.


One-time setup (~2 minutes)

You bring your own keys. PrepPush does not host your code or credentials.

1. GitHub personal access token

  • Create a classic token with repo scope
    Generate token on GitHub
  • Expiration: 90 days or No expiration — your choice
  • Paste it in PrepPush SettingsTest GitHub

2. Gemini API key (optional)

Only needed if you want AI notes in the file header.

Settings page of PrepPush Chrome extension containing spaces to insert GitHub token and Gemini key and test each of them out.

That's it. Submit an accepted solution and check your repo.


Why I built it as an extension (not a script)

HackerRank doesn't give you a clean "export all my solutions" button for the workflow I cared about.

I needed something that:

  • Fires on Accepted — not on Run/Compile
  • Works on full-screen and prep-kit URLs
  • Writes to my repo structure, not a third-party server

A Chrome extension made sense: local keys, no PrepPush backend, you own the data.


What I learned shipping it

Early users helped a lot. A few real-world fixes:

  • SQL / DB2 problems needed correct file paths (.sql, not .py)
  • Prep-kit pages use different APIs than classic challenges — capture had to follow both
  • AI headers had to reference your actual code, not generic interview tips

It's a small project (~50 early users) but it solves a real problem for me every week.


Limitations (honest list)

Topic Notes
Platform HackerRank only — not LeetCode or Codeforces
Trigger Submit Code → Accepted — Run Code doesn't count
Keys You provide GitHub token + optional Gemini key
Privacy Keys stay in Chrome on your device — see privacy notes

Try it

If you use HackerRank for interview prep, I'd love feedback — what breaks, what's missing, what would make this a weekly habit for you.


PrepPush is an independent project. Not affiliated with HackerRank, GitHub, or Google.


Question for you: How do you track HackerRank solutions today — GitHub, Notion, or not at all? I'd love to hear what would make this workflow stick for you.

🔥 Join developers growing publicly
Share your knowledge, build in public, and grow your developer presence with a global community.

More Posts

I’m a Senior Dev and I’ve Forgotten How to Think Without a Prompt

Karol Modelskiverified - Mar 19

The Sovereign Vault — A Comprehensive Guide to Protocol-Driven AI

Ken W. Algerverified - Jun 4

How I Built a React Portfolio in 7 Days That Landed ₹1.2L in Freelance Work

Dharanidharan - Feb 9

How to save time while debugging

Codeac.io - Dec 11, 2025

Your AI Doesn't Just Write Tests. It Runs Them Too.

Kevin Martinez - May 12
chevron_left
121 Points3 Badges
Hamilton, ONtridib.vercel.app
1Posts
0Comments
1Connections
Software Engineering Level IV Student

Related Jobs

View all jobs →

Commenters (This Week)

2 comments
1 comment
1 comment

Contribute meaningful comments to climb the leaderboard and earn badges!