Submitted Solutions API

This is the API to deal with Submitted Solutions. Each action shows the HTTP request and response. Errors are generic in format and provide action-specific messages and error codes as described here.

You might be wondering about the name of this resource: Submitted Solution. At first, just Solution may sound appropriate. But note that a Problem could have a correct solution and several solutions submitted by candidates. It sounded more RESTy to us that we capture this essence by providing actions on a resource named thus. Thus, you have at most one submitted solution for given screening test and a problem featured in it.

Listing Submitted Solutions

Right now, there is no API for this action. If you wanted to list the solutions submitted by a particular user for a particular screening test, you can always show the test which returns the detailed structure of a screening test including all the submitted solutions for problems appearing in it.

Later on, we may implement this action so that it takes a mandatory parameter test_id to return all the submitted solutions for the problems appearing in that test.


Creating a Submitted Solution

You may create a submitted solution to a problem appearing in a screening test that is ongoing. You may not create a submitted solution to a problem appearing in a test that is in any other state. To modify an already submitted solution, you should just call the update action.

Three parameters are of essence (and all are mandatory) when creating a solution:

  • test_id: ID of the test you are taking
  • problem_id: UUID of the problem appearing in that test
  • solution: The actual solution, preferably as markdown if it is long content. This can be as brief as "c" denoting the choice "C" of a multiple choice problem or as complex as a program like:
    <code>
    #include<stdio.h>
    int main(int argc, char** argv) {
      printf("Hello World!\n");
    }
    <code>
    The only requirement is that solution should be HTML-safe.
Request Response
Type: POST
          
URL: /submitted_solutions.[json, xml]
          
Body: access_token=<access-token>&test_id=12&problem_id=23452364568868223345343&solution=Well, this is just a binary tree.
          
XML/JSON: Representation of the created Submitted Solution.

Showing a Submitted Solution

Request Response
Type: GET
          
URL: /submitted_solutions/<ID>.[json, xml]
          
XML/JSON representation of the submitted_solution.

Updating a Submitted Solution

The only thing you can update is the value of actual solution.

Request Response
Type: PUT or POST with X-HTTP-Method-Override: PUT Header
          
URL: /submitted_solutions/<ID>.[json, xml]
          
Body: access_token=<access-token>&solution=<new value>
          
Empty

Deleting a Submitted Solution

Sorry, you may not delete a Submitted Solution, you may modify it to have an empty value.