Search test library by skills or roles
⌘ K

Python & Django Online Test

The Python Django Test uses scenario-based MCQs to evaluate candidates on Python fundamentals, Django models, views, templates, forms, ORM, and querysets. Additionally, it evaluates the candidate's understanding of database operations, security, and deployment using Django. The test also includes a coding question to evaluate hands-on Python programming skills.

Covered skills:

  • Python fundamentals
  • Data Structures
  • CRUD operations on tables
  • Errors and exceptions handling
  • Django framework basics
  • Django Models and Views
  • Django Templates
  • Python Programming
Get started for free
Preview questions

About the Python & Django Test


The Python & Django Online Test helps recruiters and hiring managers identify qualified candidates from a pool of resumes, and helps in taking objective hiring decisions. It reduces the administrative overhead of interviewing too many candidates and saves time by filtering out unqualified candidates at the first step of the hiring process.

The test screens for the following skills that hiring managers look for in candidates:

  • Ability to write Python code using proper syntax and conventions
  • Experience with common data structures in Python
  • Proficiency in performing CRUD operations on tables
  • Able to efficiently handle exceptions and errors in Python
  • Familiarity with the basics of the Django framework
  • Knowledge of Django models and views
  • Understanding of Django templates
  • Proficient in Python programming

1200+ customers in 80 countries


Use Adaface tests trusted by recruitment teams globally. Adaface skill assessments measure on-the-job skills of candidates, providing employers with an accurate tool for screening potential hires.

customers in 75 countries
Get started for free
Preview questions

Non-googleable questions


We have a very high focus on the quality of questions that test for on-the-job skills. Every question is non-googleable and we have a very high bar for the level of subject matter experts we onboard to create these questions. We have crawlers to check if any of the questions are leaked online. If/ when a question gets leaked, we get an alert. We change the question for you & let you know.

How we design questions

These are just a small sample from our library of 15,000+ questions. The actual questions on this Python & Django Test will be non-googleable.

🧐 Question

Medium

ZeroDivisionError and IndexError
Exceptions
Exception Handling
Error Handling
Solve
What will the following Python code output?
 image

Medium

Session
File Handling
Dictionary
Csv Parsing
Exception Handling In File Input/output
Solve
 image
The function high_sess should compute the highest number of events per session of each user in the database by reading a comma-separated value input file of session data. The result should be returned from the function as a dictionary. The first column of each line in the input file is expected to contain the user’s name represented as a string. The second column is expected to contain an integer representing the events in a session. Here is an example input file:
Tony,10
Stark,12
Black,25
Your program should ignore a non-conforming line like this one.
Stark,3
Widow,6
Widow,14
The resulting return value for this file should be the following dictionary: { 'Stark':12, 'Black':25, 'Tony':10, 'Widow':14 }
What should replace the CODE TO FILL line to complete the function?
 image

Medium

Max Code
Arrays
Code Analysis
Algorithm Understanding
Solve
Below are code lines to create a Python function. Ignoring indentation, what lines should be used and in what order for the following function to be complete:
 image

Medium

Recursive Function
Recursion
Dictionary
Lists
Solve
Consider the following Python code:
 image
In the above code, recursive_search is a function that takes a dictionary (data) and a target key (target) as arguments. It searches for the target key within the dictionary, which could potentially have nested dictionaries and lists as values, and returns the value associated with the target key. If the target key is not found, it returns None.

nested_dict is a dictionary that contains multiple levels of nested dictionaries and lists. The recursive_search function is then called with nested_dict as the data and 'target_key' as the target.

What will the output be after executing the above code?

Medium

Stacking problem
Stack
Linkedlist
Solve
What does the below function ‘fun’ does?
 image
A: Sum of digits of the number passed to fun.
B: Number of digits of the number passed to fun.
C: 0 if the number passed to fun is divisible by 10. 1 otherwise.
D: Sum of all digits number passed to fun except for the last digit.

Easy

URL Dispatcher
Routes
Django Url Pattern Matching
Solve
Review the following sample Django URL.conf:
 image
Pick the correct statements if settings.APPEND_SLASH=False:

A: A request to /books/2015/04/ would match the third entry in the list. Django would call the function views.month_books(request, year=2015, month=4).
B: A request to /books/2015/04/ would match the second entry in the list. Django would call the function views.year_books(request, year=2015).

C: A request to /books/2023/ will match the first entry in the list. Django would call the the function views.custom_newyear_2023(request).
D: A request to /books/2023/ would match the second entry in the list. Django would call the function views.year_books(request, year=2023).

E: /books/2022 would not match any of these patterns, because each pattern requires that the URL end with a slash.
F: A request to /books/2022 would match the second entry in the list. Django would call the function views.year_books(request, year=2022).

Medium

External Bank Transfer
Database Transactions
Exception Handling
Transaction Management
Solve
Review the following Django code for a banking application:
 image
The code needs to debit an account with the provided amount and deposit the amount in an external entity. Here’s how the code is broken:

1) First, the amount is debited from the account by creating a new row in BalanceLine table.
2) Next, a new row is created in the DB in ExternalTransfer table and a new id (used as unique reference) is created for the transfer.
3) An external 3rd party API call is made using the new id created in step 2.

The function transfer_to_other_bank is called as shown below:
 image
Pick the correct statements:

A: If post_transfer_emails() raises an exception, the database transactions that happened in transfer_to_other_bank are not rolled back since they are listed in a separate atomic transaction.
B: If post_transfer_emails() raises an exception, the database transactions (new rows in ExternalTransfer and BalanceLine tables) are rolled back. The banking_api call is called again with a null reference.
C: If post_transfer_emails() raises an exception, the database transactions are rolled back but the banking_api is not called again.
D: If post_transfer_emails() raises an exception, the banking_api is called again with rollback=True. If the response is success, then the database transactions are rolled back. If the response is failure, the database transactions are committed.

Medium

Query retired people
Django Querysets
Database Modeling
Django Orm
Solve
An HRTech startup has the following Django code:
 image
We want a QuerySet with all Person objects where retired == True and age != 45. Which of the following do you think we should use?
 image

Easy

Registration Queue
Logic
Queues
Sorting By Custom Order
Solve
We want to register students for the next semester. All students have a receipt which shows the amount pending for the previous semester. A positive amount (or zero) represents that the student has paid extra fees, and a negative amount represents that they have pending fees to be paid. The students are in a queue for the registration. We want to arrange the students in a way such that the students who have a positive amount on the receipt get registered first as compared to the students who have a negative amount. We are given a queue in the form of an array containing the pending amount.
For example, if the initial queue is [20, 70, -40, 30, -10], then the final queue will be [20, 70, 30, -40, -10]. Note that the sequence of students should not be changed while arranging them unless required to meet the condition.
⚠️⚠️⚠️ Note:
- The first line of the input is the length of the array. The second line contains all the elements of the array.
- The input is already parsed into an array of "strings" and passed to a function. You will need to convert string to integer/number type inside the function.
- You need to "print" the final result (not return it) to pass the test cases.

For the example discussed above, the input will be:
5
20 70 -40 30 -10

Your code needs to print the following to the standard output:
20 70 30 -40 -10

Medium

Visitors Count
Strings
Logic
String Parsing
Character Counting
Solve
A manager hires a staff member to keep a record of the number of men, women, and children visiting the museum daily. The staff will note W if any women visit, M for men, and C for children. You need to write code that takes the string that represents the visits and prints the count of men, woman and children. The sequencing should be in decreasing order. 
Example:

Input:
WWMMWWCCC

Expected Output: 
4W3C2M

Explanation: 
‘W’ has the highest count, then ‘C’, then ‘M’. 
⚠️⚠️⚠️ Note:
- The input is already parsed and passed to a function.
- You need to "print" the final result (not return it) to pass the test cases.
- If the input is- “MMW”, then the expected output is "2M1W" since there is no ‘C’.
- If any of them have the same count, the output should follow this order - M, W, C.
🧐 Question🔧 Skill

Medium

ZeroDivisionError and IndexError
Exceptions
Exception Handling
Error Handling

2 mins

Python
Solve

Medium

Session
File Handling
Dictionary
Csv Parsing
Exception Handling In File Input/output

2 mins

Python
Solve

Medium

Max Code
Arrays
Code Analysis
Algorithm Understanding

2 mins

Python
Solve

Medium

Recursive Function
Recursion
Dictionary
Lists

3 mins

Python
Solve

Medium

Stacking problem
Stack
Linkedlist

4 mins

Python
Solve

Easy

URL Dispatcher
Routes
Django Url Pattern Matching

2 mins

Django
Solve

Medium

External Bank Transfer
Database Transactions
Exception Handling
Transaction Management

3 mins

Django
Solve

Medium

Query retired people
Django Querysets
Database Modeling
Django Orm

2 mins

Django
Solve

Easy

Registration Queue
Logic
Queues
Sorting By Custom Order

30 mins

Coding
Solve

Medium

Visitors Count
Strings
Logic
String Parsing
Character Counting

30 mins

Coding
Solve
🧐 Question🔧 Skill💪 Difficulty⌛ Time
ZeroDivisionError and IndexError
Exceptions
Exception Handling
Error Handling
Python
Medium2 mins
Solve
Session
File Handling
Dictionary
Csv Parsing
Exception Handling In File Input/output
Python
Medium2 mins
Solve
Max Code
Arrays
Code Analysis
Algorithm Understanding
Python
Medium2 mins
Solve
Recursive Function
Recursion
Dictionary
Lists
Python
Medium3 mins
Solve
Stacking problem
Stack
Linkedlist
Python
Medium4 mins
Solve
URL Dispatcher
Routes
Django Url Pattern Matching
Django
Easy2 mins
Solve
External Bank Transfer
Database Transactions
Exception Handling
Transaction Management
Django
Medium3 mins
Solve
Query retired people
Django Querysets
Database Modeling
Django Orm
Django
Medium2 mins
Solve
Registration Queue
Logic
Queues
Sorting By Custom Order
Coding
Easy30 minsSolve
Visitors Count
Strings
Logic
String Parsing
Character Counting
Coding
Medium30 minsSolve
Get started for free
Preview questions
love bonito

With Adaface, we were able to optimise our initial screening process by upwards of 75%, freeing up precious time for both hiring managers and our talent acquisition team alike!

Brandon Lee, Head of People, Love, Bonito

Brandon
love bonito

It's very easy to share assessments with candidates and for candidates to use. We get good feedback from candidates about completing the tests. Adaface are very responsive and friendly to deal with.

Kirsty Wood, Human Resources, WillyWeather

Brandon
love bonito

We were able to close 106 positions in a record time of 45 days! Adaface enables us to conduct aptitude and psychometric assessments seamlessly. My hiring managers have never been happier with the quality of candidates shortlisted.

Amit Kataria, CHRO, Hanu

Brandon
love bonito

We evaluated several of their competitors and found Adaface to be the most compelling. Great library of questions that are designed to test for fit rather than memorization of algorithms.

Swayam Narain, CTO, Affable

Brandon

Why you should use Pre-employment Python & Django Online Test?

The Python & Django Test makes use of scenario-based questions to test for on-the-job skills as opposed to theoretical knowledge, ensuring that candidates who do well on this screening test have the relavant skills. The questions are designed to covered following on-the-job aspects:

  • Understanding of Python fundamentals
  • Proficiency in creating and manipulating Data Structures in Python
  • Ability to perform CRUD operations on tables using Python
  • Handling exceptions and errors in Python
  • Familiarity with Django framework basics
  • Knowledge of Django Models and Views
  • Experience with Django Templates
  • Expertise in Python Programming
  • Understanding of Object-Oriented Programming in Python
  • Knowledge of Python libraries and packages

Once the test is sent to a candidate, the candidate receives a link in email to take the test. For each candidate, you will receive a detailed report with skills breakdown and benchmarks to shortlist the top candidates from your pool.

What topics are covered in the Python & Django Online Test?

Python fundamentals: Python fundamentals encompass the basic concepts and syntax of the Python programming language. It involves understanding variables, data types, control structures, functions, and file handling. This skill is measured in the test to assess the candidate's understanding of the core concepts of Python programming and their ability to write concise and efficient code.

Data Structures: Data structures refer to the different ways of organizing and storing data in a computer program. This skill includes knowledge of lists, tuples, dictionaries, sets, and arrays, as well as their respective operations and manipulations. It is important to measure this skill in the test as it demonstrates the candidate's ability to design and implement efficient data structures, which are crucial for solving complex programming problems.

CRUD operations on tables: CRUD stands for Create, Read, Update, and Delete, which are the basic operations performed on database tables. This skill involves understanding SQL queries and database management systems, as well as the ability to perform CRUD operations using Python. It is measured in the test to evaluate the candidate's proficiency in working with databases and their ability to interact with data using SQL and Python.

Errors and exceptions handling: Errors and exceptions handling refers to the practice of identifying and managing errors or exceptional situations in a program. This skill includes knowledge of different types of errors, such as syntax errors, runtime errors, and logical errors, and the ability to handle them using exception handling constructs. It is important to measure this skill in the test as it demonstrates the candidate's ability to write robust and reliable code that can handle unexpected situations and provide meaningful error messages.

Django framework basics: Django is a high-level Python web framework used for developing web applications. This skill includes knowledge of the MVC (Model-View-Controller) architecture, URL routing, request-response lifecycle, and basic Django concepts like views, models, and templates. It is measured in the test to assess the candidate's understanding of the fundamentals of Django and their ability to build simple web applications using the framework.

Django Models and Views: Django Models and Views are key components of the Django framework. Models represent the data and database schema, while Views handle the logic of handling HTTP requests and rendering templates. This skill involves knowledge of creating models, defining relationships between models, querying data from the database, and implementing business logic in views. It is important to measure this skill in the test as it demonstrates the candidate's ability to design and implement efficient database models and handle user requests in a Django application.

Django Templates: Django templates are used for rendering HTML pages in Django applications. This skill includes knowledge of template syntax, template tags, filters, and template inheritance. It is measured in the test to evaluate the candidate's ability to create dynamic and reusable HTML templates that can be seamlessly integrated into a Django application.

Python Programming: Python programming skill involves proficiency in writing clean, readable, and maintainable code using Python. It includes knowledge of advanced concepts such as generators, decorators, context managers, and object-oriented programming. This skill is measured in the test to assess the candidate's overall programming ability and their familiarity with Python's advanced features and best practices.

Full list of covered topics

The actual topics of the questions in the final test will depend on your job description and requirements. However, here's a list of topics you can expect the questions for Python & Django Test to be based on.

Variables
Data types
Lists
Tuples
Dictionaries
Strings
Control flow statements
Loops
Functions
Exception handling
File handling
Classes
Inheritance
Polymorphism
Encapsulation
Namespaces
Memory management
Recursion
Sorting algorithms
Searching algorithms
Linked lists
Stacks
Queues
Binary trees
Graphs
Database concepts
SQL queries
Joins
Indexes
Transactions
ORM (Object-Relational Mapping)
Migrations
Model relationships
Forms
Views
URL routing
Middleware
Templates
Template inheritance
Context processors
Static files
Session management
Authentication
Authorization
Caching
CRUD operations
Serialization
Unit testing
Debugging
Code profiling
Concurrency
Generators
Decorators
Context managers
Regular expressions
Lambda functions
Concurrency in Django
RESTful APIs
Middleware customization
XML handling
CSV handling
JSON handling

What roles can I use the Python & Django Online Test for?

  • Python Developer
  • Backend Developer
  • Django Developer
  • Full Stack Engineer

How is the Python & Django Online Test customized for senior candidates?

For intermediate/ experienced candidates, we customize the assessment questions to include advanced topics and increase the difficulty level of the questions. This might include adding questions on topics like

  • Proficiency in debugging and troubleshooting Python code
  • Ability to write efficient and optimized Python code
  • Understanding of database concepts and SQL
  • Experience with RESTful APIs and web services
  • Expertise in defining and using Django models
  • Knowledge of Django ORM (Object-Relational Mapping)
  • Understanding of HTTP protocol and request/response cycle
  • Proficiency in working with HTML, CSS, and JavaScript
  • Ability to implement authentication and authorization in Django
  • Experience with deploying Django applications
  • Knowledge of software development best practices

The coding question for experienced candidates will be of a higher difficulty level to evaluate more hands-on experience.

Try the most advanced candidate assessment platform

ChatGPT Protection

Non-googleable Questions

Web Proctoring

IP Proctoring

Webcam Proctoring

MCQ Questions

Coding Questions

Typing Questions

Personality Questions

Custom Questions

Ready-to-use Tests

Custom Tests

Custom Branding

Bulk Invites

Public Links

ATS Integrations

Multiple Question Sets

Custom API integrations

Role-based Access

Priority Support

GDPR Compliance

Screen candidates in 3 easy steps

Pick a test from over 500+ tests

The Adaface test library features 500+ tests to enable you to test candidates on all popular skills- everything from programming languages, software frameworks, devops, logical reasoning, abstract reasoning, critical thinking, fluid intelligence, content marketing, talent acquisition, customer service, accounting, product management, sales and more.

Invite your candidates with 2-clicks

Make informed hiring decisions

Get started for free
Preview questions

Have questions about the Python & Django Hiring Test?

What is Python & Django Test?

The Python & Django Test assesses candidates on their knowledge and skills in Python programming and the Django framework. It's used by recruiters to evaluate a candidate's proficiency in Python fundamentals, data structures, CRUD operations, error handling, and more.

Can I combine Python & Django Test with backend engineering skills?

Yes, recruiters can request a custom test that includes both Python & Django skills along with backend engineering skills. Check out our Backend Engineer Test for more details on how we assess backend engineering skills.

What topics are evaluated in the Python & Django Test?

The test covers Python fundamentals, data structures, CRUD operations on tables, error handling, Django framework basics, Django models and views, Django templates, and Python programming. It also assesses senior roles on debugging expertise, optimized code writing, and RESTful API experience.

How to use Python & Django Test in my hiring process?

Use this test as a pre-screening tool during the initial stages of recruitment. Share the assessment link in your job post or invite candidates directly via email. It helps identify skilled candidates early in the recruitment process.

Can I test Python and SQL together in a test?

Yes, you can. We offer a Python & SQL Test that evaluates both programming and database skills. This combination is recommended for roles requiring expertise in both areas.

What are the main Python tests?

We have several tests for evaluating Python skills:

Can I combine multiple skills into one custom assessment?

Yes, absolutely. Custom assessments are set up based on your job description, and will include questions on all must-have skills you specify. Here's a quick guide on how you can request a custom test.

Do you have any anti-cheating or proctoring features in place?

We have the following anti-cheating features in place:

  • Non-googleable questions
  • IP proctoring
  • Screen proctoring
  • Web proctoring
  • Webcam proctoring
  • Plagiarism detection
  • Secure browser
  • Copy paste protection

Read more about the proctoring features.

How do I interpret test scores?

The primary thing to keep in mind is that an assessment is an elimination tool, not a selection tool. A skills assessment is optimized to help you eliminate candidates who are not technically qualified for the role, it is not optimized to help you find the best candidate for the role. So the ideal way to use an assessment is to decide a threshold score (typically 55%, we help you benchmark) and invite all candidates who score above the threshold for the next rounds of interview.

What experience level can I use this test for?

Each Adaface assessment is customized to your job description/ ideal candidate persona (our subject matter experts will pick the right questions for your assessment from our library of 10000+ questions). This assessment can be customized for any experience level.

Does every candidate get the same questions?

Yes, it makes it much easier for you to compare candidates. Options for MCQ questions and the order of questions are randomized. We have anti-cheating/ proctoring features in place. In our enterprise plan, we also have the option to create multiple versions of the same assessment with questions of similar difficulty levels.

I'm a candidate. Can I try a practice test?

No. Unfortunately, we do not support practice tests at the moment. However, you can use our sample questions for practice.

What is the cost of using this test?

You can check out our pricing plans.

Can I get a free trial?

Yes, you can sign up for free and preview this test.

I just moved to a paid plan. How can I request a custom assessment?

Here is a quick guide on how to request a custom assessment on Adaface.

View sample scorecard


Along with scorecards that report the performance of the candidate in detail, you also receive a comparative analysis against the company average and industry standards.

View sample scorecard
customers across world
Join 1200+ companies in 80+ countries.
Try the most candidate friendly skills assessment tool today.
g2 badges
Ready to use the Adaface Python & Django Test?
Ready to use the Adaface Python & Django Test?
logo
40 min tests.
No trick questions.
Accurate shortlisting.
Terms Privacy Trust Guide
ada
Ada
● Online
Previous
Score: NA
Next
✖️