Web Development Basics Quiz
23 Questions
0 Views

Choose a study mode

Play Quiz
Study Flashcards
Spaced Repetition
Chat to Lesson

Podcast

Play an AI-generated podcast conversation about this lesson

Questions and Answers

Which HTTP request method is primarily used to send data to the server to create or modify a resource?

  • OPTIONS
  • PUT (correct)
  • GET
  • HEAD

What type of HTTP polling involves a client maintaining a persistent connection with the server until new data is available?

  • Long polling (correct)
  • Conditional polling
  • Partial polling
  • Short polling

What does an HTTP status code in the 4xx range indicate?

  • Successful request
  • Server error
  • Redirection
  • Client error (correct)

Which HTML tag is used to provide alternative text for an image, primarily for screen readers?

<p><alt> (A)</p> Signup and view all the answers

What is the function of the CSS pseudo-element ::after?

<p>To insert content after the regular content of an element. (C)</p> Signup and view all the answers

What characteristic of JavaScript allows for implicit type conversion when mismatched types are encountered?

<p>Its weakly typed nature. (D)</p> Signup and view all the answers

Which variable declaration keyword in JavaScript is block-scoped and allows reassignment of its value?

<p><code>let</code> (C)</p> Signup and view all the answers

When comparing two values in JavaScript, which operator performs type conversion before the comparison?

<p>== (A)</p> Signup and view all the answers

Which of the following is the correct syntax for a ternary operator in JavaScript?

<p>[condition] ? [value if true] : [value if false] (B)</p> Signup and view all the answers

In the context of RESTful API design, what does the principle of 'statelessness' mean?

<p>The server does not retain client's state between requests. (D)</p> Signup and view all the answers

Which HTTP header is commonly used for providing authentication information in the HTTP Basic authentication scheme?

<p>Authorization (B)</p> Signup and view all the answers

According to typical REST API endpoint rules, how should a collection of resources be represented in a URI?

<p>Using plural nouns such as <code>/users</code>. (B)</p> Signup and view all the answers

Which of these is not a valid method for REST API authentication?

<p>Cookie-based (A)</p> Signup and view all the answers

If given a string "123.45", which JavaScript function would correctly convert this string to a floating point number?

<p><code>parseFloat()</code> (A)</p> Signup and view all the answers

What does the term 'code-on-demand' refer to in the context of RESTful APIs?

<p>The server can send code upon request from client to reduce pre-implemented functionality. (C)</p> Signup and view all the answers

Which of the following best describes the primary function of middleware in an Express application?

<p>To intercept and process requests and responses before they reach their final handlers. (A)</p> Signup and view all the answers

In the context of web application security, which of the following is NOT a common measure?

<p>Bypassing user input validation (C)</p> Signup and view all the answers

What is the primary advantage of Node.js's asynchronous and event-driven architecture?

<p>It enables tasks to work independently and in parallel, improving speed and scalability. (D)</p> Signup and view all the answers

Which of the following best describes the role of the 'Model' in the MVC architectural pattern?

<p>To manage and perform all database-related logic. (C)</p> Signup and view all the answers

What is the key concept behind React's use of a virtual DOM?

<p>To create a copy of the DOM in memory and update only the necessary changes. (C)</p> Signup and view all the answers

In React, what is the primary purpose of the useEffect hook?

<p>To perform side effects (such as data fetching) that depend on certain values. (D)</p> Signup and view all the answers

Which of the following is NOT a typical advantage of using established design patterns?

<p>Increased risk of introducing errors. (B)</p> Signup and view all the answers

What is the main difference between require('fs') and require('http') in Node.js?

<p><code>require('fs')</code> is for file system operations, while <code>require('http')</code> is for handling HTTP requests. (B)</p> Signup and view all the answers

Flashcards

Short Polling

A client sends small, frequent requests to the server, expecting an immediate response. This is useful for scenarios where real-time updates are needed, but frequent requests might burden the server.

Long Polling

A client maintains an open connection with the server, waiting for the server to send new data. This is more efficient than short polling, but requires the client to hold the connection until the server responds.

HEAD Request

An HTTP request asking for only the headers of a resource, without downloading the actual content. This is useful for checking if a resource exists or getting information about it without retrieving the entire data.

PUT Request

An HTTP method that allows a client to create a new resource on the server. This is typically used for creating new entries in a database or uploading files.

Signup and view all the flashcards

::after Pseudo-element

A CSS pseudo-element that inserts content after the regular content of a selected element. Used for styling and adding supplementary content.

Signup and view all the flashcards

Input Validation

A method to protect web applications from malicious inputs by sanitizing user-supplied data before it is processed. It helps prevent attacks like SQL injection and cross-site scripting (XSS).

Signup and view all the flashcards

Output Encoding

A technique to prevent malicious scripts from being executed within a web application. It involves encoding user-supplied data before displaying it on the web page to render it harmless.

Signup and view all the flashcards

Rate Limiting

A security measure that limits the number of requests a client can make to a server within a specific timeframe. It prevents DoS attacks and resource exhaustion.

Signup and view all the flashcards

NodeJS

A JavaScript runtime environment built on Chrome's V8 engine, known for fast execution speeds and its asynchronous, event-driven nature. It allows for creating server applications and web servers.

Signup and view all the flashcards

Express

A minimal web application framework built for NodeJS, simplifying the process of handling requests, rendering views, and connecting to databases.

Signup and view all the flashcards

MVC (Model-View-Controller)

A design pattern widely used to organize software development, separating concerns into three distinct parts: Model, View, and Controller.

Signup and view all the flashcards

React

A JavaScript framework that manages the user interface (UI) of web applications by creating a virtual DOM (Document Object Model) in memory. It only updates the necessary parts of the UI, improving performance.

Signup and view all the flashcards

useState

A React hook used to declare state variables that affect the UI. Whenever the state variable changes, React re-renders the component.

Signup and view all the flashcards

Javascript: Interpreted

Javascript is an interpreted language which doesn't need to be compiled into machine code before execution.

Signup and view all the flashcards

Javascript: Weak Typing

Javascript supports weak typing, meaning you can assign different data types to the same variable without explicit type declaration.

Signup and view all the flashcards

Javascript: Variable Declarations

Javascript lets you declare variables using var, const, and let, each having different scoping and mutability properties.

Signup and view all the flashcards

Javascript: Const

In JavaScript, const variables are block-scoped and cannot be reassigned, however the values of objects and arrays can be modified.

Signup and view all the flashcards

Javascript: Ternary Operator

The ternary operator provides a concise way to write conditional expressions in one line.

Signup and view all the flashcards

REST APIs: Definition

REST APIs utilize HTTP requests to access and manipulate resources, with uniform conventions for resource identification, data exchange, and communication.

Signup and view all the flashcards

REST APIs: Statelessness

REST APIs rely on statelessness where the server doesn't maintain client context between requests, ensuring scalability and efficiency.

Signup and view all the flashcards

REST APIs: Layered System

REST APIs use a layered system to abstract complexity, allowing each layer to focus on its specific responsibilities.

Signup and view all the flashcards

REST API Authentication: API Key

API Keys are secret codes that grant access to APIs for authentication and resource control.

Signup and view all the flashcards

REST API Endpoints: Rules

REST API endpoints should follow specific rules, such as using nouns for resources, plural nouns for collections, and consistent naming conventions.

Signup and view all the flashcards

Study Notes

HTTP Requests

  • Partial get request: retrieves a portion of information
  • Conditional get request: determines if a fresh copy from the server is needed
  • Head request: returns only the header data, not the body
  • Options request: specifies allowed HTTP methods
  • Put request: uploads documents to the server
  • Delete request: deletes data from the server

HTTP Polling Types

  • Short polling: client sends frequent small requests; server responds immediately
  • Long polling: client maintains a connection; server responds when new data is available

HTTP Status Codes

  • 200: OK (request successful)
  • 201: Created (resource created successfully)
  • 204: No Content (request successful, no content to return)
  • 401: Unauthorized (client not authenticated)
  • 402: Payment Required
  • 403: Forbidden (client lacks permission)
  • 404: Not Found (resource not found)
  • 500: Internal Server Error (server error)
  • 1xx: Informational (server is processing the request)
  • 2xx: Successful (request completed successfully)
  • 3xx: Redirection (client needs to make a further request)
  • 4xx: Client Error (client-side issue)
  • 5xx: Server Error (server-side issue)

HTML

  • Hyperlinks: allow immediate activation of links
  • Meta tags: provide descriptions of HTML files
  • Viewport: defines a viewport for the HTML file
  • <em>: emphasizes a particular meaning in a sentence
  • <i>: emphasizes a term (e.g., technical term)
  • <strong>: highlights important information
  • <b>: draws attention, but doesn't indicate importance

Other

  • <b>: draws attention without indicating importance (HTML tag)
  • Self-closing HTML tags (e.g., <br>)
  • Nested lists (<li> within <li>, <ol> within <ol>)
  • List types in <ol>, type=1, type=i
  • List starting points using start attribute
  • Reversed lists <ol reversed
  • Alternative text (alt) for screen readers

CSS

  • Pseudo-elements (::after): add content after existing content
  • rem vs em: different units of measurement in CSS

JavaScript

  • Dynamic vs. interpretive scripts
  • Weakly typed languages
  • Cross-platform capability
  • Automatic declaration styles vs redeclaration
  • var (less preferred) vs. const (block scoped)

REST APIs

  • Uniform interface
  • Unique URIs
  • Resource manipulation through representations
  • Hypermedia
  • Statelessness
  • Client-server architecture (separation between client and server which improves scalability)
  • Cacheability (responses can be marked cacheable to improve performance)
  • Layered system
  • Code-on-demand
  • Design patterns in React, MVC, Model, View, Controller, and virtual DOM
  • useState vs useEffect

Node.js and Express

  • Node.js execution environment in Chrome’s JavaScript runtime (speed and efficiency)
  • Asynchronous and event-driven (speeds up tasks)
  • Highly scalable and non-blocking operation

Design Patterns and Frameworks

  • Why use existing design patterns? (saves time and effort, reduces errors)
  • Design pattern benefits
  • Provide clear steps for solutions to common problems.
  • Useful real-world scenarios

React (JavaScript Framework)

  • Virtual DOM (lightweight in-memory representation of the actual DOM)
  • useState for declaring variables affected by state changes
  • useEffect for writing code with data dependencies

WebSockets

  • HTTP limitations (server intensity, message ordering, and latency)
  • WebSockets benefits (increased bandwidth, reduced latency, improved scalability)

Security Considerations

  • Authentication and authorization
  • HTTPS (SSL/TLS)
  • Cross-Origin Resource Sharing (CORS)
  • Token expirations and refresh
  • Input validation
  • Output encoding
  • Rate limiting

Studying That Suits You

Use AI to generate personalized quizzes and flashcards to suit your learning preferences.

Quiz Team

Related Documents

HTTP Concepts PDF

Description

Test your knowledge of web development concepts with this quiz covering HTTP methods, polling techniques, HTML tags, and CSS. Challenge yourself to understand how these components interact to create dynamic web experiences.

More Like This

HTML Form Creation Quiz-Grade8
3 questions
HTTP Methods and HTML Forms
10 questions

HTTP Methods and HTML Forms

ResponsiveSilicon6883 avatar
ResponsiveSilicon6883
Use Quizgecko on...
Browser
Browser