Misc Flashcards

(68 cards)

1
Q

What is a CLI?

A

-command-line interface (Bash, Cmder)

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

What is a GUI?

A

-graphical user interface (VS Code, MS Windows/Mac displays)

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

Give at least one use case for this command:

-man

A

-man man (prints the manual for manual)

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

Give at least one use case for this command:

-cat

A

-cat three-virtues.txt (prints the txt from the txt file)

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

Give at least one use case for this command:

-ls

A

-ls (prints the contents of current directory)

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

Give at least one use case for this command:

-pwd

A

-pwd (prints the address of your current working directory)

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

Give at least one use case for this command:

-echo

A

-echo ‘Hello, World!’ > hello.txt (inserts ‘Hello, World!’ into hello.txt file)

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

Give at least one use case for this command:

-touch

A

-touch new-file.txt (creates a new file and updates its timestamp)

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

Give at least one use case for this command:

-mkdir

A

-mkdir parent (creates a new directory)

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

Give at least one use case for this command:

-mv

A

-mv pokiemans pokemon (renames pokiemans directory to pokemon)

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

Give at least one use case for this command:

-rm

A

-rm extraneous.txt (removes extraenous.txt)

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

Give at least one use case for this command:

-cp

A

-cp original.txt copyOf.txt (makes a copyOf.txt file from original.txt)

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

What are some back end languages?

A

-JavaScript, Python, PHP, Java, Ruby, C, C#, C++, Rust, Perl, Swift, Go

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

What makes JavaScript unique?

A

-prototypal inheritance, “this”, event loops, closure

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

What is a computer process?

A

-an instance of a computer program that is being executed

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

What is NPM?

A
  • node package manager
  • a software registry where developers can share and borrow packages
  • has: website, registry, CLI
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
17
Q

What is a package?

A
  • aka a “module”, containing bits of reusable code

- exists as a directory with package + package.json + other files

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

How can you create a package.json with npm?

A
  1. navigate to the root directory of your package

2. “npm init -y” (default package.json) or “npm init” (manually answer prompts)

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

What is package.json?

A
  • lists the packages your project depends on
  • specifies versions of a package that your project can use
  • makes your build reproducible, and therefore easier to share with other developers
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
20
Q

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

A
  • a package that your package needs in order to work

- add new dependencies by installing them in the root directory of your package “npm install” and adding “–save”

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

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

A
  • allows the project to install the versions of the modules it depends on
  • by running “npm install”, you can install all of the dependencies that are listed in the project’s package.json
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
22
Q

What does “npm init” do?

A

“npm init” is a command to scaffold out your project

“npm init –yes” will instantly initialize a project with default values

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

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

A
  1. The protocol version, usually HTTP/1.1
  2. A status code, indicating success or failure of the request (200, 404, 302…)
  3. A status text. A brief, human-readable, informational text about the status code
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
24
Q

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

A
  1. HTTP method (POST, GET, PUT, HEAD, OPTIONS, etc)
  2. request target (URL)
  3. HTTP version
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
25
What is express js?
-a minimal and flexible Node.js web application framework that provides a robust set of features for web and mobile applications
26
How do you add express to your package dependencies?
npm install express in your root directory or manually edit package.json
27
What Express application method starts the server and binds it to a network PORT?
listen()
28
What is the difference between the internet and the web?
internet: network of computers web: the links between documents (messaging format called HTTP)
29
How do you mount a middleware with an Express application?
app.use()
30
Which objects does an Express application pass to your middleware to manage the request/response lifecycle of the server?
req, res
31
What is the appropriate Content-Type header for HTTP messages that contain JSON in their bodies?
application/json
32
What does the express.json() middleware do and when would you need it?
- express.json() is a built-in function in Express that parses incoming requests with JSON payloads - you would need this when you want to parse JSON request bodies
33
What is the significance of an HTTP request's method?
-indicates what type of request is being made to the web server, and the corresponding action that will be performed on whatever resource you're accessing
34
What do the following HTTP verbs do? - POST - GET - PUT - DELETE
POST: creates GET: reads PUT: updates DELETE: deletes
35
What is "syntactic sugar"?
-syntax that makes things easier for humans to read or express
36
What is "refactoring"?
-restructuring code while preserving its existing functionality
37
What is Webpack?
a tool that lets you bundle your JavaScript applications (bundles all your modules into one)
38
How do you add a devDependency to a package?
--save-dev when you npm install
39
What is an NPM script?
An npm script that bundles common shell commands for your project
40
How do you execute Webpack with npm run?
-by adding a script that runs Webpack into "scripts" in package.json
41
How are ES Modules different from CommonJS modules?
- syntax is different: - ES6: import/export - CommonJS: require/module.exports - CommonJS modules load dependencies on demand while executing the code - ES6 modules are pre-parsed in order to resolve further imports before code is executed
42
What kind of modules can Webpack support?
ES6, CommonJS, AMD modules
43
What is Babel?
Babel is a JavaScript compiler mainly used to convert ES6 code into a backwards compatible version of JavaScript
44
What is a Plug-in?
a software component that adds a specific feature to an existing computer program
45
What is a Webpack loader?
Loaders are transformations that are applied to the source code of a module
46
How can you make Babel and Webpack work together?
install 'babel-loader' and include loader: 'babel-loader' in package.json @@@ my answer... @@@ 1) in package.json, add a script that will build the app using Webpack+Babel: "scripts": { "build": "webpack"} 2) npm run build 3) modify in index.html to load the compiled version:
47
What does express.static() return?
- express.static() is a built-in middleware function that serves static files - returns an object that has the requested static files
48
What is the local __dirname variable in a Node.js module?
-tells you the absolute path of the directory containing the currently executing file
49
What does the join() method of Node's path module do?
path.join() joins all given path segments together into one path
50
What does fetch() return?
Calling fetch() returns a promise. We can then wait for the promise to resolve by passing a handler with the then() method of the promise. That handler receives the return value of the fetch promise, a Response object
51
What is the default request method used by fetch()?
GET
52
How do you specify the request method (GET, POST, etc.) when calling fetch?
put the request method after the resource url, as part of the optional fetch() parameters syntax: fetch(url, [options]) example: fetch(url, {method: 'POST'}) .then(response => response.json()) .then(data => console.log(data));
53
When does React call a component's componentDidMount method?
after first successful render to the DOM. constructor and render must run successfully
54
Name three React.Component lifecycle methods.
``` constructor(), render(), componentDidMount(), componentDidUpdate(), componentWillUnmount() ```
55
How do you pass data to a child component?
through the props
56
What must the return value of myFunction be if the following expression is possible? myFunction()();
must return the inner (nested) function of the first function. calling a function n immediately calling its return value
57
``` What does this code do? const wrap = value => () => value; ```
assigns a function "value" to const wrap. this function has an anonymous function that returns something as well
58
In JavaScript, when is a function's scope determined; when it is called or when it is defined?
when it's defined.. double check
59
What allows JavaScript functions to "remember" values from their surroundings?
closure (you can check this by console.dir and opening up the 3 scopes. it will be in the closure scope)
60
What are "props" in React?
``` props is a keyword in React that stands for "properties" and is used for passing data from one component to another this.props contains the props defined by the caller of the component props are read-only. this is how the concept of "states" developed: to allow the changing of the React state without changing the props. we use class components when we are expecting features like managing state, adding life cycles, n event handlers. ```
61
What does the acronym LIFO mean?
the last thing pushed onto the stack is the first thing that can be popped out
62
What methods are available on a Stack data structure?
- push() - pop() - peek()
63
What must you do to access the value at an arbitrary point in a stack (not just the "top")?
you have to keep using pop() to peel away enough layers to reach the particular point in the stack
64
What does the acronym FIFO mean?
the first thing enqueued onto the queue is the first thing that can be dequeued out
65
What methods are available on a Queue data structure?
enqueue(value) - adds a value to the "back" of the queue | dequeue() - removes the "front" value from the queue and returns it
66
What must you do to access the value at an arbitrary point in a queue (not just the "front")?
keep using dequeue() to "peel away" to that particular point in a queue
67
How are linked lists different from an array?
linked lists "point" to the next node
68
How would you access an arbitrary node in a linked list (not just the "head")?
keep looking at the .next node (.next.next.next)