Senior Side Flashcards

1
Q

(command-line-basics)

What is a CLI?

A

A command-line interface (CLI) processes commands to a computer program in the form of lines of text.

The program which handles the interface is called a command-line interpreter or command-line processor. Operating systems implement a command-line interface in a shell for interactive access to operating system functions or services.

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

(command-line-basics)

What is a GUI?

A

The graphical user interface (GUI) is a form of user interface that allows users to interact with electronic devices through graphical icons and audio indicator such as primary notation, instead of text-based user interfaces, typed command labels or text navigation.

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

(command-line-basics)

man command

A

is an interface to the on-line reference manuals.

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

(command-line-basics)

cat command

A

concatenate files and print on the standard output

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

(command-line-basics)

ls command

A

list all the files in a directory of what is available.

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

(command-line-basics)

pwd command

A

show which working directory that you are in.

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

(command-line-basics)

echo command

A

print. basically console.log for the terminal

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

(command-line-basics)

touch command

A

create a file into the working directory. If you touch it again, you will refresh the time stamps if the file already exists.

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

(command-line-basics)

mkdir command

A

Ability to make directories

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

(command-line-basics)

mv command

A

Ability to move and rename files

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

(command-line-basics)

rm command

A

Ability to remove files and directories

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

(command-line-basics)

cp command

A

Ability to make a copy a files and optionally specify a new name.

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

(command-line-basics)

What are three virtues of a good programmer

A

Laziness, Hubris, and Impatience - Larry Wall

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

(node-intro)

What is Node.js? **

A

As an asynchronous event-driven JavaScript runtime, Node.js is designed to build scalable network applications.

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

(node-intro)

What can Node.js be used for?

A

Can be used for APIs and asynchronous calls to the server. ability to learn client-side and server-side applications

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

(node-intro)

What is a REPL?

A

READ EVAL PRINT LOOP

example: browser console, node terminal

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

(node-process)

what is a computer process?

A

The execution of the programs that are running currently on the computer.

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

(node-process)

Roughly how many computer processes are running on your host server

A

(251 - 482 processes)

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

(node-process)

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

A

http

hypertext transfer protocol. It is the web. It’s how the client and server communicate.

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

(node-process-argv)

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

A

An object that gives you information regarding the current node.js process.

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

(node-process-argv)

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

A

It is a global object. You can console.log it .

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

(node-process-argv)

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

A

The data type is an array

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

(node-module-systems)

What is a JS module?

A

A single JS file.

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

(node-module-systems)

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

A

All the exports require filename and __dirname

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

(node-module-systems)

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

A

buffer and process

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

(node-require)

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

A

Its a way of transporting a modular file into a main.js file. to be able to use js files as separate modules.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
27
Q
(node-require)
How do you import functionality into a Node.js module from another Node.js module?
A

Declaring a const variable and a require (the module)

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

(the-event-loop)

What is the JS Event Loop?

A

JS Event Loop watches:
the stack and the callback queue
when the stack is clear and there is something on the callback queue, the event loop will push it onto the stack to get executed.

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

(the-event-loop)

What is different between ‘blocking’ and ‘non-blocking’ with respect to how code is executed?

A

Blocking code stalls the stack

Non-blocking is asynchronous, it is on the event queue

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

(node-fs-readfile)

What is a directory?

A

A directory is a special type of file that holds information about more directories and files

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

(node-fs-readfile)

What is a relative file path?

A

Path related to where you are at. (not an absolute path)
example: ./ = current directory
../node-fs-readfile/dksjt.txt (going up a directory)

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

(node-fs-readfile)

What is an absolute file path?

A

From the root, explicitly typing out the whole file path.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
33
Q
(node-fs-readfile)
What module does Node.js include for manipulating the file system?
A

fs module

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
34
Q
(node-fs-writefile)
What method is available in the Node.js module for writing date to a file?
A

fs.write, fs.writeFile, fs.appendFile

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
35
Q
(node-fs-writefile)
Are file operations using the fs module synchronous or asynchronous?
A

They are both.

fs. write
fs. writeSync

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

(JS-and-JSON)

What is JSON?

A

JSON is a data interchange format. You change another data type into a ‘string’

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

(JS-and-JSON)

What are serialization and deserialization?

A

Serialization: taking data and and breaking them into bytes.
Deserialization: taking bytes from storage to change to data

38
Q

(JS-and-JSON)

Why are serialization and deserialization useful?

A

You can send any type of data back and forth.

If you want to send it over the network, or store to a storage medium, breaks to binary and is stored.

39
Q

(JS-and-JSON)

How do you serialize data into a JSON string using Javascript?

A

json.stringify( )

40
Q

(JS-and-JSON)

How do you deserialize a JSON string using JS?

A

json.parse( )

41
Q

(http-messages)

What is a client?

A

Program or device that issues request to servers.

42
Q

(http-messages)

What is a server?

A

Program or device that receives requests from clients and sends responses to them

43
Q

(http-messages)

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

A

a GET request

44
Q

(http-messages)

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

A

HTTP Method, URL Request Target, HTTP Version

45
Q

(http-messages)

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

A

Status line, status code, status text

46
Q

(http-messages)

What are HTTP headers?

A

Metadata about requests and responses

47
Q

(http-messages)

Is a body required for a valid HTTP message?

A

No. a body is totally optional.

48
Q

(npm-intro)

What is NPM?

A

website, cli, registry

49
Q

(npm-intro)

What is a package?

A

A directory with one or more files with a package.json file.

50
Q

(npm-intro)

How can you create a package.json with npm?

A

On the command line, npm innit -y in the current directory

51
Q

(npm-intro)

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

A

Any other package that the it depends on via install ‘npm install ‘ on the command line

52
Q

(npm-intro)

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

A

Within the package.json the dependency gets added and downloads it from the NPM registry.

53
Q

(express-intro)

How do you add express to your package dependencies?

A

Use npm install express

54
Q

(express-intro)

What Express application method starts the server and binds it to a network PORT?

A

The app.listen method. (listen method)

55
Q

(express-hello-world)

How do you mount(use) a middleware with an Express application?

A

The use method.

56
Q

(express-hello-world)
Which objects does an Express application pass to your middleware to manage the request/response lifecycle of the server?

A

The req and res, incoming request and how to control the servers response.

57
Q

(express-sendfile)

What is the purpose of the Content-Type header in HTTP request and response messages?

A

The Content-Type entity header is used to indicate the media type of the resource. In responses, a Content-Type header tells the client what the content type of the returned content actually is.

58
Q

(express-static)

What does express.static( ) return?

A

When you call .static method, you get a function

59
Q

(express-static)

What is the local __dirname variable in a Node.js module?

A

The ‘full’ absolute path to the current module.

60
Q
(express-static)
What does the join( ) method of Node's path module do?
A

Joins separate path segments together.

61
Q

(express-get-json)

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

A

Content-type will be application/json

62
Q

(express-post-json)

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

A

Parsed incoming requests that are JSON and when the content type header matches the header options that would receive JSON.

63
Q

(webpack-intro)

What is webpack?

A

A module bundler

64
Q

(webpack-intro)

How do you add a devDependency to a package?

A

npm install –save-dev

65
Q

(webpack-intro)

What is an NPM script?

A

The key is the name of the script
The value is the command line command you want to run.
“build’: “webpack”.

66
Q

(webpack-intro)

How do you execute Webpack with npm run?

A

Add a key value to a script

ex: “build’: “webpack”. (build step)

67
Q

(es-modules)

How are ES Modules different from CommonJS modules?

A

CommonJS came first, browser support. require doesn’t exist in the browser(node style). import is standardized and exists within the browser(es module uses special keywords) .

68
Q

(es-modules)

What kind of modules can Webpack support?

A

Supports many different types of modules. some standardized and some are not. You treat every single file and help config with webpack, you can import them all together.

69
Q

(react-elements)

What is React?

A

A JavaScript library to build user interfaces

70
Q

(react-elements)

What is a React element?

A

An object

71
Q

(react-elements)

How do you mount a React element to the DOM?

A

Using the render method on the ReactDOM object.

72
Q

(babel-intro)

What is Babel?

A

Babel is a toolchain that is mainly used to convert ECMAScript 2015+ code into a backwards compatible version of JavaScript in current and older browsers or environments.

73
Q

(babel-intro)

What is a Plug-in?

A

Plug-in, also called add-on or extension, computer software that adds new functions to a host program without altering the host program itself.

Widely used in digital audio, video, and Web browsing, plug-ins enable programmers to update a host program while keeping the user within the program’s environment.

74
Q

(babel-intro)

What is a Webpack loader?

A

Loaders are transformations that are applied to the source code of a module.

They allow you to pre-process files as you import or “load” them. Loaders can transform files from a different language (like TypeScript) to JavaScript or load inline images as data URLs.

75
Q

(babel-intro)

How can you make Babel and Webpack work together?

A

npm install babel-core babel-loader babel-preset-es2015 webpack –save-dev

build: webpack

npm run build

76
Q

(react-jsx)

What is JSX?

A

A syntax extension to Javascript. JS syntax with extra syntax

77
Q

(react-jsx)

Why must the React object be imported when authoring JSX in a module?

A

JSX compiles to calls of the createElement of the React element object.
if React is not imported, it will be undefined. Undefined doesn’t have a create method.

78
Q

(react-jsx)

How can you make Webpack and Babel work together to convert JSX into valid JS?

A

Using the babel-loader, you need to use the plug-in via npm install package.

79
Q

(react-function-components)

What is a React component?

A

A JS function that is independent and reusable and returns a React element

80
Q

(react-function-components)

How do you define a function component in React?

A

You write a JS function or class. Component names have to start with a Capital letter.

81
Q

(react-function-components)

How do you mount a component to the DOM?

A

Call the render method on the ReactDOM object.

  1. React element and type is components name
  2. Where you want to append it to
82
Q

(react-prop-and-expressions)

What are props in React?

A

props is an object

83
Q

(react-prop-and-expressions)

How do you pass props to a component?

A

When you create a React element you add a keyname and a value.

84
Q

(react-prop-and-expressions)

How do you write JS expressions in JSX?

A

you use { }

85
Q

(react-rendering-lists)

What Array method is commonly used to create a list of React elements?

A

array.prototype.map

86
Q

(react-rendering-lists)

What is the best value to use as a ‘key’ prop when rendering lists?

A

usually an id number from the data set.

87
Q

(postgres-database)

What is a database schema?

A

A description of the database structure

A schema defines how the data in a relational database should be organized.

88
Q

(postgres-database)

What is a table?

A

A table (big spreadsheet) is a list of rows each having the same set of attributes.

89
Q

(postgres-database)

What is a row?

A

A row contains the attributes(values) in a database.

90
Q

(postgres-intro)

What is PostgreSQL and what are some alternative relational databases?

A

A relational database is a digital database based on the relational model of data
MySQL,

91
Q

(postgres-intro)

What are some advantages of learning a relational database?

A

ACID,
atomicity: guarantees that each transaction is treated as a single “unit”, which either succeeds completely, or fails completely:

consistency: ensures that a transaction can only bring the database from one valid state to another, maintaining database invariants
isolation: Transactions are often executed concurrently (e.g., multiple transactions reading and writing to a table at the same time). Isolation ensures that concurrent execution of transactions leaves the database in the same state that would have been obtained if the transactions were executed sequentially.
durability: guarantees that once a transaction has been committed, it will remain committed even in the case of a system failure (e.g., power outage or crash).

92
Q

(postgres-intro)

What is one way to see if PostgreSQL is running?

A

Run the Top command in a second terminal to be able to see that the PostgresQL is running