Back-End Developer Capstone - Final Graded Assessment

Back-End Developer Capstone - Final Graded Assessment

  1. Complete the following sentence. The APIView class in the Django REST framework acts as ____________________________.

    • an API policy decorator for function-based views

    • a base class for generic views

    • a base class for class-based views

    • a decorator with HTTP method parameters for function-based views

  2. Which of the following options can you use to clone a GitHub repository? Select all that apply.

    • You can clone a GitHub repository with the GitHub Desktop app.

    • You can use the git clone command in the Git terminal.

    • You can download a GitHub repository as a ZIP file.

    • You can clone a GitHub repository with GitHub's web interface.

  3. Which template tag is necessary to serve the static files in the template?

    • {% load "/static " %}

    • {% load static %}

    • {% static %}

    • {% include static %}

  4. True or False: A ModelSerializer maps closely to model definitions in a Django app.

    • True

    • False

  5. Which of the following base endpoints are available when you use Djoser for authenticating a DRF API? Select all that apply.

    • /users/me/

    • /users/create/

    • /users/login/

    • /users/

  6. How does a ViewSet handle the HTTP requests? Select all that apply.

    • You can write a separate ViewSet class for each type of HTTP request.

    • You may implement methods like create() and list() to handle request methods such as POST and GET.

    • The ViewSet internally creates URL routes for each HTTP call.

    • You provide separate methods get() or post() inside the class.

  7. How can you obtain an authorization token for a user in the DRF API? Select all that apply.

    • Using the djoser endpoint /token/login/.

    • Using Django's Admin interface.

    • By invoking the obtain_auth_token view.

    • Using the djoser endpoint /token/create/.

  8. True or False: TokenAuthentication is more secure than SessionAuthentication.

    • True

    • False

  9. How can you check which git branch you are currently checked out to? Select all that apply.

    • By using the git branch command.

    • By using the git checkout command.

    • By using the git status command.

    • By using the git list command.

  10. What are the similarities between the project-level urls.py file and the app-level urls.py file? Select all that apply.

    • You can register the viewset URLs in both files.

    • Both have a list object called urlpatterns defined.

    • You can register the admin app in both.

    • You can use both of them to set the ROOT_CONF variable in the settings.py file.

  11. When defining a model, sometimes there is a field in the model that is used as a unique identifier in another model, used to create relationships between them. This is called what?

    • CharField

    • Foreign Key

    • Primary Key

    • Relationship

  12. When building a model in Django, first we create the model and then run manage.py makemigrations. What does this do?

    • Creates the model as a table in SQL.

    • Creates a new database and readies it to receive data.

    • Creates the migration scripts to be run.

    • Shows all of the migrations that have been created.

  13. Once Python is installed and a virtual environment is set up, what is the command to install Django into the currently active environment?

    • pip3 django-install

    • django-admin install django

    • python3 install django

    • pip3 install django

  14. When the ORM is used in Django to run a query against the database, what format are the results returned in?

    • XML

    • JSON

    • QuerySet

    • HTML

  15. To help users with completing a form, some text can be defined to provide guidance on how to complete a specific field. What property is used to define this?

    • label

    • help_text

    • required

    • initial

  16. When models are created and registered in Django and all the migrations are properly run, how are initial permissions created in Django Admin?

    • The model must specifically define the permissions.

    • An additional command must be run from the command line.

    • A “staff” user must login to Django Admin and create them.

    • They are create automatically.

  17. What is the modern, native API used in Javascript used to interact with APIs?

    • Axios

    • XMLHttpRequest

    • jQuery

    • fetch

  18. On an existing HTML page, all <h2> tags on the page need to be updated with content retrieved from a database. What Javascript code would be used to select all <h2> tags?

    • document.get(‘h2)

    • page.select(‘h2’)

    • document.querySelector(‘h2’)

    • document.querySelectorAll(‘h2’)

  19. What SQL command would be used to remove all records from a table while leaving the structure of the table intact?

    • DROP

    • TRUNCATE

    • ALTER

    • UPDATE

  20. What part of a conditional statement is only executed when no other conditions in the statement are met?

    • else

    • if

    • except

    • elif

  21. If an object is created inside of a function in Javascript, it is a member of which scope?

    • global

    • block

    • class

    • local

  22. A request is made to an API endpoint. The URL contains information needed to determine some business logic on the back end. What property of the request object can be used to get this information?

    • path

    • FILES

    • COOKIES

    • user

  23. What special character matches zero or more characters while using Regular Expressions?

    • * (asterisk or star)

    • # (hash)

    • ^ (caret)

    • + (plus)

  24. If the web server is taking a long time to respond to a request and seems to have failed, an error in which range may be displayed?

    • 100-199

    • 500-599

    • 400-499

    • 200-299

  25. Which of the following are scopes in Python? Select all that apply.

    • Block

    • Enclosed

    • Built-in

    • Function

  26. The process of writing a Python application by first writing tests, and then writing code to ensure that the tests pass is called what?

    • continuous deployment

    • Agile development

    • continuous integration

    • test-driven development

  27. Which package provides Django's authentication and authorization system?

    • django.contrib.auth

    • django.apps

    • django.core.wsgi

    • django.contrib.admin

  28. Where does a client specify the data type (like JSON or XML) it would like to receive when asking for data?

    • response headers

    • request payload

    • request headers

    • URL path

  29. For a given <div> tag and <p> tag, which of the following has the correct syntax for an adjacent sibling combinator?

    • div > p

    • div + p

    • div p

    • div ~ p

  30. What type of algorithm grows depending on the size of the input?

    • exponential time algorithm

    • logarithmic time algorithm

    • constant time algorithm

    • linear time algorithm