Node.js, cmd, React, SQL (senior) Flashcards

1
Q

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.

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 (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

man

A

man 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

cat

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

ls

A

list local directory

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

pwd

A

prints name os current working directory

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

echo

A

displays a line of text

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

touch

A

changes file timstanp

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

mkdir

A

make directory

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

mv

A

move or rename

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

rm

A

remove

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

cp

A

copy

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

What is Node.js?

A

a backend language that allows javascript to run outside of browser

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

What can Node.js be used for?

A

backend for web applications, command line or automation

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

What is a REPL?

A

A read–eval–print loop (REPL), also termed an interactive toplevel or language shell, is a simple interactive computer 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
16
Q

When was Node.js created?

A

may 27 2009

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

What back end languages have you heard of?

A

java, c, .net, pascal, python, php

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

What is a computer process?

A

a task being run by the computer

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

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

A

468

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

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

A

Full stack Web development is based on making multiple processes work together to form one application and knowing about the processing power of each component helps with making a more efficient application

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

What is a computer process?

A

the instance of a computer program that is being executed by one or many threads. It contains the program code and its activity.

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

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

A

is a global that provides information about, and control over, the current Node.js process.

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

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

A

by calling process variable

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

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

A

array

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

What is a JavaScript module?

A

a single .js file that holds everything necessary to execute only one aspect of the program

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

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

A

exports, require, module, __filename, __dirname

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

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

A

global, console, window, process

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

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

A

exporting a function from one module so it can be accessed from another

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

How do you import functionality into a Node.js module from another Node.js module?

A

by calling require() function and passing the module as the argument

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

What is the JavaScript Event Loop?

A

how js queue events and execute them in order by moving tasks from queue to stack

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

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

A

blocking is when additional process has to wait for to be executed and none blocking allows other events to be executed while processing

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

What is a directory?

A

a file system cataloging structure containing refrence to other files and directories

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

What is a relative file path?

A

same directory

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

What is an absolute file path?

A

refrence to a directory from root

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

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

A

fs

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

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

A

writefile()

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

Are file operations using the fs module synchronous or asynchronous?

A

both

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

What is JSON?

A

javascript object notation, it’s data interchange format that can be used to store or extract data from an object

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

What are serialization and deserialization?

A

serialized is the string format of the data object

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

Why are serialization and deserialization useful?

A

serialized can be transfer over network and deserialized enables interaction with the data inside the object

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

How do you serialize a data structure into a JSON string using JavaScript?

A

stringify()

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

How do you deserialize a JSON string into a data structure using JavaScript?

A

parse()

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

What is a client?

A

service requester

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

What is a server?

A

service and resource provider

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

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

A

GET

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

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

A

request method

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

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

A

status code

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

What are HTTP headers?

A

An optional set of HTTP headers specifying the request, or describing the body included in the message.

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

Is a body required for a valid HTTP message?

A

it’s optioal

50
Q

What is NPM?

A

node package manager, world’s largest software registry

website, cli and registry

51
Q

What is a package?

A

it’s bits of reusble codes shared by other developers and it incudes files and directories in it

52
Q

How can you create a package.json with npm?

A

using npm init command and -y flag

53
Q

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

A

any packge that the app is depeded on, using npm install and the name of the package

54
Q

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

A

the meta tags: the name, tag, version, link and address to the files and directories of that package gets added to package .json

55
Q

How do you add express to your package dependencies?

A

by instaling using npm i express

56
Q

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

A

listen() method

57
Q

How do you mount a middleware with an Express application?

A

use() method with a specified path

58
Q

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

A

next middleware function

59
Q

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

A

specifies the file type based on the file extension

60
Q

What does express.static() return?

A

the files that are available to be served within the directory using a function

61
Q

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

A

absolute path to current module directory

62
Q

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

A

join all the given path segments together and normalize the resulting path

63
Q

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

A

application/json

64
Q

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

A

It parses incoming requests with JSON payloads

65
Q

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

A

it indicates the routing method of the request which will be responded according to

66
Q

What is Webpack?

A

a tool that makes bundling of the js applications possible and supportts both commonjs and esm and can extend to ssets such as images, fonts, and stylesheets

67
Q

How do you add a devDependency to a package?

A

by using –save-dev flag while installing the the package or adding it manually to package.json

68
Q

What is an NPM script?

A

shell command

69
Q

How do you execute Webpack with npm run?

A

by using the command name

70
Q

How are ES Modules different from CommonJS modules?

A

they can be run in browser and theyre more compact

71
Q

What kind of modules can Webpack support?

A

CommonJS, AMD, ES6 modules

72
Q

What is React?

A

A JavaScript library for building user interfaces

73
Q

What is a React element?

A

an object that describs type and propps of a

creates and returns a new react element of the type given

74
Q

How do you mount a React element to the DOM?

A

by calling render method of reactdom object

75
Q

What is Babel?

A

it’s a javascript code compiler

76
Q

What is a Plug-in?

A

a preset that allows transformation

77
Q

What is a Webpack loader?

A

loaders are transformations that are applied to the source code of a module and allow pre-processing of files as they import or load

78
Q

How can you make Babel and Webpack work together?

A

using babel-loader and config file

79
Q

What is JSX?

A

it javascript xml a syntax extension to javascript and produces React elements

80
Q

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

A

jsx is for writting elements which would be done using react

81
Q

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

A

by using react-jsx pugin

82
Q

What is a React component?

A

isolated, reusable ui pieces

83
Q

How do you define a function component in React?

A

by defining a javascript function that returns a JSX element

84
Q

How do you mount a component to the DOM?

A

by calling render method of the reactdom object

85
Q

What are props in React?

A

optional properties (object) that can be passed into components

86
Q

How do you pass props to a component?

A

assigning the value to the key name of the property

87
Q

How do you write JavaScript expressions in JSX?

A

by wrapping the variable name or any expression in curly braces

88
Q

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

A

Map()

89
Q

What is the best value to use as a “key” prop when rendering lists?

A

a unique name like: IDs

90
Q

How do you create “class” component in React?

A

by extending the react.component and a class name

91
Q

How do you access props in a class component?

A

this.props

92
Q

What is the purpose of state in React?

A

to keep track of the element changes

93
Q

How to you pass an event handler to a React element?

A

by adding {}

94
Q

What are controlled components?

A

an element that whose value is controlled by react

95
Q

What two props must you pass to an input for it to be “controlled”?

A

onChange and value

96
Q

What is PostgreSQL and what are some alternative relational databases?

A

free, open source Relational Database Management System (RDBMS)
MySQL SQL Oracle

97
Q

What are some advantages of learning a relational database?

A

it’s easy to create and manage database for data with some relation, data integrity.

98
Q

What is one way to see if PostgreSQL is running?

A

checking processes

99
Q

What is a database schema?

A

a collection of tables, which defines how the data should be organized

100
Q

What is a table?

A

a list of rows each with the same set of attributes

101
Q

What is a row?

A

a record with set of attributes on the table

102
Q

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

A

structured query language is the primary way to interact with relational database.
JS is imperative language which has to be told what to do, SQL is declarative which we describe the expected result and programming environment decides how to get that

103
Q

How do you retrieve specific columns from a database table?

A

by using select statement, using select keyword passing each column name as a string separated by comma and from keyword passing table name as string and ends the query with ;

104
Q

How do you filter rows based on some specific criteria?

A

using where clause at the end of the statement followed by the column name as string = and category name as string

105
Q

What are the benefits of formatting your SQL?

A

readability

106
Q

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

A

< > = !=

107
Q

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

A

using limit clause followed by an integer

108
Q

How do you add a row to a SQL table?

A

insert into clause followed by name of table in “” and list of columns in “” in () and values clause folowed by values in ‘’ in ()

109
Q

What is a tuple?

A

a list of values

110
Q

How do you add a row to a SQL table?

A

insert into clause followed by name of table in “” and list of columns in “” in () and values clause followed by values in ‘’ in ()

111
Q

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

A

seperated list of tuple by commas

112
Q

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

A

separated list of tuple by commas

113
Q

How do you update rows in a database table?

A

using update clause with name of the table
set clause with name of the column = value
where clause with a id column = value

114
Q

Why is it important to include a where clause in your update statements?

A

without where all items in column gets updated

115
Q

What is a foreign key?

A

the id value of a row used in a different table

116
Q

How do you join two SQL tables?

A

using select follow by column or * for all
from followed by table name
and join by another table name followed by using keyword and the identifier

117
Q

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

A

using select followed by nameof the table . name of the column and as keyword with new name

in case of using alias for table names, on the line for from or join add the as keyword followed by alias

118
Q

How do you delete rows from a database table?

A

delete clause followed by from keyword and the name of the table

119
Q

How do you accidentally delete all rows from a table?

A

by not using where clause to specify which row to delete or “where true”

120
Q

What are some examples of aggregate functions?

A

max() avg() count() main() sum() every()

121
Q

What is the purpose of a group by clause?

A

to group rows and get a answer about a group of rows without asking the question from every single row