DEV Community

Discussion on: Django Interview Questions

Collapse
 
steelwolf180 profile image
Max Ong Zong Bao

I would just ignore bulk of it as most of it can be googled. I would ask question like this so we can understand about the developer's perspective:

1) Which would you prefer class based views vs function based views. Why would you choose 1 or the other?

Ans: There's no hard or fast rule, usually it's easier to read for Function Based Views for beginners than Class Based Views.
Class Based Views abstracts certain portion of it. Class Based Views allows you to write lesser code but sacrifices understanding of your code due to abstraction.

So you might take more time to read or understand. Ideally it's better to stick with 1 for the whole project than changing mixing it together.

2) Which database would you use for Django? Why do you choose it?
Ans: Again there's a divide ideally, the standard practice is to just use PostgreSQL to avoid a world of hurt despite it's ORM.

I would look at When to Use MongoDB with Django as a reference since he's the guy who maintains Cookiecutter a popular library as well a & Two Scoops of Django