Are you a candidate looking to sharpen your skills? Try our practice tests or view sample interview questions & Get hired by the best. Click Here×

Online Django Test

Topics Covered

  • QuerySets
  • Jinja Filters
  • Django Template
  • Django Model
  • ModelForm Django Commands

Useful for hiring

  • Django Developer
  • Python Developer

Start hiring job-fit candidates using this assessment

GET A DEMO

"Our recruiters no longer rely only on the telephonic interviews. We shortlist candidates based on assessment reports. The detailed test reports provide skill wise analysis of each candidate. This has helped our clients reduce their time to hire by 60%."

Vipin Sharma, Mobile Programming,
General Manager HR & Recruitement
Question

How do you concatenate two QuerySets into one list?

Note: There can be multiple correct answers to this question.

Answer
    • result = list(query_set_1 | query_set_2)

    • from itertools import chain
      result = list(chain(query_set_1, query_set_2))

    • from django.db.models import Q
      result = Q(query_set_1) | Q(query_set_1)

    • result = query_set_1 + query_set_2

Question

Assuming you have a Django model named 'User', how do you define a One to one relation for this model in another model?

Note: There can be multiple correct answers to this question.

Answer
    • supervisor = models.OneToOneField(User, on_delete=models.CASCADE)

    • supervisor = models.OneToOneRel(User, on_delete=models.CASCADE)

    • supervisor = models.OneToOne(User, on_delete=models.CASCADE)

    • supervisor = models.ForeingKey(User, on_delete=models.CASCADE, unique=True)

Question

Using Django forms, how do you change the default input for a password input?

Answer
    • password = forms.CharField(input_style=forms.PasswordInput())

    • password = forms.CharField(input=forms.PasswordInput())

    • password = forms.CharField(widget=forms.PasswordInput())

    • password = forms.CharField(widget=forms.Password)

Good News! You can customize this test as per your requirement

  • Choose and add questions from Interview Mocha question libraries

  • Add your own set of questions

  • Customize test settings like duration, number of questions, passing score, web proctoring and much more

  • Mail us at support@interviewmocha.com to create a custom test

Looking for a tailor-made test, to suit your assessment needs?

Get in touch

Global companies using Mocha assessments

  • altran
  • credit suisse
  • sephora
  • nielsen
  • capgemini
  • akamai

How Mocha assessments are brewed

Speed up your IT recruitment with Interview Mocha

  • 500+ IT skill tests
  • 20+ coding languages
  • 50+ domain knowledge tests
  • 100+ digital 2.0 skill tests
  • Customer focus aptitude tests
  • Enterprise ready features & more...
GET A DEMO

Why hiring managers and recruiters across the globe love Interview Mocha

Take your first step to hire job fit candidates

GET A DEMO