Module-2 Flashcards

1
Q

What is a client?

A

Hardware or software requesting functionality or services.

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

What is a server?

A

Hardware or software that provides functionality and services to clients.

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

What http method does the browser issue to a web server when they visit a url?

A

GET method.

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

What are three things on the start-line of an HTTP request message?

A

HTTP method, the request target, and HTTP version.

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

What are three things on start line of the response message?

A

Protocol version, a status code, a status text.

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

What are HTTP headers?

A

They allow the client and server pass additional information.

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

Is a body required for a valid HTTP request or response message?

A

No.

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

What is Ajax

A

AJAX is a technique that loads data into part of a page without having to refresh.

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

What does Ajax acronym stand for?

A

Asynchronous JavaScript and XML

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

Which object is built into the browser for making HTTP requests in JS?

A

XMLHttpRequest

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

What event is fired by XMLHttoRequest objects when they are finished loading the data from the server?

A

onLoad.

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

What is code block? What are some examples of a code block?

A

Code block are the code inside of curly braces. For example, functions, if and for statements.

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

What does block scope mean?

A

Block scope means local scope. Inside the curly braces.

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

What is the scope of a variable declared with const and let?

A

Const and let variables are block scope.

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

What is the difference between let and const?

A

The variables declared by let are mutable, and const are not mutable.

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

Why is it possible to push() a new value into a const variable that points to an Array?

A

Arrays are mutable.

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

How should you decide on which type of declaration to use?

A

If you intend to change the variable at some point, then use let, and if you don’t intend to change the variable then use const.

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

What is the syntax of writing template literals?

A

Enclosing the string statement with backticks.

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

What is string interpolation?

A

Substituting parts of a string with values of a variable or expression.

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

What is destructuring, conceptually?

A

Destructuring an object or array, and assigning one or more properties or indexes to individual variables.

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

What is the syntax for object destructuring?

A

The object name is on the right side of the initializer, with the const or let var on the left, followed by an opening bracket followed by the variable names of the indexes of the destructured array.

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

What is the syntax for Array destructuring?

A

The array name is on the right side of the initializer, with the const or let var on the left, followed by an opening bracket followed by the variable names of the indexes of the destructured array.

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

How can you tell the difference between destructuring and creating Object/Array literals?

A

destructuring has the curly braces before the assignment operator and Object/Array literals have the curly braces after the assignment operator.

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

What is the syntax for defining an arrow function?

A

The parameters are before the arrow, followed by either a statement within code block, or an expression which does not need to be within a code block. If code block is used then the return keyword needs to be specified.

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

What is CLI?

A

Command line interface: processes commands to program in the form of lines of text.

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

What is GUI?

A

Graphical user interface: a type of user interface that allows the user to interact with electronic devices through graphical icons, and audio indicator.

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

What is “man” used for?

A

Manual: man is in interface to the on-line reference manuals.

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

What is “pwd” used for?

A

Print working directory: displays the path to a local folder on the computer’s disk.

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

What is “cat” used for?

A

Concatenate files and print on the standard output.

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

what is “ls” used for?

A

List directory contents

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

What is “pwd” used for?

A

Print working directory: prints name of current/working directory.

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

What is “echo” used for?

A

Display a line of text.

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

What is “echo” used for?

A

Display a line of text. Echos strings to standard output.

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

What is “mkdir” used for?

A

Make directories: create a directory that does not already exist.

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

What is “rm” used for?

A

Remove a file

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

What is “mv” used for?

A

Move/rename files. Rename source to DEST, or move sources to directory.

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

What is “rm” used for?

A

Remove a file or directory.

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

What is “cp” used for?

A

Copy files and directories.

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

What are the three virtues of a great programmer?

A

Laziness, impatience, and hubris.

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

What is Node.js?

A

Node.js is a program that allows JS to be run outside of a web browser.

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

What can Node.js be used for

A

Node.js can be used to build backend for web apps, command-line programs, and any kind of automation that developers may use.

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

What is a REPL?

A

Read-eval-print loop: an interactive programming environment that takes single user inputs, executes them, and returns the result to the user.

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

When was Node.js created?

A

Node.js was created in 2009.

44
Q

What back end languages have you heard of?

A

Node.js, Ruby, PHP, Python, Java, Perl, Rust

45
Q

What is a computer process?

A

Computer process is the occurence of a program that is being executed by one or many threads.

46
Q

Why should a full stack Web Developer know that computer processes exist?

A

A full stack developer should know that computer processes exist because web development is based on making multiple processes work together to form one application.

47
Q

What is the process object in a Node.js program?

A

The process object is a global object that provides information about, and control over the current Node.js process, always available to Node.js applications without using require().

48
Q

How do you access the process object in a Node.js program?

A

The process object in a Node.js program can be accessed using require() function.

49
Q

What is the data type of process.argv in Node.js?

A

Data type of process.argv: array.

50
Q

What is a JavaScript module?

A

A Javascript module is a JavaScript file.

51
Q

What values are passed into a Node.js module’s local scope?

A

__dirname, __filename, exports, require.

52
Q

Give two examples of truly global variables in an Node.js program.

A

Process, console, setTimeout, setInterval, data types.

53
Q

What is the purpose of module.exports in a Node.js module?

A

The purpose of module.exports in a Node.js module, is to export the content in the module to another module.

54
Q

What is the JavaScript event loop?

A

The JavaScript event loop is the process of

55
Q

What is the JavaScript event loop?

A

Redo! The JavaScript event loop is the process that JavaScript code is executed, running in sequence from top to bottom.

56
Q

What is different between “blocking” and “non-blocking” with respect to how code is executed?

A

The difference between blocking and non-blocking is that blocking blocks code execution until the operation has finished, while non-blocking code does not block code execution. Blocking methods execute synchronously and non-blocking execute non-synchronously.

57
Q

What is a directory?

A

A directory is an object of a list of file names.

58
Q

What is a relative path?

A

A relative path contains the information to locate a file in relation to the current working directory.

59
Q

What is an absolute path?

A

An absolute path contains the complete information needed to locate a file or directory.

60
Q

What module does Node.js include for manipulating the file system?

A

The file system module.

61
Q

What method is available in the Node.js fs module for writing data to a file?

A

WriteFile method.

62
Q

Are file operations using the fs module synchronous or asynchronous?

A

Asynchronously.

63
Q

What is a client?

A

A client is hardware or software that accesses a service that is available by a server.

64
Q

What is a server?

A

A server is hardware or software that shares services, such as data or resources to clients.

65
Q

Which HTTP method does a browser issue to a web server when you visit a URL?

A

Get method.

66
Q

What is on the first line of an HTTP request message?

A

Startline, includes: 1) an HTTP request method (GET, PUT, POST), 2) the request target such as a URL, 3) the HTTP protocol/version.

67
Q

What is on the first line of an HTTP response message?

A

Start/status line containing: 1) the protocol version, 2) a status code, 3) a status text

68
Q

What are HTTP headers?

A

HTTP headers let the client and server pass additional information with a request or response. Meta information.

69
Q

What is NPM?

A

NPM is the world’s largest software registry.

70
Q

What is a package?

A

A directory with one or files of reusable code.

71
Q

What is a package?

A

A directory with one or more files of reusable code.

72
Q

How can you create a package.json with npm?

A

You enter the npm keyname into the command line, then init, the initializer, then enter dash dash yes or y, –yes.

73
Q

What is a dependency and how do you add one to a package?

A

Dependencies are packages that are required by the application in production. Use to npm install to add a package.

74
Q

What happens when you add a dependency to a package with npm?

A

A dependency is added to the json file, and a node module is created.

75
Q

How do you add express to your package dependencies?

A

Express is added to package dependencies by creating a package.json file, then installing the express package with npm install express.

76
Q

How do you mount a middleware with an Express application?

A

A middleware is mounted with an express application with the use method.

77
Q

Which objects does an Express application pass to your middleware to manage the request/response lifecycle of the server?

A

The request and response objects. Examples: get method, json method, and use.

78
Q

What is the appropriate Content-Type header for the HTTP messages that contain JSON in their bodies?

A

application/json

79
Q

What is the significance of an HTTP request method?

A

The HTTP request method describes the action that is being performed, such as GET, PUT, POST, or DELETE.

80
Q

What does the express.json() middleware do and when would you need it?

A

The express.json() middleware parses requests with json payloads when the content-type header matches the type option.

81
Q

What is PostgreSQL and what are some alternative relational databases?

A

PostgreSQL is an open source object-relational database system that uses and extends the SQL language. Alternative databases include Redis, MongoDB, Elasticsearchm Firebase, and DynamoDB.

82
Q

What are some advantages of learning a relational database?

A

Accesses many records with one single command, eliminates the need to specify how to reach a record,

83
Q

What is one way to see if PostgreSQL is running?

A

The top command in the command line.

84
Q

What is a database schema?

A

A database schema is a collection of tables that is defined how the data in a relational database should be organized.

85
Q

What is a table?

A

A table is a list of rows that have the same set of attributes.

86
Q

What is a row?

A

A row lists the data of the object’s attributes.

87
Q

What is SQL and how is it different from languages like JavaScript?

A

SQL is the structured query language, that is a domain specific language used for managing data in a relational management system. SQL is a declarative programming language.

88
Q

How do you retrieve specific columns from a database table?

A

Specific columns are retrieved by using a select statement.

89
Q

How do you filter rows based on some specific criteria?

A

Rows are filtered by using a where clause.

90
Q

What are the benefits of formatting your SQL?

A

You can access large amounts of data efficiently, and specific data can be accessed differently compared to other languages.

91
Q

What are four comparison operators that can be used in a where clause?

A

equal (=), greater than () and not equal (!=).

92
Q

How do you limit the number of rows returned in a result set?

A

You use a limit clause.

93
Q

How do you add a row to a SQL table?

A

A row is added to a SQL table with an insert statement.

94
Q

What is a tuple?

A

A tuple is the list of values that are being added to a row with an insert statement.

95
Q

How do you add multiple rows to a SQL table at once?

A

Multiple rows can be added to SQL table at once by adding additional tuple values.

96
Q

How do you update rows in a database table?

A

Rows are updated with and update statement followed by a set statement, then a where clause to identify the specific row to update.

97
Q

How do you accidentally delete all from a table?

A

All from a table is accidentally deleted by not specifying a row to delete with a where clause.

98
Q

How do you delete rows from a database table?

A

Rows are deleted from a table with a delete statement, and a where clause to identify which rows to delete.

99
Q

What is a foreign key?

A

A foreign key is a link between multiple tables. For example, an id that can be referenced between multiple tables.

100
Q

What is a foreign key?

A

A foreign key is a link between multiple tables. For example, an id of a column that can be referenced between multiple tables.

101
Q

How do you join two SQL tables?

A

Two SQL tables are joined with using a select statement then a from clause to select a table to join the second table with a join clause. They can be joined by common column, such as an id.

102
Q

How do you temporarily rename columns or tables in a SQL statement?

A

Columns and tables can be temporarily renamed with an alias.

103
Q

What are some examples of aggregate functions?

A

max(), avg(), count(), max(), min(), sum()

104
Q

What is the purpose of a group by clause?

A

The group by clause allows us to specify how we want our returned values of the aggregate functions to be grouped.

105
Q

What are the three states a Promise can be in?

A

Three states that a Promise can be: Pending, fulfilled, or rejected.

106
Q

How do you handle the fulfillment of a Promise?

A

You use a then method to perform an action.

107
Q

How do you handle the rejection of a Promise?

A

A then method or catch method can be used to handle a rejection of a Promise.