HackerRank
HackerRank is a great place to learn, improve, play with your programming skills.
All challenges are runnable, except SQL and multiple choice question ones. They are verified with their default testcase (usually Testcase 0).
Solutions
The curated challenges of Interview Preparation Kit.
And ProjectEuler+ (See here my solutions of Project Euler)
Usage and tools
Requirements
- Python 3.6 or 3.7 and some packages : numpy, SciPy, scikit-learn, requests, flake8, PyYAML
- CMake to build and run tests
- Modern GCC or Clang that comes with macOS or Linux. For Windows, you can use WSL, Cygwin or Visual Studio Comunity 2017
- Haskell (functional programming only)
- Java (some challenges and Java practice)
- Node.js
Compilation
mkdir build
cd build
cmake ..
make
Tests
cd build
make extract-testcases
ctest [-R filter]
It will download the challenge testcases and run solution programs.
A solution can be tested solely with runtest.sh -t challenge-name [-n test-number]
in its build subdirectory.
Tools
hrinit.py
creates a new file for a given challenge based on the HackerRank template. Default choice for language is Python 3.runtest.sh
is the script used by CTest to verify the solution.compare.py
aims to fairly compare the program output with the excepted one. It is necessary since some challenges use decimal numbers : we cannot simply usediff -qw
.hrtc2.py
can be used to download «purchased» testcases or to create new ones. Copy and paste the download links of input and output data.
Other (hacking) tools
hr_github.sh
creates the testcases archive and sync the private repo to the public GitHub onehr_table.py
automatically createsREADME.md
files with challenge lists (requires offline data)hr_count.py
counts challenges and testcases - used to update toplevelREADME.md
hr_offline.py
downloads challenge catalogs and morehr_interview.py
gets the playlist of Interview Preparation Kithr_menu.py
displays a graphical menu to browse challenges and solve them when no Internet connection is available (requires offline data)hr_db.py
creates a SQLite database - used to understand how data is structured (or not!)
IDE
Visual Studio Code is a great free IDE that comes with many plugins. Some configuration files are provided and a Bash initialization file.
Other online resources
- stack overflow and Mathematics Stack Exchange
- GeeksforGeeks Computer Science portal and resources
- Rosetta Code
- tutorialspoint
- Compiler Explorer Run compilers interactively from your web browser and interact with the assembly (opensource).
- Ideone Online compiler and debugging tool which allows youto compile source code and execute it online in more than 60 programming languages.
- and many, many more…
License
Unlicense aka. Public Domain 🤘