Need suggestion to build hackerrank-like website

Hi everyone
Have an idea to build a learning website like hackerrank, datacamp etc
I’m starting out to work on python or SQL language first (whichever is easy)

However, a major component that i’m not able to discover are this:

  • User able write script and produce output using language that they like
  • The user will know whether the output passes or fails

Any idea to built a minimum version of this?
Maybe can refer which plugin or past tutorial that might help for me to dig through
Appreciate any help or hints

Thank you!