I coded a Leetcode clone (it's easier than you think)

  Рет қаралды 134,188

NeetCode

NeetCode

Күн бұрын

I coded a leetcode clone (an online code judge application, not literally a leetcode clone). I walk through how I did it, including the backend, frontend, and the process of executing test cases.
🚀 neetcode.io/ - Get lifetime access to every course I ever create!
Checkout my second Channel: / @neetcodeio
🧑‍💼 LinkedIn: / navdeep-singh-3aaa14161
🐦 Twitter: / neetcode1
🥷 Discord: / discord
0:00 - Intro
0:20 - Backend
3:02 - Frontend
4:45 - Adding a problem
7:58 - How I did it so quickly
8:49 - How did I git gud?
#algorithms #neetcode #leetcode

Пікірлер: 264
@NeetCode
@NeetCode 8 ай бұрын
What do you guys think? Not bad for a leetcode monkey eh 🐒 Try it out: neetcode.io/problems/dynamicArray Or view the full list of problems under the 'Basics' tab: neetcode.io/practice
@vs3.14
@vs3.14 8 ай бұрын
This is amazing. Can't wait till your quizes portion of the practice problems are over. I am currently following NC150. After that Leetcode and the back to NC430. It helped me so much. Thanks again for your hard work!!
@adrian333dev
@adrian333dev 8 ай бұрын
Can we access to source code of this project?
@bubblesort8760
@bubblesort8760 8 ай бұрын
Sir this is absolutely astounding. Great work. Commendable
@beodwilson5257
@beodwilson5257 8 ай бұрын
Hey Neet! I can help with customizing the monaco editor to look like vs code. Let me know if you are interested I can hop on a quick call to walk you through how it can be achieved.
@indrajeetv8878
@indrajeetv8878 8 ай бұрын
Can you please create a top 250 important problems, it would be a huge help!
@siyamafroz
@siyamafroz 8 ай бұрын
Bro got bored of solving leetcode and decided to make his own leetcode 💀 Keep it up man
@marcusplenty1153
@marcusplenty1153 8 ай бұрын
Bro solved leetcode. Difficulty Level: Medium
@ujjvalw2684
@ujjvalw2684 8 ай бұрын
​@@marcusplenty1153ouch
@recursion.
@recursion. 8 ай бұрын
I already know neetcode will be the future of leetcode.
@jl_117
@jl_117 5 ай бұрын
im gonna do this too because both working on an unrelated project and doing Leetcode is too much work when also job searching
@learningalgos614
@learningalgos614 8 ай бұрын
Now please implement the sliding haircut algorithm in O(N) time and O(1) space
@amroulouay6819
@amroulouay6819 8 ай бұрын
Given two integers num1 and num2, return a leetcode clone including the all the backend (difficulty: easy)
@notdarkangelu
@notdarkangelu 8 ай бұрын
Given two String s and t, return a girlfriend of primitive type
@harshitnagila9832
@harshitnagila9832 8 ай бұрын
@@notdarkangelu function(girlfriend){ print("In dreams");}
@notdarkangelu
@notdarkangelu 7 ай бұрын
@@harshitnagila9832 ClassNotFoundException : Can't find girlfriend even in dreams
@harshitnagila9832
@harshitnagila9832 7 ай бұрын
@@notdarkangelu import util.dreams.girlfriend;
@amroulouay6819
@amroulouay6819 7 ай бұрын
😂@@notdarkangelu
@saadahmed688
@saadahmed688 8 ай бұрын
I am making a website for competitive programming too. But since I am doing this for educational purposes, I wrote my own judge from scratch which uses apparmor for isolation, bash and python for judging and C++ for output diffing. I have also written a judging microservice in Go so I can scale it by simply adding another worker node
@vihan1873
@vihan1873 8 ай бұрын
can you share the github link if possible ?
@iNoxux
@iNoxux Ай бұрын
could you share some insights how did you do it?
@vaishnavghenge
@vaishnavghenge 8 ай бұрын
Keep going mate! you're doing great stuff, I must admit.
@petyap7600
@petyap7600 8 ай бұрын
Watching only yours video about algos. Thank you mate! Keep it up!
@akashdey5637
@akashdey5637 8 ай бұрын
Great work man, keep it up
@ducthinh2412
@ducthinh2412 8 ай бұрын
wholesome content as always! When would you say you were able to consistently solve unseen leetcode hards, like after how much practice?
@JosephChancey
@JosephChancey 8 ай бұрын
Could you please make a course on this for your site? Would love to see a simple project put together to explain this in more detail. I think the hosting it yourself part is the most intriguing.
@mirrorinfinite5392
@mirrorinfinite5392 8 ай бұрын
Would love for a longer and more detailed video regarding the problems you faced/ any interesting things that came up! Really cool video, staying tuned for more of these
@alienfunbug
@alienfunbug 8 ай бұрын
I love the part where you discuss the shortcomings and thought process/option weighing. It definitely feels like a good entry to the system design questions.
@VivekDudani
@VivekDudani 8 ай бұрын
Great stuff man. You are doing simply amazing. It would be very interesting to know how you self hosted it? Like you are running your own spare machine as a server or somewhere on public hosting … Thanks again for sharing your passion.
@business_central
@business_central 8 ай бұрын
dude, you are definitely incredible 😂🙌
@adityaparab4314
@adityaparab4314 8 ай бұрын
The way you inspire us every single time is exceptional.💯👑
@bephrem
@bephrem 7 ай бұрын
This is a super interesting video since I've been looking at the same problems for the past few years.
@YK-fg5ne
@YK-fg5ne 8 ай бұрын
You need to make a whole course on this exercise/practice. From backend to front end. I would pay for the course.
@amritakesh
@amritakesh 8 ай бұрын
Just a smol suggestion, can you add a note section next to each question where we can write something done like "revise", "solve another way" or some clue that will help us revise
@pirateg3cko
@pirateg3cko 8 ай бұрын
Great stuff, neetcode! Keep it coming 🔥
@NeetCode
@NeetCode 8 ай бұрын
It's been 30 seconds how did you watch it already 😲
@VidyaBhandary
@VidyaBhandary 8 ай бұрын
Not sure of OP but first your video is an automatic like first and then continue to watch 😂
@pirateg3cko
@pirateg3cko 8 ай бұрын
@@VidyaBhandary you said it! 😂 I commented then kept watching. I stand by my comment.
@VidyaBhandary
@VidyaBhandary 8 ай бұрын
@@pirateg3cko Exactly 💯 🤣😅
@aka.theos.
@aka.theos. 7 ай бұрын
Hey great content you honestly make me want to leetcode more and I have only been doing side projects and the comment about next js app router hits home I picked it up so fast and it seems easier to me that the page router
@jafarjuneidi7585
@jafarjuneidi7585 8 ай бұрын
“One of you assholes is gonna try to mine bitcoin on my VM” had me dead 💀😂
@Yopperpo
@Yopperpo 8 ай бұрын
next neetcode video: I coded my own programming language (it's easier thank you think)
@rajenderkatkuri7642
@rajenderkatkuri7642 8 ай бұрын
Dude BTW what framework did you use? Angular again? 😢
@Sranju23
@Sranju23 8 ай бұрын
Lol - my fav part ‘The Backend’ 😂😂 Gotta admire the humor. 🙂
@user-2802cvsfkj
@user-2802cvsfkj 8 ай бұрын
Thank you so much. I got hired yesterday. ❤ Thank you so much.
@ravenloue
@ravenloue 8 ай бұрын
Great video! Very impressive results. I haven't read through all 170+ comments because I'm too lazy for that; however, your issues with the editors looking different intrigued me. So I started to play around on the Monaco playground to try to understand whats going on. It seems that for VS Code, the team added more token types for specific instances; whereas Monaco is very simple. If you want to get the Monaco playground to look more like VS Code, then you're going to have to edit the default setup of the language file to add more tokens. It seems easy enough, but it definitely would be a tedious task.
@NeetCode
@NeetCode 8 ай бұрын
Yeah that's exactly the issue that i ran into! So annoying.
@Zefn1x
@Zefn1x 8 ай бұрын
Mah man keep the good stuff coming! Also you got any plans of sharing your tech learnings as things itself?
@RhythmSharma00088
@RhythmSharma00088 8 ай бұрын
nice video Bro Those leetcode hard does payoff
@Cruzylife
@Cruzylife 8 ай бұрын
This was a pretty cool video
@Sandeep-zd6dq
@Sandeep-zd6dq 8 ай бұрын
How can we contribute in this project 😎 btw kudos to your hard-work, we all know the pain of configuring the webpack 😂
@jamesisaacson6414
@jamesisaacson6414 8 ай бұрын
You know we appreciate videos where we can see you talking instead of just listening to your voice
@johnappleseed2578
@johnappleseed2578 8 ай бұрын
I built a web based YAML editor with Monaco and had ALL the same issues. So glad I’m not just dumb like I thought
@ashminjayson3978
@ashminjayson3978 8 ай бұрын
Hey, awesome work 🍻💖. I had a question as to how you handle the testcase validation of testcases with multiple right answers. Are you just comparing the user's answer to all possible cases or is it through some other method?
@user-ew6ve1zq1t
@user-ew6ve1zq1t 8 ай бұрын
Thanks NeetCode, your website has helped me escape samsara! 🙏💎🇧🇯
@sayanghosh6996
@sayanghosh6996 8 ай бұрын
for custom test case you may choose (design decision) to not show correct output and only their code output.
@user-oo9nd7qh9k
@user-oo9nd7qh9k 8 ай бұрын
bro is it possible to get mentorship from you? for cracking google or such companies?
@ShubhamSingh-vh1vw
@ShubhamSingh-vh1vw 8 ай бұрын
Cool, that is really cool!
@WalterGordyCanada
@WalterGordyCanada 8 ай бұрын
Maybe for the submissions where it calculates how you did compared to others it could run on standard easily repeatable hardware or benchmark the solution against another known problem each time. I never know if my algorithm was great or just had a good run on the hardware on leetcode.
@yoursandeep
@yoursandeep 7 ай бұрын
This is what I wanted to ask what backend judge0 ( I infact did a poc but was not sure if i should use this), you answered it. This helps.. Thank you very much !
@brandonlee378
@brandonlee378 8 ай бұрын
Hey, do you have a github for your projects?
@dinoscheidt
@dinoscheidt 8 ай бұрын
I wonder if web assembly is good enough now, to have a wasm version for these languages run in the browser and only validate on the server when a potential solution is found. Would be “zero” latency.
@yfjsdgzjdnfn
@yfjsdgzjdnfn 8 ай бұрын
Happy Teachers Day, NeetCode
@mr.mystiks9968
@mr.mystiks9968 8 ай бұрын
Honestly Judge0 makes this project 10x easier when you don’t have to know how the entire repo was designed.
@NeetCode
@NeetCode 8 ай бұрын
I read a lot of it's code, it's actually simpler than you think. It mainly makes use of a CLI tool that handles most of the security (isolate)
@gyanaranjan6526
@gyanaranjan6526 8 ай бұрын
That Judge 0 thing was bothering me one year ago I searched for similar things but couldn't got something so I made some container things with docker and kubernatse some how managed it but it has lots of flaw.
@TheCricketChap
@TheCricketChap 8 ай бұрын
Osum stuff 🔥👌
@nagendradevara1
@nagendradevara1 8 ай бұрын
Angular's batteries included approach lets us focus on our business logic and saves us time.
@yashsolanki069
@yashsolanki069 4 ай бұрын
How much does running judge0 self hosted cost per month and what configuration you are on for instance? I was thinking of doing the same and thought i could self host judge0 repo to render cloud on 500 ram lol. Definitely have to work around this. This video really helped clearing some point. 👍
@pheezus
@pheezus 8 ай бұрын
Laughed at the app router stuff lol. Good ol' Angular
@prajwalpawar3110
@prajwalpawar3110 8 ай бұрын
when will i ever be able to code like you .
@himanshupoddar1395
@himanshupoddar1395 8 ай бұрын
I watch your videos a lot, never thought that this account was run by an Indian/person from Indian descent. From your accent, it never seemed like so.
@NeetCode
@NeetCode 8 ай бұрын
🤠 🇮🇳
@atharvapatil4247
@atharvapatil4247 8 ай бұрын
From solving random leetcode problems to completely shifting to neetcode I have upskilled a lot
@kollpotato
@kollpotato 8 ай бұрын
4:04 medion of two sorted arrays is the only hard leetcode problem that i have solved lmao
@tah-seen
@tah-seen 8 ай бұрын
Could you please curate a playlist for data structures and algorithms for a Data Engineer.
@husseinkizz
@husseinkizz 8 ай бұрын
Man keep doing these videos, they're very indepth in technicality and nice, though I think showing your face may kinda change things, I thought you were older, cause man, you know a lot of suff, I like it when I see you as an older jade master hahaha!
@NeetCode
@NeetCode 8 ай бұрын
Yeah this is one of my favorite videos and it wasn't even a pain to edit it, so I def wanna do more like this
@husseinkizz
@husseinkizz 8 ай бұрын
@@NeetCode Yeah keep doing this awesome work, we like it!
@user-ff2ep5kk5i
@user-ff2ep5kk5i 8 ай бұрын
Beautiful stuff, can't wait to test it!
@Lonelytraveler8236
@Lonelytraveler8236 8 ай бұрын
Nice video, i am curious about two things : how do you manage time and memory limits while running all test together and handle multiple format correct answers ?
@bossgd100
@bossgd100 8 ай бұрын
curious about the answer also
@saadahmed688
@saadahmed688 8 ай бұрын
He's using an open-source judge which handles it for him. I wrote my own judge and I used rlimit for time and manually checking memory using a bash script for memory. If you place memory limits using rlimit (which is what ulimit uses) you can't send a custom signal to the terminating program to differentiate between a SIGSEGV and a run-time error. I have oversimplified a lot of stuff here btw
@Lonelytraveler8236
@Lonelytraveler8236 8 ай бұрын
@@saadahmed688 i read the open source judge api and it calculates the time for the overall submission. And since neetcode is running all tests in one sub how can he verify the constraints for each test. That was my question, thanks anyway i got a clear understanding how judges works.
@HSBTechYT
@HSBTechYT 8 ай бұрын
Didn't know something like judge 0 existed lol. Had to write my own Judge 0
@asedifo
@asedifo 8 ай бұрын
Do you have a longer writeup on the security side of things beyond just running it in a VM? Things like containerizing within the VM, blocking outbound ports, blocking the ability to change outbound ports, limiting subprocess code execution, etc? Thanks!
@bossgd100
@bossgd100 8 ай бұрын
i am curious about the answer also
@Supakills101
@Supakills101 8 ай бұрын
This is more devsecops so probably he won't cover it.
@saadahmed688
@saadahmed688 8 ай бұрын
The open-source judge he's using already takes care of that
@mr.mystiks9968
@mr.mystiks9968 8 ай бұрын
judge zero already handles this. it uses docker containers with least privileges, and allows you to set a time limit for how long the code can run. it makes the entire project 10x easier.
@Imstupid-ni3we
@Imstupid-ni3we 8 ай бұрын
So did you use some AI tool to generate test cases? Also, you mentioned about the front-end part and how annoying it is, it's pretty much the same story for me. I have a few side project ideas but I always get demotivated just by thinking about the front-end part. do you have any advice on that?
@ram8551
@ram8551 8 ай бұрын
Hey @NeetCode, thanks for the video. Just curious what tech stack you used to build the clone? You mention angular for frontend but what about the backend?
@tashima42
@tashima42 8 ай бұрын
I think its just judge0
@Sranju23
@Sranju23 8 ай бұрын
he has explained it on his one video - kzbin.info/www/bejne/aniYpWR-rK2EepY&ab_channel=NeetCode
@nhan2518
@nhan2518 8 ай бұрын
I am really interested in how to make it!!
@krtirtho
@krtirtho 8 ай бұрын
Developers doesn't fear Algorithm & time-space dependencies Developers fear application dependencies
@deathz0ne
@deathz0ne 8 ай бұрын
broooooo......NEET🍻..............Mindblowing 🤯🤯🤯 🤟
@myke6972
@myke6972 2 ай бұрын
Hey Bro! Do you think it's possible to make a HTML CSS JAVASCRIPT compiler with output, and test cases?
@alamicrodev6526
@alamicrodev6526 8 ай бұрын
I hope one day I can get as smart as this guy
@Spud_Lite
@Spud_Lite 8 ай бұрын
recursive stack visualizer when?
@the_npc_artist
@the_npc_artist 8 ай бұрын
When you see a piece of code you like, You yoink it... that cracked me up dude 🤣🤣🤣🤣
@edavar6265
@edavar6265 8 ай бұрын
Can you solve Duplicate Zeros and some other bunch of insertion questions? I really struggle to understand them.
@rahuldwivedi4758
@rahuldwivedi4758 2 ай бұрын
4:15 For us,the front end developers, adding theme is as easy as for you solving a leet code problem is.
@coldsky_
@coldsky_ 8 ай бұрын
I felt that haircut 💀
@bossgd100
@bossgd100 8 ай бұрын
The other dev who needs unit test is your future self
@machmachine
@machmachine 8 ай бұрын
wholesome watch!
@naksuy
@naksuy 8 ай бұрын
when can we test this 😅
@isaacjon
@isaacjon 8 ай бұрын
Where is full tutorial of building this application?
@rabbyhossain6150
@rabbyhossain6150 8 ай бұрын
what if you make this project open-source? so, people can contribute
@ashu3403
@ashu3403 8 ай бұрын
Maybe integrate system design as well
@berkay2410
@berkay2410 8 ай бұрын
Not too long ago, I sent you an e-mail about localized pricing and you replied in an instant sir! But then, I couldn't hear back from you :(
@ramboli4118
@ramboli4118 3 ай бұрын
How do you store the progress of users? like their code?
@anotherEmail475
@anotherEmail475 7 ай бұрын
Nothing is hard as long as you have time and money to do what you want. Programming is different for everyone and people learn with different pace. You sounded like someone putting above others. Don't be disrespectful cause there are plenty of people copying with imposter syndrome and you are actually making them feel bad. Other than that keep up a good work
@EzraSchroeder
@EzraSchroeder 8 ай бұрын
@1:00 how did you find judge0 ?
@MancySaxena
@MancySaxena 8 ай бұрын
Take a bow man! Did leetcode, went to Google, left Google, made another leetcode!!
@ShruthikRavula
@ShruthikRavula 8 ай бұрын
Bro, could you just recommend what to and where should I learn to just understand what you are telling
@amono770
@amono770 8 ай бұрын
I don’t know why but u look smart af
@AshishSinghh
@AshishSinghh 8 ай бұрын
Golang solutions as well please
@heatchecknyc2142
@heatchecknyc2142 8 ай бұрын
Are personal projects really more important than leetcode
@Cygx
@Cygx 8 ай бұрын
This one man is an absolute menace for taking on a multimillion dollar company and doing it better.
@HimanshuKumar_24
@HimanshuKumar_24 8 ай бұрын
yahan ek medium level ka question nai banta , bhai ne Leetcode hi bana diya.
@nio.ritesh
@nio.ritesh 8 ай бұрын
yes i can help you with customising monaco theme
@alangamer50
@alangamer50 8 ай бұрын
Leetcode be like: Make an algorithm to reverse SHA256 in O(n) time and O(1) space. Medium difficulty (discussion section thinks it should be labeled as easy)
@AnhNguyen-vu7mc
@AnhNguyen-vu7mc 20 күн бұрын
Was thinking instead of using judge0 we could use a docker image for each language and have a worker pool to execute submissions
@ashwinsnmv
@ashwinsnmv 8 ай бұрын
This is mot the example of a developer. This is a plug and play engineer. As soon as you hit a road block, you'll be stuck. A good developer can solve leetcode problems but the other way is very rare.
@XEQUTE
@XEQUTE 8 ай бұрын
hey dude , You can either : - make it open source and hire and get people to work through people through pull requests with bounties ( do first , get paid first ) - hiring through your channel , community post with google forms or any form solution you like. ( making your community stronger ) - hiring professionals from freelancer. I'm up for the frontend job if thats okay with ya .
@bossgd100
@bossgd100 8 ай бұрын
- create a dao with a token
@adityabanka_iso
@adityabanka_iso 8 ай бұрын
Absolute Chad
@clouddrive6833
@clouddrive6833 8 ай бұрын
My head got exploded
@Ajeetkumar-uo4hf
@Ajeetkumar-uo4hf 8 ай бұрын
You are amazing ❤
@NeetCode
@NeetCode 8 ай бұрын
❤️
@SomeoneAlive90
@SomeoneAlive90 8 ай бұрын
Why did I read “I coded a NeetCode clone” and was so confused that why would he clone his own website? 😂
@nithin3476
@nithin3476 8 ай бұрын
you can use docker
@abhishekkumar-fw4nm
@abhishekkumar-fw4nm 8 ай бұрын
Make it open-source people will love to contribute
@bephrem
@bephrem 7 ай бұрын
No the Monaco editor syntax highlighting is annoying. I went through the same thing. I switched to CodeMirror because of how complex it was to add your own highlighting config.
@Zeiyon
@Zeiyon 8 ай бұрын
Why did you choose angular? Just curious.
@themagickalmagickman
@themagickalmagickman 8 ай бұрын
Its what he used at his job so I assume he just kept going with what he knows
@Zeiyon
@Zeiyon 8 ай бұрын
@@themagickalmagickman Ah, I mean he has a course on react so I was curious why he switched back to angular
@NeetCode
@NeetCode 8 ай бұрын
Yeah I started neetcode.io with angular 1.5years ago. In hindsight it was a mistake and I should've used React, because it's simpler and more ppl are familiar with it so it would be easier to hire for.
How I Coded a SaaS (payments, database and frontend)
13:15
NeetCode
Рет қаралды 134 М.
How I Cracked the Google Coding Interview (from unemployment)
12:44
Teenagers Show Kindness by Repairing Grandmother's Old Fence #shorts
00:37
Fabiosa Best Lifehacks
Рет қаралды 38 МЛН
Stupid man 👨😂
00:20
Nadir Show
Рет қаралды 28 МЛН
Mastering Dynamic Programming - How to solve any interview problem (Part 1)
19:41
Never install locally
5:45
Coderized
Рет қаралды 1,6 МЛН
How principled coders outperform the competition
11:11
Coderized
Рет қаралды 1,5 МЛН
I Solved 1583 Leetcode Questions  Here's What I Learned
20:37
ThePrimeTime
Рет қаралды 483 М.
The LeetCode Fallacy
6:08
NeetCode
Рет қаралды 362 М.
I quit Amazon after two months
10:09
NeetCode
Рет қаралды 554 М.
My Brain after 569 Leetcode Problems
7:50
NeetCode
Рет қаралды 2,3 МЛН
The purest coding style, where bugs are near impossible
10:25
Coderized
Рет қаралды 833 М.
Advice from the Top 1% of Software Engineers
10:21
Kevin Naughton Jr.
Рет қаралды 3,1 МЛН
Наушники Ой🤣
0:26
Listen_pods
Рет қаралды 496 М.
🤯Самая КРУТАЯ Функция #shorts
0:58
YOLODROID
Рет қаралды 3,6 МЛН
wyłącznik
0:50
Panele Fotowoltaiczne
Рет қаралды 7 МЛН
Переходник для IPhone • 181649538                         Делюсь обзорами в профиле @lykofandrei
0:15