Source Code Evaluation Service, to accept or reject a solution on the http://activesphere.com/careers page.
- Install
python
andpip
- Setup a new virtual environment for this project by running the command from within the project
dir:
virtualenv .
- Activate the virtual environment from within the project dir:
. bin/activate
- Install all requirements:
pip install -r requirements.txt
- You can start the server with the command:
./start_server
New problems can be added to the src/problems/
dir. Steps to create a new problems are as
follows:
- Create a new folder under
src/problems/
. - Add the
input_scale.txt
anddesop_scale.txt
files where scale can vary as per requirements. - Register the new problem with the service by adding it to the
PROB_MAPPING
insrc/config.py
. - Restart the service for it to take effect.
We define input.txt
and desop.txt
, which are input and desired output files for the code that
the applicant will write.
The Program Evaluator will feed input.txt
to the program submitted by the applicant and generated
an actop.txt
(Actual Output).
There is another subroutine which will compare desop.txt
and actop.txt
and if it matches, then we
proceed to compute the time complexity. If it's O(1)
(based on the running times for inputs at
different scale 10, 100, 1000, 1000...), then we accept the solution with a js alert saying
Accepted (for now) or else Rejected with a proper reason (Wrong Answer, Timeout, etc.).
actop.txt
will be generated separately for each applicant i.e. randomly for each request (there's
a requestId
for each applicant who submits code).