Skip to content

Instantly share code, notes, and snippets.

@ahmetkotan
Last active March 14, 2024 09:01
Show Gist options
  • Star 3 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save ahmetkotan/1fd842bb7e682acfb047dac6bdf50c49 to your computer and use it in GitHub Desktop.
Save ahmetkotan/1fd842bb7e682acfb047dac6bdf50c49 to your computer and use it in GitHub Desktop.
Octoxlabs Backend Engineer Case Study

Octoxlabs Backend Engineer Case Study

We aim to develop a composite application utilizing Docker and docker-compose, which comprises two services: your Django REST Framework endpoint and an Elasticsearch service. The Django REST Framework endpoint should include minimum two features:

  • Authentication Mechanism: We are looking for an authentication method similar to JWT. For instance, if there is a user with the username "octoAdmin," we would add an Authorization header as "Octoxlabs base64(octoAdmin)". This token should uniquely identify the user "octoAdmin".

  • Endpoint: Consider having data structured as an array like [{"Hostname": "octoxlabs01", "Ip": ["0.0.0.0"]}] stored in the Elasticsearch service. We expect to query your endpoint with "Hostname = octoxlabs*" and have this query translated into the JSON format for Elasticsearch. Please avoid using query_string in Elasticsearch, if possible. The scenario involves the endpoint converting the "Hostname = octoxlabs*" query into an Elasticsearch-compatible format, querying Elasticsearch, and then returning the data in the response.

      POST /search
      {
          "query": "Hostname = octoxlabs*"
      }
    

    Hint: Elasticsearch indices have mappings, and their fields have properties like "keyword." For example, if you create an index in Elasticsearch named "octoxlabsdata," you can access its mapping with "GET /octoxlabsdata/_mapping".

Advantages of completing this case study include:

  • Implementing unit tests.
  • Implementing code quality tools.
  • A management command that interacts with your endpoint.

Please submit your code via a GitHub link or as a zip file attachment in your response. Mail subject is this filename.
ahmet[dot]kotan[at]octoxlabs[dot]com / Co-Founder and CTO @ Octoxlabs
Good luck!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment