Backend Flashcards

1
Q

What is a CLI?
(command-line-basics)

A

CLI stands for Command Line Interface. For developer;

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

What is a GUI?
(command-line-basics)

A

GUI stands for Graphical User Interface. For consumers; that has icons and click based.

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

Give at least one use case for each of the commands listed in this exercise.
man
cat
ls
pwd
echo
touch
mkdir
mv
rm
cp
(command-line-basics)

A

man - Basically a manual.
cat - Prints the content of the file to the terminal.
ls - Prints the list of contents in the directory of your choosing.
pwd - Prints the path of the current working directory.
echo - Prints a line of text, contents of a file, or allows you to put text into a file.
touch - Changes a file’s timestamp and also allows you to create files.
mkdir - Makes a directory.
mv - Moves or renames a file.
rm - Removes a directory and/or file(s).
cp - Copies file(s) or directories.

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

What are the three virtues of a great programmer?
(command-line-basics)

A

laziness, Impatience, Hubris.

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

What is Node.js?
(node-intro)

A

It is a program that allows JavaScript to run outside of a web browser.

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

What can Node.js be used for?
(node-intro)

A

For building scalable network applications.

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

What is a REPL?
(node-intro)

A

Read Evaluate Print Loop

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

When was Node.js created?
(node-intro)

A

May 27, 2009

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

What back end languages have you heard of?
(node-intro)

A

Python, typescript, Ruby, PHP, Node.js, C#, go, haskell, assembly, sql, java, perl

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

What is a runtime?

A

Executed code that you didn’t type yourself.
(the browser, timers, etc.)

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

What’s the difference between a library and a framework

A

Inversion of control
(If you define a function without calling it and instead hand it over to a library that you’re using, then that is a framework). DOM events are a framework.

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

What is forking?

A

The ability for programs to split off and start other programs.

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

What is a computer process?
(node-process)

A

The instance of a computer program that is being executed by one or many threads.

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

Roughly how many computer processes are running on your host operating system (Task Manager or Activity Monitor)?
(node-process)

A

Over 300.

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

Why should a full stack Web developer know that computer processes exist?
(node-process)

A

As developers it’s important to be aware of whether or not a process is happening.

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

What is the process object in a Node.js program?
(node-process-argv)

A

It is a global object of node.

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

How do you access the process object in a Node.js program?
(node-process-argv)

A

console.log or call process.env.

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

What is the data type of process.argv in Node.js?
(node-process-argv)

A

A string array, or an array of strings.

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

What does ctrl+C do while in Node?

A

if you’re in the middle of a line of code, it goes to the next line and node ignores that line of code. If you aren’t, it gives you a prompt to press ctrl+C or ctrl+D to exit node.

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

What does echo $? do?

A

It gives you the status code of the last process (0 for ok and 1 for error).

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

What is a JavaScript module?
(node-module-system)

A

a JavaScript file.

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

What values are passed into a Node.js module’s local scope?
(node-module-system)

A

exports, require, module, __filename, __dirname.

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

Give two examples of truly global variables in a Node.js program.
(node-module-system)

A

The process, global, and console objects.

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

What is the purpose of module.exports in a Node.js module?
(node-require)

A

It’s the instructions that allows us to use data from one module to another.

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

How do you import functionality into a Node.js module from another Node.js module?
(node-require)

A

You use the require function.

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

What is the JavaScript Event Loop?
(the-event-loop)

A

When the JavaScript call stack is empty, the Event Loop pushes completed Asynchronous requests from the callback queue onto the top of the call stack.

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

What is different between “blocking” and “non-blocking” with respect to how code is executed?
(the-event-loop)

A

Blocking means no other code can run before the current call is in effect (Synchronous). non-blocking means the code being executed doesn’t stop other code from running (Asynchronous).

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

What is JavaScript’s runtime’s language?

A

c++

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

What is a client?
(http-messages-recap)

A

It’s a program that is requesting access to a server

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

What is a server?
(http-messages-recap)

A

A program that provides functionality to to clients

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

Which HTTP method does a browser issue to a web server when you visit a URL?
(http-messages-recap)

A

GET request.

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

What is on the first line of an HTTP request message?
(http-messages-recap)

A

HTTP method, target, and protocol version.

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

What is on the first line of an HTTP response message?
(http-messages-recap)

A

HTTP version, status code, status message.

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

What are HTTP headers?
(http-messages-recap)

A

Meta data about the request or response.

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

Is a body required for a valid HTTP message?
(http-messages-recap)

A

Nope.

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

What does the verbose command do?

A

Tells you where that command is if it exists.

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

What is NPM?
(npm-intro)

A

It’s the Website, CLI, or the Registry.

38
Q

What is a package?
(npm-intro)

A

A directory with 1 or more files and a package.json.

39
Q

How can you create a package.json with npm?
(npm-intro)

A

npm init.

40
Q

What is a dependency and how to you add one to a package?
(npm-intro)

A

Refers to the dependency of that package and can be added from the CLI using npm i.

41
Q

What happens when you add a dependency to a package with npm?
(npm-intro)

A

It downloads it from the npm registry, goes into node, and updates the dependency of your package.json.

42
Q

How do you add express to your package dependencies?
(express-intro)

A

You type npm i express into your CLI.

43
Q

What Express application method starts the server and binds it to a network PORT?
(express-intro)

A

The listen method

44
Q

What method is available in the Node.js fs module for writing data to a file?
(node-fs-writefile)

A

The writeFile method.

45
Q

Are file operations using the fs module synchronous or asynchronous?
(node-fs-writefile)

A

They are asynchronous.

46
Q

What is a directory?
(node-fs-readfile)

A

A place that can store files

47
Q

What is a relative file path?
(node-fs-readfile)

A

It’s the relative URL to the file without using its full address.

48
Q

What is an absolute file path?
(node-fs-readfile)

A

The full address to the file starting from the root.

49
Q

What module does Node.js include for manipulating the file system?
(node-fs-readfile)

A

The fs module.

50
Q

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

A

If the client sends JSON as a request, this middleware will parse the body and return it.

51
Q

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

A

‘application/json’.

52
Q

What is the significance of an HTTP request’s method?

A

It describes the intent of the client, but is arbitrary. Used for communication

53
Q

What is PostgreSQL and what are some alternative relational databases?
(postgres-intro)

A

PostgreSQL is a powerful, free, open source Relational Database Management System (RDBMS).
MySQL, SQL Server by Microsoft, and Oracle by Oracle Corporation.

54
Q

What are some advantages of learning a relational database?
(postgres-intro)

A

They can store and modify data in a way that makes data corruption as unlikely as possible.
Also, most databases are relational so skills developed learning one is easily transferable.

55
Q

What is one way to see if PostgreSQL is running?
(postgres-intro)

A

Using the top command in the terminal.

56
Q

What is a database schema?
(postgres-database)

A

A collection of tables. Defines how the data in a relational database should be organized.

57
Q

What is a table?
(postgres-database)

A

A table is a list of rows.

58
Q

What is a row?
(postgres-database)

A

A column of data that all have the same attributes.

59
Q

What is SQL and how is it different from languages like JavaScript?
(sql-select)

A

Primary way of communicating with a relational database. It is a declarative language that tries to interpret what it thinks you’re trying to ask it to do.

60
Q

How do you retrieve specific columns from a database table?
(sql-select)

A

you use the select statement followed by a comma separated list of names in double quotes.

61
Q

How do you filter rows based on some specific criteria?
(sql-select)

A

You use the where clause followed by a name in double quotes, a conditional operator, and another name in SINGLE quotes.

62
Q

What are the benefits of formatting your SQL?
(sql-select)

A

It is way easier to read.

63
Q

What are four comparison operators that can be used in a where clause?
(sql-select)

A

=, !=, >,

64
Q

How do you limit the number of rows returned in a result set?
(sql-select)

A

You use the limit clause.

65
Q

How do you retrieve all columns from a database table?
(sql-select)

A

The select keyword followed by the *.

66
Q

How do you control the sort order of a result set?
(sql-select)

A

You use the order by clause followed by the column name in double quotes. desc keyword after is optional.

67
Q

How do you add a row to a SQL table?
(sql-insert)

A

You use the insert into keyword followed by comma separated double quoted words within parenthesis. Then the value keyword followed by comma separated double quoted words within parenthesis.

68
Q

What is a tuple?
(sql-insert)

A

A list of values.

69
Q

How do you add multiple rows to a SQL table at once?
(sql-insert)

A

You would use multiple comma separated tuples.

70
Q

How do you get back the row being inserted into a table without a separate select statement?
(sql-insert)

A

You would use the returning clause.

71
Q

How do you update rows in a database table?
(sql-update)

A

Use the update statement, table name in double quotes, the set clause with the name of the row in double quotes, equal operator, and the value in single quotes.

72
Q

Why is it important to include a where clause in your update statements?
(sql-update)

A

That way you don’t update everything at once.

73
Q

How do you delete rows from a database table?
(sql-delete)

A

Delete from clause followed by the name of the table in double quotes. Should probably include a where clause with a name in double quotes, condition operator, and a value in single quotes.

74
Q

How do you accidentally delete all rows from a table?
(sql-delete)

A

You forget to include a where clause.

75
Q

What is the begin command in postgreSQL?

A

Starts a transaction

76
Q

What is the rollback command in postgreSQL?

A

reverts the transaction

77
Q

What is the commit command in postgreSQL?

A

commits the transaction

78
Q

What is a foreign key?
(sql-join)

A

It connects tables that have the same column values

79
Q

How do you join two SQL tables?
(sql-join)

A

You would select what you want from two or more different tables, use from on the first (or left) table, the join which foreign key column that you want to use.

80
Q

How do you temporarily rename columns or tables in a SQL statement?
(sql-join)

A

You use aliasing and the as keyword. Note, this does not affect the actual data in the table, it’s only to make it easier to type at that moment.

81
Q

What are some examples of aggregate functions?
(sql-aggregates)

A

sum, every, min, max, json_agg, etc

82
Q

What is the purpose of a group by clause?
(sql-aggregates)

A

It clusters rows in a result set into groups and then performs the aggregate on each group

83
Q

What does express.static() return?
(express-static)

A

It returns a middleware function

84
Q

What is the local __dirname variable in a Node.js module?
(express-static)

A

It is the absolute path of the directory containing the current module.

85
Q

What does the join() method of Node’s path module do?
(express-static)

A

It concatenates in order the paths of strings/variables that you use as its argument(s).

86
Q

What is static file serving

A

Taking a file and transferring it to the client without modifying it.

87
Q

What is dynamic file serving?

A

Taking a file and modifying it before transferring it to the client.

88
Q

What does fetch() return?

A

A promise for a response.

89
Q

What is the default request method used by fetch?

A

GET.

90
Q

How do you specify the request method (GET, POST, etc.) when calling fetch?

A

In fetches 2nd argument you would pass an object with a method property and a value of (get, post, put, etc).

91
Q

What is authentication?

A

The process of accepting secrets, or “credentials”, from a client and checking them against a stored version of the credentials.