frontend Flashcards

(28 cards)

1
Q

what is HTML?

A

Hyper Text Markup Language
- Markup language (system of instructions, indicates structures and formatting of document) that consists of tags.
- Defines the structure of web pages
- Basic building block of web page (used to display text, images, and other content)

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

What are semantic elements in HTML?

A
  • Elements that contain the meaning of the content and structure of the HTML document (contain content related to their names)
  • header, main, section, article, footer
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

Difference between inline and block elements

A

Inline:
- Doesn’t start on new line
- Takes up only as much width as necessary
- Cannot contain block elements
- Height and width are usually not adjustable
- ex: span, a, strong, em

Block:
- Always starts on a new line
- Takes up the full width available
- Can contain both inline and block elements
- Height and width can be set freely
- div, p, h1, h2, h3, h4, etc

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

What is a list in HTML? Explain different types of lists available in HTML

A
  • Used to represent a collection of different items

Unordered List:
- ul and li, represented with bullet point

Ordered List:
- ol and li, represented with numbers

Definition List
- used to list terms with definition in structured way, defined using the dl (definition list), dt (definition term), and dd (definition description)

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

Difference between div and span

A

Div:
- Block element
- used to group and structure content of the webpage
- starts from a new line and takes up full width available

Span
- inline element
- mainly, used to interact with and style a particular part of the web page
- does not start from a new line and takes up width of the content

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

What is a DOCTYPE declaration?

A
  • Document type declaration, defines the document type and tells browser which version of HTML the document is written in
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

Difference between b and strong tags

A

Both used to make text bold.
b used only to highlight the text
strong used to indicate the importance of the text (for people who can’t see, accessibility)

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

What are meta tags?

A
  • used to define the metadata about HTML document
  • character set, description, keywords, author, viewport settings [placed in head element]
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

Explain tags in HTML

A
  • tags are used to define the elements on the web page
  • keywords that are enclosed in angle brackets
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

What is CSS?

A

Cascading Style Sheets
- used to design and style the web page to make it attractive for users
- describe how the element should be displayed on the screen
(some of the CSS selectors: element selectors, class selectors, id selectors, universal selectors)

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

Explain selectors in CSS

A
  • used to select elements and style the element by providing CSS properties to them.
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q

Name/explain the different CSS selectors

A

element selector:
- select all elements directly by using the name of the element

id selector:
- selects a single element using # followed by the id attribute name

class selector:
- selects all elements that have the class name in their class attribute using . followed by class name

universal selector:
- selects all elements by using *

attribute selector
- element[attributeName]
- selects certain elements based on attribute names and/or values

direct child selector
- element > element
- selects child element of a parent element

pseudo (class) selector
- lets you style a specific state of a selected element
- ex: button:hover

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

Difference between CSS Grid and Flexbox

A

Grid
- two dimensional layout
- controls rows and columns
- suitable for complex, structured layouts
- allows item placement anywhere in the grid
- can define both rows and columns together

Flexbox
- one dimensional layout
- controls EITHER row or column, not both
- ideal for simple, linear layouts
- items follow the document/source order
- defines layout in a single direction

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

What is the use of the float property?

A
  • it allows you to set the child elements of a container either on the left or the right side of the parent element
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
15
Q

What is JavaScript?

A
  • a scripting and programming language (scripting when used in browser) (programming used in Node.js, React, to build full apps and servers)
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
16
Q

Difference between scripting and programming language

A

scripting:
- type of programming language that automates tasks (make a computer do tasks by itself, without you having to manually do it each time [ex: renames 100 files instead of you doing it one by one, or browser script that auto-saves when you type in a form]) and is usually interpreted
- interpreted (line by line) [interpreted = code is read and executed line by line at runtime (program is actively executed)]
- slower due to interpretation
- automate tasks, enhance existing apps
- often runs inside another program (like a browser)
- javascript, python, bash, php

programming:
- language used to create software
- compiled (or can be compiled + interpreted) [compiled = code is translated into machine code (binary) (something the computer’s processor can understand directly) before it’s run]
- typically faster when compiled
- build standalone software/applications
- can run independently
- Java, C++, C#, Go

(all scripting languages are programming languages, but not all programming languages are scripting languages)

17
Q

Difference between var, let, const

A

var
- function-scoped (variables declared with var are accessible throughout the entire function in which they are declared)
- can be reassigned and redeclared (within their scope)
- are hoisted to the top of their scope (they can be accessed before they are declared, but their value will be undefined until the declaration line is reached)
- does not have TDZ (Temporal Dead Zone)

let
- block-scoped (variables declared with let are only accessible within the block [if statement, for loop, any other block of code enclosed in curly braces] where they are defined
- can be reassigned but not redeclared within their scope
- are hoisted, but are not initialized (accessing them before the declaration line results in a ReferenceError
- does have TDZ (period when a variable declared with let or const is in scope but not yet initialized)

const
- block-scoped
- cannot be reassigned (if it holds an obj or arr, the properties or elements of that obj/arr can be changed)
- are hoisted, but are not initialized. Leading to ReferenceError if accessed before declaration
- does have TDZ

18
Q

Difference between == (loosely equals) and === (strictly equals)

A

==
- checks values of operands and if the value is the same it’ll return true regardless of if the data type is the same or not
- compares 2 values
- ex: 5 == ‘5’ returns true

===
- compares values and types
- ex: 5 === ‘5’ returns false

19
Q

What are the data types?

A

Primitive Data Types (stored by value)
- number
- string
- boolean
- null
- undefined
- bigInt (represents integers beyond the limits of Number type)
- symbol (unique and immutable value [used in objects, often object keys])

Non-Primitive Data Types (stored by reference, aka reference data types [stores a reference (pointer) to the actual value in memory, not value itself])
- Object
- Array
- function

20
Q

What is the DOM?

A

Document Object Model
- tree-like structure that represents the contents of a web page (HTML elements, turned into javascript objects)
- allows us to manipulate the elements and attributes, and content of a web page ( JS can access and change any part of the page using the DOM )
( browser reads the HTML and turns it into a DOM, so JS can interact with and change the page )

  • live (real-time) in memory REPRESENTATION of the page
  • allows dynamic changes to the structure, content, and style of page
21
Q

Difference between null and undefined

A

null
- variable has been intentionally set to have no value
- clear or reset a variable on purpose (by you)

undefined
- variable is declared but not given a value (variable declared, no value yet)
- or when a function doesn’t return anything
- set by JS (automatically)

22
Q

What is React?

A
  • an open-source front-end JS library (created by Facebook)
  • used to build user interfaces (ui) based on components (REUSABLE piece of code that represents a part of a ui)

key features of React
- component-based architecture
- virtual DOM
- JSX (javascript xml)
- one-way data binding
- single page application (SPA)
- state management

23
Q

What is XML?

A

Extensible Markup Language (does not DO anything, information wrapped in tags)
- markup language used for storing and transporting data (text-based format used to store and share structured data)
- looks like HTML but it’s for data not web pages
- way to describe and organize data using custom tags

24
Q

What is JSX?

A

JavaScript XML
- syntax extension for JavaScript that allows you to write HTML like code within JS files, particularly when working with React library
- then React compiles the code into pure JavaScript that can be rendered by the browser

25
Explain the building blocks of React
components - JS functions that return JSX JSX - allows you to write HTML in React/JavaScript files Props - props are like function parameters, allows you to pass data between components - read-only State - data that can change over time - makes components dynamic and interactive Hooks - special function that lets you use React features in components - ex: useState, useEffect Virtual DOM (virtually created DOM) - lightweight copy of actual DOM that React uses behind the scenes - React updates the virtual DOM first - then finds the differences and updates the only changed parts of the real DOM (making react fast and efficient)
26
What is Git? What does is do?
- a version control system that helps developers to track changes in code over time and collaborate with others what does it do (keeps a history of all changes in your project lets you create branches to try new things without affecting main code/branch helps merge changes from different people works with services like GitHub to store code online)
27
What are the advantages of using Git?
- version control: tracking and managing changes in the code (save versions, like checkpoints) - go back to earlier versions if needed - see what changed, when, and by who - work on features without breaking the main version - combine code from multiple people safely - collaboration: many developers can work together on the same project
28