Django Data Modeling Interview Questions

Questions to ask a Django Developer

Django engineers are often required to have a knowledge of the full web stack: starting with the ability to write optimized SQL queries, and wrapping up with a good understanding of HTML/CSS. When interviewing a Django developer, make sure that you think through your requirements and ask good questions for all of them in your interview.

Here's a suggestion for a good menu of Django interview questions:

  1. Start off with some basic SQL such as SQL Skills: Joins, Averages and Sums
  2. Include at least one simple coding task such as Separate a list of integers or Find the missing number
  3. Explore their ability to come up with an overall system design and data model with a flexible question like Design a restaurant reservation system or Design a card game system
  4. Ensure that they have a solid understanding of the basic building blocks of the web by asking about HTTP GET and POST or What are HTTP cookies?
  5. Test their knowledge of Python basics by asking them about What is a list comprehension?, Tuples and lists, and Slicing lists .
  6. Test their Django specific knowledge with questions on Django views, Django Models, Django Forms and Django Signals.
  7. Wrap up with some CSS questions like Explore the HTML display and position attributes or CSS rule-set basics

Complete the following Django model to illustrate how a manufacturer can make many different types of cars.

Give manufacturer a name, founding date and a country.

Give car a name, cost, engine capacity and color. Assume that the manufacturer makes cars in only {red, green, blue and pink}.

class Manufacturer(models.Model):
    # A car manufacturer

class Car(models.Model):
    # A type of car

Explain what the following Django model code does? What's the relationship between topping and pizza?

class Topping(models.Model):
    # ...

class Pizza(models.Model):
    # ...
    toppings = models.ManyToManyField(Topping)