essay questions Flashcards

1
Q

What is a multitier architecture project structure?

A

Is a client–server architecture in which presentation, logic processing, and data management functions are physically separated.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

Describe the purpose of the different files and folders in a multitier architecture web project.

A

A multitier architecture project consists of three different tiers
1. The presentation tier → is the user interface and communication layer of the application, where the end user interacts with the application. Its main purpose is to display information to and collect information from the user. HTML, CSS, and JavaScript files: or files related to returning resource data as a REST API

  1. The business logic tier → In this tier, information collected in the presentation tier is processed. The business logic tier can—so add, delete, or modify data in the data tier. communicates with the data tier using API calls. API files + Server-side code files: This can be written in languages like PHP, Ruby, Python, or Java.
  2. The data tier → The data tier, sometimes called the database tier, data access tier, or back-end, is where the information processed by the application is stored and managed. This can be a relational database management system such as MySQL. Data is accessed by the business logic layer via API calls. Database file as MySQL + Object-Relational Mapping (ORM) files: Model files:
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

What are the benefits and drawbacks of a multitier architecture project structure?

A

Benefits: It has improved security and scalability and is easier to maintain.

Easy to manage: You can manage each tier separately, adding or modifying each tier without affecting the other tiers.

Improved scalability: Any tier can be scaled independently of the others as needed.

Improved security: Because the presentation tier and data tier can’t communicate directly, a well-designed business logic tier can function as a sort of internal firewall, preventing SQL injections and other malicious exploits.

Drawbacks: Increase in Effort / Increase in Complexity

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

What is frontend programming?

A

Frontend development is programming which focuses on the visual elements of a website or app that a user will interact with and sees (the client side).

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

What is backend programming?

A

Backend development focuses on the side of a website users can’t see (the server side).

Backend programming typically involves programming languages such as Java, Python, PHP, Ruby, and Node.js.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

What is HTTP?

A

HTTP (Hypertext Transfer Protocol) is responsible for communication between web servers and clients. HTTP is a request-response protocol, meaning that it is used to request information from a server and receive a response. It is a protocol for transmitting hypermedia documents, such as HTML. It fetches resources such as HTML docs, images, videos, scripts, and more. Gives us rules about how messages should be sent around the internet. HTTP is stateless, meaning that each request/ response pair is independent & does not carry any context from previous requests.
HTTP is responsible for communication between web servers and clients. Every time you visit a webpage, submit a form, click a button, you make a request and get back a response.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

What is the request-, response-cycle in HTTP?

A

HTTP involves a computer making a request for some information at a URL. The HyperText Transfer Protocol gives us rules about how messages should be sent around the Internet. The system that initiates a connection sends a “request”, and the system the answers sends a “response”.
1. User issues a URL into a browser
2. Browser sends a request message
3. Server maps out the URL to the file/program under the document directory
4. Servers sends back a response message
5. Browser formats the respons and displays it to the user

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

What are the four main parts of the HTTP Request

A

HTTP Request
When a client (like a web browser) want to retrieve information, it sends data to a server as a request. This request is made up of four main parts:

1.A Request line (HTTP method)
2. A URI HTTP (Uniform Resource Identifier) that specifies the resource being requested
3.An optional header; that provide additional information about the request
4.An optional body; we only send data to the server in the body when we are creating or modifying something

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

What are the 3 main parts of the HTTP Response

A

When a server or web application is finished processing a request, it sends a response back to the client. This response contains three main parts:

1.a status line
2.Headers, also sent as key/value pairs similar to the HTTP request
3.An optional body; almost all responses will contain additional data in the body.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

What are status codes in HTTP?

A

An HTTP status code is a message a website’s server sends to the browser to indicate whether or not that request can be fulfilled.
When that all goes according to plan the server returns a 200 code.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

what 5 types of codes there and when to use each one.

A

There are 5 ranges of status codes:

1xx: Informational
2xx: Success! - things are working as intended.
- 200: ok - 201: created - 202: accepted - 204 No content
3xx: Redirectional. 301 redirects when you permanently move a page. / 302 tells the browser that the requested page has been found,
4xx: Client error. 404 - not found - 400 - bad request
5xx: Server error. 500: Internal server error

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q

What is a REST API?

A

A REST API is an API that conforms to the design principles of the REST, or representational state transfer architectural style.
Based on client-server communication (like HTTP) a REST API is a set of guidelines that govern the creation of web services using HTTP protocol. The four main components of a REST API are resources, HTTP methods, representations, and URIs.
communicate via HTTP requests to perform standard database functions like creating, reading, updating, and deleting records (also known as CRUD)
REST Architecture communicates between client and server.

1.Clients send HTTP request and wait for responses
2.Rest API receives request from clients and does whatever request need i.e create / update / delete user
3.Response - When the rest API has what it needs, it sends back the response to the clients. This would typically be in JSON or XML format

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
13
Q

List the various HTTP-Methods (GET, POST, PUT, PATCH, and DELETE) and describe the purpose and uses of each one.

A

PATCH - UPDATE a existing part of a resource in a table

POST - CREATE a new resource in a database

PUT - UPDATE an entire resource that exists on the database

GET - retrieve data to be READ by the client/user- GET API should be idempotent, clients can make that same call repeatedly while producing the same result”

DELETE - DELETES a existing resource from database

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
14
Q

What is JSON?

A

JSON stands for JavaScript Object Notation.

JSON is a file format that uses human-readable language to store and communicate data objects. It’s an easy-to-parse and lightweight data-interchange format.

The REST architecture allows API providers to deliver data in multiple formats, such as plain text, HTML, XML, and JSON.

Developers can use libraries or built-in functionality in their programming language to convert data to and from JSON format when communicating with the API.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
15
Q

What is a Client in web development?

A

A client is a piece of computer hardware or software that connects to and accesses the resources of a remote computer, or server. Clients are web browsers (like Chrome, Firefox, and Safari),

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
16
Q

What is a server in web development?

A

A server is a piece of computer hardware or software that provides resources, data, services, or functionality for other programs or devices, called clients.

17
Q

What is the URL structure of a request in a REST API?

A

A REST API is accessed with an endpoint URL. The endpoint URL consists of a base URL, a resource path, and query string.

REST-api URLs http(s)://{base url}/{resource path}?{query string}
✓ Base url: domain or IP and path
✓ Resource Path: address of the API resource
✓ Query string: Additional info about the request

18
Q

What are CRUD operations?

A

CRUD refers to the four basic operations a software application should be able to perform

✓ Create: Save or create a new resource
✓ Read: Display one or more resources
✓ Update: Edit or update one resource
✓ Delete: Delete a resource

19
Q

what is PHP?

A

is an acronym for “PHP: Hypertext Preprocessor.”

Is a widely-used, open source scripting language. PHP scripts are executed on the server.

PHP allows web developers to create dynamic content and interact with databases. PHP is known for its simplicity, speed, and flexibility — features that have made it a cornerstone in the web development world.

20
Q

what is apache?

A

Apache listens for calls from web browsers and, based on those, will send an image, a plain HTML file, or a PHP file. This is a web server software that allows your computer to serve web pages to web browsers. Apache is one of the most popular web servers in the world and is known for its stability and security

Apache is one of the most popular web servers in the world and is known for its stability and security.

21
Q

what is mysql?

A

MySQL is a fast, reliable database that integrates well with PHP and is suited for dynamic Internet-based applications. MySQL is a relational database management system based on SQL – Structured Query Language.

22
Q

What is the difference between a primary key and a foreign key?

A

Primary key: Is a unique identifier for each record in a table (often id): it is used to ensure each record is unique and can be easily references by other tables in a database

Foreign key: Data in one table that references a primary key in another table: it is used to establish a link or relationship between two tables in a database

The keys are used as connections between tables in a relational database. They are established using primary and foreign keys, which allow data to be linked and related across multiple tables.

23
Q

What is and does a table consist of?

A

A defined collection of data (rows) with set properties (columns). Each table consists of rows and columns, where each row represents a specific record or instance of the data and each column represents a specific attribute.

24
Q

What is a relation database?

A

A relational database is a type of database that stores and provides access to data points that are related to one another. A relational database organizes data into rows and columns, which collectively form a table.

Each table consists of columns and rows, where each row represents a specific record or instance of the data, and each column represents a specific attribute.

SQL is the standard language for dealing with Relational Databases.

25
Q

Describe what relations are in the context of tables and relational databases

A

Relations are the connections between tables in a relational database. They are established using primary and foreign keys, which allow data to be linked and related across multiple tables. These relationships could be one-to-one, one-to-many, many-to-one depending on the nature of the data and the way it is organized in the database.

26
Q

What are SQL Injections?

A

SQL injection is a code injection technique that might destroy your database. SQL injection is the placement of malicious code in SQL statements, via web page input.

Prepared statements prevents this - the value is not accessible in the code - fetching it to get the data