Write code, run it, right here
A free Python, JavaScript, Java and C++ runner for interview practice. Your code runs inside your own browser, so it is instant, private and needs no account. Programs read standard input and print standard output, exactly like the coding round in a mock interview.
OUTPUT
Press Run to execute your code with the input on the left. Everything runs in your browser.
Practice problems with tests
Each one comes with starter code that already reads the input, sample tests and a few edge cases of our own.
- EasyArrays and hashingTwo Sum4 tests · Python, JavaScript, Java and C++
- EasyStacksValid Parentheses6 tests · Python, JavaScript, Java and C++
- MediumArrays and sortingMerge Intervals4 tests · Python, JavaScript, Java and C++
- MediumDesign and hashingDesign an LRU Cache3 tests · Python, JavaScript, Java and C++
- MediumSliding windowLongest Substring Without Repeating Characters6 tests · Python, JavaScript, Java and C++
- MediumHeaps and hashingTop K Frequent Words3 tests · Python, JavaScript, Java and C++
- MediumGraphs (BFS and DFS)Number of Islands4 tests · Python, JavaScript, Java and C++
- MediumGraphs (topological sort)Course Schedule4 tests · Python, JavaScript, Java and C++
- MediumDynamic programmingCoin Change5 tests · Python, JavaScript, Java and C++
- MediumHashingGroup Anagrams3 tests · Python, JavaScript, Java and C++
- MediumBinary searchSearch in Rotated Sorted Array5 tests · Python, JavaScript, Java and C++
- HardTwo pointersTrapping Rain Water4 tests · Python, JavaScript, Java and C++
- HardHeapsFind Median from Data Stream3 tests · Python, JavaScript, Java and C++
- HardDynamic programmingWord Break4 tests · Python, JavaScript, Java and C++
How it works
- Python is real CPython compiled to WebAssembly, with the standard library (collections, heapq, bisect, itertools and so on). It downloads once, about 11 MB, the first time you run Python.
- In Python read input with
input()orsys.stdin. In JavaScript usereadline(),require("fs").readFileSync(0, "utf8")or Node's readline module. - A run stops after 10 seconds (Python) or 5 seconds (JavaScript), so an infinite loop never hangs the page. Nothing is sent to a server.
- Your code is saved in this browser, per problem, until you press Reset.
Solving it is half of a coding round; the other half is explaining it while someone asks why. Run a coding mock with Max. Free: a 5-minute voice round and unlimited typed drills.