Python.

  • What is Python? It is an intepreted, object-oriented, high level programming language.

  • In what areas can we use the Python Language? Python can be used in areas such as data analysis and machine learning as well as building mobile and web applications.

  • What is the disadvantage of using Python compared to other compiled languages like Java?

    • Difficulty in Using other languages for developers.
    • Weak in mobile computing.
    • Gets slow in Speed as it uses an interpreter rather than a compiler.
    • Run time errors and requires more testing.
    • Underdeveloped database Access layers unlike JDBC and ODBC.
  • Define a Python module, script and package.

    • A script is a directly executable piece of code run by itself.
    • A module is a library, imported by other pieces of code.
    • A package is a directory of Python modules.
  • What is the difference in using Python 2+ and Python 3+? Python3+ is a newer version of Python however Python2+ has more third party libraries compared to Python3.

  • Name the top 3 programmer caused Python errors.

    • Syntax errors.
    • Runtime errors.
    • Logical errors.
  • What is the difference between a list and a tuple ? A list is a data structure which contains homogeneous data which can be changed while a tuple is a data structure which cannot be changed or immutable

  • What is a set? It is an unordered collection of unique and immutable objects

  • Name the various data types in Python.

    • Numbers.
    • String.
    • List.
    • Tuple.
    • Dictionary.
  • What is a decorator? It is a function that takes another function and extends the behavior of the latter function without explicitly modifying it

  • Define pypi? It is a repository of software for python. It helps find and install software developed and shared in the community

  • What is the difference between Python built in modules and external modules? Built in modules provide access to system functonality that would otherwise be inaccessible to developers while, external modules provide functionalitites that are not available in built in modules but are stored in the PyPI repository.

  • What is flask? It is a python framework used to design web apps with python.

  • How does flask differ from other frameworks? It has very few dependencies out of the box and this allows developers to have creative control of their apps.

  • What comes built in in flask?

    • Werkzeug - This provides flask with routing,debugging and web server capabilities.
    • Jinja 2 - This provides template support for flask.
  • What is a virtual environment and why is it useful? A virtual environment is a private copy of the Python interpreter that allows developers to install packages in a virtual or private environment so that third party modules will only be available in that environment. It is important because it prevents the packages from conflicts.

  • What is a template? A template is a document with placeholders where the actual data will be used.

  • What is a view function? This is a function that renders data on a template.

  • Define a http request? This is a way in which a server interacts with an application. There are two main request i.e GET and POST request methods.

  • What is a flask extension? This is a third party module that allows developers to add functionalities and features to their app.

  • What is a Model ? It is a way of abstracting and giving common interface to data.

  • What is an ORM and how does it differ from conventional ways of interacting with a database? Object Relational Mappers is a code library that automates the transfer of data stored in relational databases tables into objects that are more commonly used in application code. It provides a high-level abstraction that allows a developer to write python code instead of SQL

  • What is needed to connect to SQLALCHEMY? A connection which is psycopg2 and an engine such as postgresql.

  • What is an application factory? An app factory is where all the app extensions are initialized and injected and the app blueprints are registered

  • What is a blueprint? This is a version of the app that performs different functions in the app.

  • How can you connect a blueprint to an application factory?

  • What is a migration file?

  • Why are migration files useful?

  • Why do we use flask-script in our application?

  • Explain the http request response cycle when a person visits a url.

  • State 4 types of responses that can be returned by a view function.

  • What is the purpose of the url_for function?

  • What is the purpose of a requirements.txt file?

  • What are app configurations?

  • How are different kind of variables defined in Jinja2 templates ?

  • What are macros?

  • Define template Inheritance.

  • What are blocks in Jinja templates ?

  • How are templates reused in Jinja2 ?

  • What are variable filters ?

  • How are static files stored in a flask application ?

  • How is authentication managed in a flask application ?

  • What are database sessions ?

  • Describe one-many database relationships.

  • How do you create a one-many database relationship with SQLAlchemy?

  • What is a Foreign Key?

  • What is the difference between a SQL database and a Nosql database?

  • What is the difference between a GET and POST request?

  • What is CSRF and why do we need to protect our applications from it?

  • What is a status code and what do the various status codes mean?