Master Deck Flashcards

1
Q

How are if statements structured in Python?

A

if (statement):

(ONE TAB INDENT)action

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

In JavaScript, maps are similar to objects but allow for __________.

A

Any data type as the key in the key-value pairs.

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

In JavaScript maps, the three main functions are _____.

A

.set(), .has(), .delete()

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

What is the inequality operator in Python?

A

!=

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

How do you copy a JavaScript object without simply referencing the original object?

A

const person2 = {…person1};

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

In JavaScript, you should use a map instead of an object when you need to maintain _________.

A

the order of your items

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

In JavaScript, how do you convert an object into a JSON?

A

JSON.stringify(object)

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

Given a JSON, how do you convert it into an object in JavaScript?

A

JSON.parse(‘json’)

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

What is the ‘and’ operator in Python?

A

and

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

The _______ JavaScript library has a bevy of tools for working with objects and arrays.

A

Lodash

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

What is the ‘or’ operator in Python?

A

or

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

Given two JavaScript objects, meatInventory and veggieInventory, how would you merge them into one object called ‘inventory’?

A

const inventory = {…meatInventory, …veggieInventory};

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

How can you test whether a variable called ‘names’ is an array in JavaScript?

A

Array.isArray(names)

this will return either a true or a false

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

What is the ‘not’ operator in Python?

A

‘not’

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

The ‘…’ operator in JavaScript is called the _____ operator.

A

spread

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

Given the list:

seq = [1, 2, 3, 4, 5]

create a ‘for’ statement in Python that prints each element in the list.

A

for x in seq:

indent)print(x

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

If a pandas DataFrame named df has a column named W, how do you retrive W from df?

A

df[‘W’]

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

Given a pandas DataFrame named df that contains two columns X and Y, how do you create a third column named Z where Z = X + Y?

A

df[‘Z’] = df[‘X’] + df[‘Y’]

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

Given a DataFrame named df, how do you retrieve the value at row X, column Y?

A

df[‘Y’][‘X’]

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

What are the two methods available for collecting rows or columns from pandas DataFrames?

A

.loc

.iloc

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

In the pandas programming library, what are the two main methods for dealing with missing data?

A

.dropna()

.fillna()

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

How can DataFrames be concatenated using pandas?

A

pd.concat()

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

What method is used to return all unique values from a pandas Series?

A

pd.Series().unique()

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

On the command line, what command returns your current working directory?

A

pwd

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

In Python, what command is used to import the matplotlib charting library?

A

import matplotlib.pyplot as plt

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

What command allows you to actually see your plots within the Jupyter Notebook?

A

%matplotlib inline

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

The ______ command must be used to show a plot outside the Jupyter Notebook.

A

plt.show()

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

What command imports the pandas datareader?

A

import pandas_datareader.data as web

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

What command serves to import the Quandl library into Python?

A

import quandl

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

The _____ command fixes most matplotlib formatting errors.

A

plt.tight_layout()

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

In Python, what is a set?

A

An unordered collection of unique items.

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

Create a basic set in Python.

A

set = {1,2,3}

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

What Python command imports the math library?

A

import math

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

Given an array of integers in NumPy, how would you return an array that excludes all values below 4?

A

array[ array > 3]

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

What is the quickest way to create an array of 10 zeros in NumPy?

A

np.zeros(10)

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

What command is used to create an array of linearly spaced points in NumPy?

A

np.linspace()

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

What is the exponent library in Python?

A

**

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

In JavaScript, what is the main difference between a node list and an array?

A

A node list lacks many of the methods that an array has.

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

What text allows you to define a function in Python?

A

def myFunction():

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

What character defines the ternary operator in JavaScript?

A

?

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

When creating a function in Python, how do you set up a docstring?

A

Three sets of double quotations (“””)

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

What does D3.js stand for?

A

Data Drive Documents

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

What is a lambda expression in Python?

A

A function to use one time that has no name

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

What are the CRUD operations?

A

create, read, update, delete

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

What is an important component of a custom Python function if you plan to use it for future calculations or other functions?

A

the return statement

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

What is a React component?

A

a reusable piece of code for the user interface of a website

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

What keyword can be used to apply a function to every element of a list in JavaScript?

A

map

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

Firebase is a service provided by ________.

A

Google

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

How do you view a function’s documentation in the Jupyter Notebook?

A

Shift+Tab

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

How do you kill an environment in Terminal?

A

CTRL+C

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

How could you transform a string to all lowercase or uppercase letters in Python?

A

By appending .upper() or .lower() to the string’s variable name.

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

In a React application, information is communicated to a component through _________.

A

props

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

How can you split a string into a list of strings? Works in both Python and JavaScript.

A

.split()

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

In a React application, JSX does not have any ______ built into it.

A

logic

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

How do you remove an item from a list in Python?

A

by appending .pop() and passing in the item’s index

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

How do you import React into a JavaScript application?

A

import React from ‘react’;

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

What is an alternative (weird) way to concatenate variable values in a string in Python?

A

By adding { } into the string and appending .format

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

In layman’s terms, what is a React component?

A

A reusable piece of code for your website

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

In Python, how can you return the length of a list named my_list?

A

len(my_list)

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

Every React component must have a _____ method.

A

render

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

What command imports the NumPy library into a Python application?

A

import numpy as np

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

In JSX, the “class” attribute is replaced by ________.

A

className

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

Given a list my_list = [1,2,3], how can you turn it into a NumPy array?

A

np.array(my_list)

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

In React, a render method can only return _____ element(s), so ______ is important.

A

one, nesting.

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

Using NumPy, how could we easily generate a 4x4 identity matrix?

A

np.eye(4)

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

To return multiple sister elements in a React render method, you should wrap them in a ___________ method.

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

Hoe can you access NumPy’s group of random number generators?

A

type ‘np.random’ then hit Tab

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

How do you comment in JSX?

A

{/* comment */}

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

Given a 1x25 matrix called “array” in NumPy, how could you reshape it to a 5x5 matrix?

A

array.reshape(5,5)

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

How can you include JavaScript in JSX?

A

By wrapping it in curly brackets

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

What does JSX stand for?

A

JavaScript XML

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

Given an array called ‘matrix’ in NumPy, how can you return the highest value in the array?

A

matrix.max()

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

In React props, anything other than a string requires ______________.

A

curly brackets

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

What happens when you add two arrays in NumPy?

A

The arrays are summed on an element-by-element basis.

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

In React, props are equivalent to HTML _______.

A

attributes

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

Given two arrays in NumPy named array1 and array2, what would the command array1*array2 output?

A

it would multiply the arrays on an element-by-element basis

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

How do you take the square root of every element in an array using NumPy?

A

np.sqrt(array)

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

What is a stateless functional component?

A

A component that receives props as input and outputs JSX.

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

One of the main features of jQuery is the use of _____.

A

The dollar sign

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

In JavaScript, what does IIFE stand for?

A

immediately invoked function expression

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

Tabs in Excel are equivalent to _____ in a database.

A

tables

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

One of the core principles of functional programming is ______.

A

To not change things

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

What does SQL stand for?

A

Structured Query Language

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

In functional programming, changing or altering things is called ______.

A

mutation

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

Where do we spend most of our time in pgAdmin4?

A

the Query Tool

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

Who owns Heroku?

A

Salesforce

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

What symbol runs code in pgAdmin4?

A

the lightning bolt

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

What is the JavaScript method for concatenation?

A

.concat()

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

The ____ language is case-insensitive

A

SQL

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

The _____ of a function is the number of arguments it requires.

A

arity

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

In SQL, the COUNT function does not consider _____.

A

NULL values

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

To _______ a function means to convert a function of N arity into N functions of arity 1.

A

curry

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

Given a table called “payment”, write a SQL query to count the number of rows it contains.

A

SELECT COUNT(*) FROM payment;

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

How do you make an image’s width equal to the viewport width using Bootstrap?

A

add the class “img-responsive” to the <img></img> tag

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

Every SQL query must end in _______.

A

A semicolon

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

How do you center text using Bootstrap?

A

class=”text-center”

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

Given a DataFrame named ‘banks’, how do you retrieve a list of the DataFrame’s columns?

A

banks.columns

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

____ is the most powerful and customizable visualization library for Python.

A

matplotlib

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

Given a Python list called my_list, how do you transform it into a pandas Series?

A

pd.Series(my_list)

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

What command allows you to start a Jupyter Notebook from the terminal?

A

jupyter notebook

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

In HTML, radio buttons are a type of _____

A

input

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

In a CSS stylesheet, how do you change the appearance of a link when it is hovered over?

A

a: hover { }

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

In HTML, what is the purpose of a div element?

A

A div element is a general purpose container for other elements

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

In CSS, what do the letters of hsl() stand for?

A

hue, saturation, lightness

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

The ____ element is probably the most commonly used HTML element of all.

A

div

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

How to you create an in-line comment in JavaScript?

A

//This is an inline comment

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

What HTML tag is used to communicate to a browser that you are using HTML5?

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

What does NaN stand for?

A

Not a Number

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

CSS class declarations start with ___

A

a period

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

Given a string in JavaScript named myString, how do you calculate its length?

A

myString.length

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

What are the three default fonts that are available in all browsers?

A

monospace
serif
sans-serif

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

What function allows you to append data to the end of a JavaScript array?

A

.push()

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

In CSS, ____ attributes should be unique.

A

id

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

In JavaScript, what is the different between .shift() and .pop()?

A

shift works on the first element of an array while pop works on the last element of an array

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

How do you return the first letter of a string in Python?

A

string[0]

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

If you want to run a function after 5 seconds in JavaScript, you would use a ____

A

timeout function

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

In JavaScript, what are object methods?

A

functions contained inside an object

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

When creating id attributes in a CSS stylesheet, they always start with ____.

A

#

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

In JavaScript, the ____ function adds an element to the beginning of an array.

A

unshift

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

In JavaScript, objects that are globally available can be called from the ____ object.

A

window

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

What is hoisting in JavaScript?

A

hoising allows you to access functions and variables before they have been created

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

In JavaScript, what are closures?

A

closures are the ability for a child function to access variables from a higher-level scope even after the functions have been closed

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

What does DOM stand for?

A

document object model

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

The DOM can be seen in the ____ tab of a browser inspector.

A

Elements

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

The characteristics of a browser window are stored in the ____ object.

A

window

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

In SQL, what do temporal data types store?

A

date and time related data

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

What does .svg stand for?

A

Scalable Vector Graphics

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

In SQL, what is the difference between the LIKE and ILIKE statements?

A

ILIKE is not case sensitive

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

What is Font Awesome?

A

A convenient library of icons

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

In SQL, what are the four aggregate functions?

A

MIN
MAX
AVG
SUM

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

In Bootstrap, the number of columns always adds to ____.

A

12

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

What is the purpose of the AS statement in SQL?

A

to rename a column

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

Given two tables A and B, what does the INNER JOIN clause do?

A

The INNER JOIN clause returns rows in table A that have the corresponding rows in Table Y

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

What does Sass stand for?

A

Syntactically Awesome StyleSheets

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

React is a open source project originally created by ____.

A

Facebook

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

What is the purpose of a subquery in SQL?

A

A subquery allows us to use multiple SELECT statements, where we basically have a query within a query

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

React is an open-source JavaScript library used for ____/

A

building user interfaces

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

What is a primary key in SQL?

A

A primary key is a column or a group of columns that is used to identify a row uniquely in a table

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

React uses a syntax extension of JavaScript called ____.

A

JSX

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

How are primary keys defined?

A

Through primary key constraints

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

The transpiler ____ is a popular tool for compiling JSX code into JavaScript

A

Babel

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

How many primary keys can a SQL table have?

A

one and only one

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

How many foreign keys can a SQL table have?

A

multiple

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

What is a foreign key in SQL?

A

A column that references the primary key of a different table.

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

In Sass, a mixin is called with the ____ directive.

A

@include

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

How do you change the name of a view in SQL?

A

ALTER VIEW old_name RENAME TO new_name;

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

In JSX, every element must be ____.

A

closed

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

How do you delete a view in SQL?

A

DROP VIEW name_of_view;

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

Everything in React is a ____.

A

component

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

In React, what is state?

A

An object that holds data that a component and its children need.

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

In NumPy, what is the general layout for how to index a two-dimensional array?

A

array[row,col] or array[row][col]

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

In JavaScript functions, the return statement causes the function to ____.

A

stop running

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

When you are testing equality in JavaScrip, you should almost always use ____.

A

the triple equal sign

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

In JavaScript, the only number that is falsy is ____.

A

zero

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

After an UPDATE command is performed in SQL, what other commands can be used to return the values of specified columns?

A

RETURNING

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

One of React’s key principles is separating ____ from ____.

A

state logic

UI logic

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

What is the general syntax of the DELETE command in SQL?

A

DELETE FROM table_name

WHERE condition;

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

When using event listeners in JavaScript, what event measures the depression of a key on a physical keyboard?

A

keydown

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

JavaScript objects are similar to ____ in other languages.

A

dictionaries

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

What happens if the WHERE clauses is omitted from a DELETE statement in SQL?

A

The entire table is deleted! Don’t do this!

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

In AWS S3, files are called ____ and folders are called ____.

A

objects, buckets

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

Write a basic dictionary in Python.

A

dictionary = {‘key’:’value’}

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

How do you go up one level in the command line?

A

cd ..

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

What does the ‘ETS’ in ETS Model stand for?

A

Error, Trend, Seasonality

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

What does EWMA stand for?

A

Exponentially Weighted Moving Average

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

What is the unique characteristic of an EWMA?

A

It places more weight on data points that occurred more recently.

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

What method in pandas allows us to calculate moving averages?

A

.rolling()

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

What method in pandas allows us to perform operations on all historical values of a time series?

A

.expanding()

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

What pandas method can be used to create exponentially weighted moving averages?

A

.ewm()

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

Given a JavaScript object carInfo with a key “year”, what command assigns the value 2007 to the “year” key?

A

carInfo.year = 2007;

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

How do you comment in HTML?

A

start:

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

What three possible commands start every variable initialization command in JavaScript?

A

var, let, const

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

In HTML, the img tag’s ____ attribute points to the image’s URL.

A

src

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

JavaScript objects are ____ pairs.

A

key-value

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

How do you create a dead link in HTML?

A

<a></a>

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

JavaScript objects are not ____.

A

ordered

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

How can you create a text input in HTML?

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

If you leave it blank, the ORDER BY statement will use ____ by default.

A

ASC

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

Most of Bootstrap’s classes can be applied to ____ elements.

A

div

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

In SQL, where is the LIMIT statement typically placed in a query?

A

at the end of the query

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

How do you make a button fill the width of a screen using Bootstrap?

A

class=”btn-block”

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

For if statements in JavaScript, ____ are not required if the entire statement is on one line.

A

curly brackets

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

How do you import the seaborn library into Python?

A

import seaborn as sns

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

How do you import the Datetime library into Python?

A

from datetime import datetime

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

For an object in Python, what is an important difference between calling attributes versus calling methods?

A

methods have parentheses while attributes do not

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

What pandas function converts a string to a datetime object?

A

pd.to_datetime()

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

Given a DataFrame in pandas named df, how would you calculate 7-day moving averages of the data in the DataFrame?

A

df.rolling(7).mean()

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

What lines get added to a chart to create Bollinger bands?

A

20 day moving average
20 day MA + 2std
20 day MA - 2std

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

What does a kde plot stand for?

A

kernel density estimation

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

What is the poor naming convention associated with the datetime library?

A

Since the datetime library has a datetime method, you must sometimes call datetime.datetime()

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

Dictionaries do not retain ____.

A

order

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

In the command line, the ____ command causes a permanent delete and cannot be undone.

A

rm

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

In matplotlib, what does the alpha argument control?

A

the transparency of a line in a graph

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

How do you import the pandas library into Python?

A

import pandas as pd

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

How do you model exponential growth using linear regression?

A

use a log transformation

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

Write a JavaScript object using the ‘var’ declaration that describes the characteristics of a car.

A
var carInfo = {
make: "Toyota",
year: 1990
};
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
197
Q

What is the syntax for a DROP TABLE command in SQL?

A

DROP TABLE IF EXISTS table_name;

note the IF EXISTS clause is not required, but very useful

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

What command clears the JavaScript console?

A

clear()

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

What is the general syntax of the ALTER TABLE command in SQL?

A

ALTER TABLE table_name ACTION;

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

Given the JavaScript object

myObject = {key:3};

how do you return 3?

A

myObject.key

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

What are the 5 main commands that can be used with the ALTER TABLE command in SQL?

A
ADD COLUMN
DROP COLUMN
RENAME COLUMN
ADD CONSTRAINT
RENAME TO
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
202
Q

In Python, what is the easiest way to return the last item of a list called ‘names’?

A

names[-1]

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

What shortcut clears the terminal?

A

CMD + K

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

Using aq colon, how could you return the first two elements of a list in Python?

A

List[0:2]

This syntax returns UP TO BUT NOT INCLUDING the second element

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

What command creates a new folder in the terminal?

A

mkdir

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

What command would be used to create an index.html file using the command line?

A

touch index.html

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

Given a database connection called “conn” in psycopg2, how do you close the database connection?

A

conn.close()

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

In React, what is a stateless functional component?

A

Any function you write which accepts props and returns JSX.

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

When creating a table in SQL, what are the two main types of column constraints?

A

NOT NULL

UNIQUE

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

In the terminal, typing ____ allows you to open the vim editor.

A

vim

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

Typing ____ allows you to quit the vim editor.

A

:q

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

On the command line, the ____ function moves files from one directory into another. It can also be used to rename a file within the same directory.

A

mv

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

What is the general syntax for the UPDATE command in SQL?

A

UPDATE table_name
SET column = value1
WhERE other_column = value2

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

____ is a JavaScript method used to prevent default behavior.

A

event.preventDefault()

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

Given an array named xyz in Python, how can we calculate the sum and standard deviation of its elements?

A

xyz. sum()

xyz. std()

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

The pandas library is named after ____.

A

panel-data

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

What is the name of the main Python library that works with SQL?

A

psycopg2

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

In JavaScript, what does npm stand for?

A

node package manager

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

In JavaScript, the only strings that are falsy are ____.

A

empty

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

The ____ shortcut allows you to access the currently-selected element in dev tools.

A

$0

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

Using anonymous functions with event listeners can be troublesome because ____

A

they cannot be unbound

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

In JavaScript, what is coercion?

A

when you use the bang operator to convert a non-boolean data type into a boolean

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

Error management in Python is usually implemented using three keywords: ____, ____, and ____

A

try
except
finally

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

____ allow us to search for specific patterns within code.

A

regular expressions

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

In Python, the ____ library allows for working with regular expressions.

A

re

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

What command prints a list of virtual environments in Anaconda?

A

conda info –envs

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

Given a venv named MyDjangoEnv, how do I activate the venv on MacOS? Assume using anaconda

A

source activate MyDjangoEnv

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

What command installs Django on an anaconda venv?

A

conda install django

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

Using the django-admin command line tool, how would you start a new Django project called firsr_project

A

django-admin startproject first_project

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

What character is used for concatenation in JavaScript?

A

+

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

In HTML, do id or class attributes have higher specificity?

A

id

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

When functions are defined in JavaScript, they always start with ____.

A

function

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

Three important properties control the space that surrounds each HTML element: ____

A

padding, margin, and border

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

What is the purpose of the DOM?

A

The DOM allows us to interface our JavaScript code to interact with HTML and CSS

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

In what order do browsers read CSS?

A

top to bottom

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

What does JSON stand for?

A

JavaScript Object Notation

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

In the console of a web browser, how can you use the DOM to return the URL of a website?

A

document.URL

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

How can you make sure that a style declaration is never overridden?

A

by adding ‘!important’ to its declaration

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

In JavaScript, what is the difference between var and let?

A

var is function scoped and let is block scoped

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

How do you create a CSS variable?

A

give it a name with two dashes in front of it

–var

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

Regular expressions are also known as ____ or ____

A

regex

regexp

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

List three possible events in JavaScript

A

Clicks
Hovers
Double Clicks

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

To make font bold in HTML, we can use the ____ tag

A

strong

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

What is the purpose of regular expressions?

A

to match parts of strings

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

In JavaScript, what event listener measures when you stop mousing over an element?

A

mouseout

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

In HTML, you can add a horizontal line across the page using the ____ tag.

A

<hr></hr>

(self-closing)

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

What is the comment character in Python?

A

#

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

What is the remainder (or mod) operator in Python?

A

%

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

How would you create a list called “letters” in Python that contains x, y, and z

A

letters = [x,y,z]

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

In Python, how would you add 4 to the end of a list called ‘numbers’?

A

numbers.append(4)

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

Where should the tag be placed in an HTML document?

A

Just before the closing tag

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

What is the purpose of node.js?

A

Running JavaScript outside of the browser

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

What acronym can be used to memorize the different data types in JavaScript?

A

SNOB N US

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

How do you enable strict mode in JavaScript?

A

add

‘use strict’;

to the top of you tag

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

In JavaScript, var variables are ____ scoped

A

function

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

In Python, what is the main functional difference between tuples and lists?

A

tuples are immutable

257
Q

In JavaScript, let and const variables are ____ scoped

A

block

258
Q

In Python, what is the main syntax difference between tuples and lists?

A

Tuples use round brackets while lists use square brackets

259
Q

Whatis the equality operator in Python?

A

==

260
Q

If you want to run something every 5 seconds in JavaScript, you use a ____ command.

A

interval

261
Q

When creating variables in JavaScript, it is a best practice to instantiate them as ___ by default.

A

const

262
Q

Write an example of snake case

A

this_is_snake_case

263
Q

In JavaScript, what is interpolation?

A

When you put a variable inside of a string

264
Q

Write an example of string interpolation in JavaScript

A

Hello, my name is ${name}

Note: backticks required

265
Q

Given a JavaScript object called ‘person’, how would you return its age?

A

person.age

266
Q

How do == and === differ in JavaScript?

A

=== tests for both value and type

267
Q

What is the purpose of console.dir() in JavaScript?

A

it returns an object’s properties instead of the object itself

268
Q

Custom attributes in web development generally start with the ___ keyword.

A

data

269
Q

How do you add an HTML element to a website using JavaScript?

A

document.createElement()

270
Q

In Python, how would you return the second element of a list called my_list?

A

my_list[1]

271
Q

In Python, a lambda function uses the ____ keyword instead of the def keyword.

A

lambda

272
Q

In a React application, the components folder lies within the ____ folder.

A

src

273
Q

The PRIMARY KEY constraint in SQL is a combination of the ___ and ___ constraints.

A

UNIQUE

NOT NULL

274
Q

One of the most important topics in React is ____.

A

state

275
Q

What command is used to add a row to a SQL table?

A

INSERT INTO

276
Q

In React, the state property must be set to a JavaScript ____.

A

object

277
Q

In JavaScript, a function without a name is called a ____ function.

A

anonymous

278
Q

What is a method in JavaScript?

A

a function that is defined inside of an object

279
Q

Using JavaScript, how would you add the class ‘special’ to an element named myParagraph?

A

myParagraph.classList.add(‘special’)

280
Q

What does XSS stand for?

A

cross-site scripting

281
Q

All HTML elements are ____, but not all ____ are elements.

A

nodes

nodes

282
Q

The ____ file tells Python which package versions are required to run a file.

A

requirements.txt

283
Q

What does REST stand for in REST API?

A

Representational State Transfer

284
Q

What does HTTP stand for?

A

HyperText Transfer Protocol

285
Q

Twitter, Facebook, and Google all use _____ for authentification.

A

OAuth

286
Q

How do you create a comment in SQL?

A

_ _

287
Q

By convention, how do we import the psycopg2 library into Python?

A

import psycopg2 as pg2

288
Q

The file ____ is the center of any Node.js project or npm package.

A

package.json

289
Q

What command is often used to determine whether or not a JavaScript sheet is connected properly to an HTML document?

A

console.log(“connected!”

290
Q

What si the DRY principle?

A

Don’t Repeat Yourself

291
Q

In JavaScript, what regular expression flag allows you to ignore case?

A

i

292
Q

What is jQuery?

A

A JavaScript library focused on interacting with the DOM and making HTTP requests.

293
Q

What is an OBOE error?

A

Off By One Error

294
Q

In JavaScript, the ____ function is useful for when you want to loop over some data and do something with that data.

A

forEach()

295
Q

What does the .map() function do in JavaScript?

A

It applies the same operation to each element of an array.

296
Q

Given an array called ‘names’ and a function called ‘bosify’, write a JavaScript command that would apply bosify to every element of names using the map function.

A

names.map(bosify)

297
Q

Wes Bos recommends against using plus signs to concatenate strings because ____

A

it can be easily confused with mathematical arithmetic

298
Q

How would you create a new Date object in JavaScript? Assume the variable name is ‘birthday’.

A

const birthday = new Date()

299
Q

What is an example of an easy way to get current datetime in JavaScript?

A

Date.now()

300
Q

What website allows for the easy conversion between datetime and timestamps?

A

epoch.now.sh

301
Q

When working with API calls in JavaScript, the ____ function is useful for massaging data to change it into a format that is useful for the user.

A

.map()

302
Q

What does the .filter() function do in JavaScript?

A

it removes items from an array that do not meet a specified condition

303
Q

In JavaScript, the .find() function is similar to the .filter() function except that ________

A

the .find() function only returns the first instance of the specified criterion, while the .filter() function returns all instances of the specified criterion

also, .find() returns an item while .filter() returns an array

304
Q

What is a higher order function?

A

A function that returns another function

305
Q

What are the three most important array functions in JavaScript?

A

map, filter, and reduce

306
Q

What are the two possible arguments for a .map() function in JavaScript?

A

accumulator

item

307
Q

In JavaScript, the ____ command allows you to see all of the properties of a specified JavaScript object in the console.

A

console.dir(object)

308
Q

Everything in JavaScript is an _____.

A

object

309
Q

In JavaScript, the ___ syntax for creating objects does not use the ‘new’ keyword.

A

literal

310
Q

The ‘this’ keyword is always ____ scoped.

A

function

311
Q

Given a prototype named Pizza in JavaScript, how could you add a method to it named ‘eat’?

A

Pizza.prototype.eat = function() {

}

312
Q

Why is it better to add methods to the prototype and not the constructor in JavaScript?

A

Because it allows all instances of the object to reference the prototype, saving code and making the appliaction run faster.

313
Q

In JavaScript, ____, ____, and ____ are functions that are used to change the scope of what ‘this’ is equal to inside of a function.

A

bind, call, and apply

314
Q

If you wanted to make the ‘$’ a shortcut for ‘document.queyrSelector’ in JavaScript, how would you do so?

A

const $ = document.querySelector.bind(document)

315
Q

JavaScript is a single-threaded language, which means ________.

A

only one process can be run at a time

316
Q

Assume that you have navigated to a directory that contains a package.json file. How can you install all dependencies using the Node.js package manager?

A

npm install

317
Q

What is a promise in JavaScript?

A

A promise is an object that may produce a single value some time in the future

318
Q

What are the two possible outputs of a promise in JavaScript?

A

Resolve or reject

319
Q

Promises in JavaScript are used to manage _____

A

The order of code completion

320
Q

How do you catch an error within a promise in JavaScript?

A

by chaining a .catch() to the promise after the .then()

321
Q

In JavaScript, what does the .then() method return?

A

a Promise

322
Q

With Promise-built functions in JavaScript, you must almost always chain a ____ and a ____ onto the end.

A

.then()

.catch()

323
Q

When chaining .then() statements to a JavaScript promise, do you need to also chain multiple .catch() statements?

A

No, one .catch() at the end will handle errors for all of the .then() statements

324
Q

In JavaScript, you can only use async await inside of a function that is ____

A

marked async

325
Q

In JavaScript, the await keyword can only be used inside of ____.

A

An async function

326
Q

What is the await operator used for in JavaScript?

A

to wait for a Promise

327
Q

Provide an example of how to create an async function in JavaScript

A

async function myFunction () {

//function code goes here

}

328
Q

Is top-level usage of the ‘await’ keyword permitted in JavaScript?

A

No.

329
Q

What is meant by top-level usage of the ‘await’ keyword?

A

Using ‘await’ outside of any function

330
Q

What does mlab do?

A

MongoDB database-as-a-service

331
Q

mlab was acquired by ____ and merged into _____

A

MongoDB

MongoDB Atlas

332
Q

Provide an example of a GUI for MongoDB

A

MongoDB Compass

333
Q

Express.js is a framework for _____

A

Node.js

334
Q

Sensitive information like API tokens, passwords, and usernames are typically stored in a ____ file

A

variables.env

335
Q

_______ files should not be pushed to your version control repository

A

variables.env

336
Q

What is the purpose of the ‘dotenv’ library in JavaScript?

A

It allows you to access the contents of a variables.env file by access the properties of a ‘process.env’ object

For example: process.env.DATABASE

337
Q

In JavaScript, give an example of how you would connect to a database using the mongoose and dotenv libraries.

A

mongoose.connect(process.env.DATABASE)

338
Q

Provide an example of how to require the express library and create a router using JavaScript

A
const express = require('express');
const router = express.Router();
339
Q

What JavaScript command is used to import an API call as a proper JavaScript object?

A

JSON.parse();

340
Q

What does AJAX stand for?

A

Asynchronous JavaScript And XML

341
Q

What tab in a browser’s devtools shows all of the API calls performed by the browser?

A

the Network tab

342
Q

How can you filter for just AJAX requests in a browser’s devtools?

A

By clicking on the ‘XHR’ filter

343
Q

What does XHR stand for?

A

XMLHttpRequest

344
Q

There is a good database of public APIs available at _______.

A

github.com/public-apis/public-apis/

345
Q

What does CORS stand for?

A

Cross Origin Resource Sharing

346
Q

What does Babel do?

A

It transpiles modern JavaScript into JavaScript that is runable on older browsers

347
Q

JavaScript modules have their own ___.

A

scope

348
Q

JavaScript modules can only be run on ____.

A

a server

349
Q

How can you install browser-sync at the command line?

A

npm install -g browser-sync

350
Q

What does a minifier do?

A

It makes all of your code as small as possible by shortening variable names and eliminating dead code (defined as code that is never run)

Example: replacing the variable ‘options’ with ‘o’

351
Q

What is webpack?

A

an open-source JavaScript module bundler

352
Q

What command allows you to create a package.json file using the node package manager?

A

npm init

353
Q

While installing modules using the node package manager, -D is the same as ____

A

–save-dev

^ two dashes at start of command

354
Q

What does pwd stand for?

A

print working directory

355
Q

In the command line, what does cd stand for?

A

change directory

356
Q

In the command line, what does mkdir stand for?

A

Make directory

357
Q

On the command line, the ____ command is used to create a new file

A

touch

358
Q

How can you change your default shell to zsh on the command line?

A

chsh -s /bin/zsh

359
Q

What is meant by a ‘dirty’ git repo?

A

It has modifications which have not been committed to the current branch

360
Q

How do you navigate to your home directory using the command line?

A

cd ~

361
Q

By default, most computers hide files that ____

A

start with a dot

Example: .zshrc

362
Q

What file contains your zsh settings? Where is it located?

A

.zshrc

located in your home directory

363
Q

What is the echo command used for on the command line?

A

to print a string

It also allows for variable interpolation

364
Q

How do you see your command history in bash?

A

By using the up arrow

365
Q

Given a folder called ‘directory’, how would you delete it using the ‘rm’ command?

A

rm -r directory

366
Q

How do you install the trash utility at the command line?

A

npm install –global trash

or

npm install –global trash-cli

367
Q

What does the ‘z’ utility do on the command line?

A

Allows you to easily jump to you most popular folders

368
Q

How do you return to your last directory using the z utility?

A

the ‘-‘ command

369
Q

How can you force iTerm to recognize changes made to the .zshrc file?

A

By typing the following command:

source ~/.zshrc

370
Q

What is the purpose of the ‘extract’ plugin for zsh?

A

Unzipping .zip files and other compressed directories

371
Q

How can you open your current directory in Finder from the command line?

A

By typing the following command:

open .

372
Q

What command in iTerm (and, presumably other terminal clients) scrolls you to the very bottom?

A

CMD+R

373
Q

What command allows you to initialize a new git repository named ‘demo’ using the command line interface?

A

git init demo

374
Q

What are the three local git states?

A

working directory
staging area
repository (.git folder)

375
Q

Suppose you just created a README.md file in a git repository. How do you move the file from the working directory into the staging area?

A

git add README.md

376
Q

What is a “staging area” in git?

A

The area between the working directory and the git repository

377
Q

When implementing version control from the command line, it is considered a best practice to stay out of the ____ folder

A

.git

unless you know exactly what you are doing

378
Q

How would you apply version control to an existing folder? Assume you have already navigated to this folder using the command line.

A

git init .

379
Q

How do you split the terminal into a top and bottom pane using tmux?

A

C-b %

380
Q

How do you split the terminal into a left and right pane using tmux?

A

C-b “

381
Q

How do you initiate tmux from the command line?

A

tmux

382
Q

How can you add all files from the current directory into the staging area?

A

git add .

383
Q

How do you save and quit the vim editor?

A

:x

384
Q

How do you quit the vim editor without saving?

A

:x!

385
Q

How do you see a list of all commits in a repository from the command line?

A

git log

386
Q

What command allows you to see the last commit as well as a diff showing all of the changes?

A

git show

387
Q

How can you get a list of tracked files in git?

A

git ls-files

388
Q

What is an express commit?

A

A commit that skips the staging area

389
Q

What command implements a direct commit?

A

git commit -a

390
Q

How do you unstage a change in git?

A

git reset

391
Q

The git ____ command allows you to save custom commands under new names.

A

alias

392
Q

Using git, how would you rename a file from example.txt to demo.txt?

A

git mv example.txt demo.txt

393
Q

Logs are usually saved as ____ files

A

.log

394
Q

What is the purpose of a .gitignore file?

A

It specifies characteristics of files that should be excluded from git add and git commit commands. Logs are a common example.

395
Q

What does HEAD mean in git?

A

HEAD is a reference to the last commit in the currently checked-out branch.

396
Q

What git command would allow you to create a new branch called ‘updates’ and switch to that branch?

A

git checkout -b updates

397
Q

The ____ command is used to switch between branches in git.

A

checkout

398
Q

How do you merge branches from the command line using git? Assume the branch is called ‘updates’.

A

navigate to the master branch and run the following command:

git merge updates

399
Q

What are tags in git?

A

Labels that can be placed at any arbitrary commit point

400
Q

What three files are recommended to be included in every GitHub repository?

A

README LICENSE .gitignore

401
Q

How can you tell if you have no remote connection set up in git?

A

If the following command returns nothing:

git remove -v

402
Q

By convention, the first and primary remote repository is named _____

A

origin

403
Q

In a git repository, what is file extension for the license file?

A

.txt

404
Q

The ____ directory contains all of our SSH related files

A

.ssh

405
Q

What is vi?

A

A text editor that was originally created for the Unix operating system

406
Q

What does vim stand for?

A

Vi + IMproved

407
Q

What command allows you to enter insert mode in vim?

A

i

408
Q

How do you leave insert mode and enter normal mode in vim?

A

The escape key

409
Q

What command allows you to enter line mode from vim?

A

:

410
Q

Normal mode in vim is sometimes called ____ mode

A

command

411
Q

What are the three main modes in vim?

A

Normal mode
Insert mode
Line mode

412
Q

What command in vim saves your changes and exits the file?

A

:wq

think of it as ‘write quit’

413
Q

How would you create a new file called “myFile.txt” using vim?

A

vim myFile.txt

414
Q

How do you move down a line in vim?

A

j

415
Q

How do you move up a line in vim?

A

k

416
Q

How do you move to the right in vim?

A

l

417
Q

How do you move to the left in vim?

A

h

418
Q

How do you page down in vim?

A

CTRL+f

419
Q

How do you page up in vim?

A

CTRL+b

420
Q

What do tildes represent in vim?

A

Lines beyond the end of the actual file

421
Q

What command allows you to move right by 1 word in vim?

A

w

422
Q

What command allows you to move left by 1 word in vim?

A

b

423
Q

What command moves your cursor to the top of the page in vim?

A

z + enter

424
Q

CTRL+R in the command line is similar to ____ in vim

A

z + enter

425
Q

How can you move your cursor to the beginning of the line in vim?

A

0

zero, not O

426
Q

What command allows you to move to the end of a line in vim?

A

$

427
Q

How can you navigate to line 5 using vim?

A

5 gg

428
Q

What is the difference between gg and G in vim?

A

if you do not specify a line number:

gg moves you to the very top of a file
G moves you to the very bottom of a file

429
Q

What command allows you to see how many lines are in a file in vim?

A

CTRL+g

430
Q

In vim, the ____ command is a more detailed version of the CTRL+g command

A

g CTRL+g

431
Q

How do you enable the ruler in vim?

A

:set ruler

432
Q

How do you disable the ruler in vim?

A

:set noruler

433
Q

What command TOGGLES the ruler in vim?

A

:set ruler!

The exclamation mark toggles settings that are modified with the ‘set’ command

434
Q

What command deletes the test at your current cursor position in vim?

A

x

435
Q

What command deletes the character to the left of your cursor in vim?

A

X

uppercase x

436
Q

What command deletes a word in vim?

A

dw

stands for delete word

437
Q

What command deletes the next 5 words in vim?

A

5dw

438
Q

What does the 2d3w command do in vim?

A

Deletes 6 words

439
Q

What are the three main functions of an exclamation mark in vim?

A
  1. Force an action
  2. Toggle a vim setting
  3. Execute an external command
440
Q

How do you open vim’s help system?

A

:help

441
Q

____ is a shortened version of the :help command in vim

A

:h

442
Q

vim uses a concept called ____ where you can store cut and copied text

A

registers

443
Q

How do you cut text in vim?

A

Using the dd command

444
Q

How do you paste text in vim?

A

p

445
Q

What are the two ways to paste in vim?

A

p places the text after your cursor

P places the text before your cursor

446
Q

What is vim’s unique nomenclature for cutting and pasting?

A
cut = delete
copy = yank
paste = put
447
Q

What are the three most commonly-used types of registers in vim?

A

Unnamed
Numbered
Named

448
Q

In vim, registers are preceded with ____

A

double quotes “

449
Q

What commands can fill a register in vim?

A

d, c, s, x, and y

450
Q

What is the purpose of the black hole register in vim?

A

To delete text without effecting existing registers

451
Q

What hotkey is associated with the black hole register in vim?

A

“_

452
Q

How would you append a line onto the j register in vim?

A

Jyy

453
Q

What are the undo and redo commands in vim?

A

u

CTRL+R

454
Q

How do you enter replace mode in vim?

A

SHIFT+R

455
Q

How would you move your cursor to the next instance of a specific character in vim?

A

f then character

456
Q

In vim, how can you enter insert mode below or above the current line?

A
o = below the current line
O = above the current line
457
Q

What does the ‘/’ character do in vim?

A

It moves your cursor to the next matching string you specify

458
Q

What character performs the case switch operation in vim?

A

~

459
Q

What character performs the uppercase operation in vim?

A

gUw

460
Q

What does ‘daw’ stand for in vim?

A

Delete a word

461
Q

What does ‘diw’ stand for in vim?

A

Delete inner word

462
Q

What are the three versions of visual mode in vim?

A

character-wise
line-wise
block-wise

463
Q

How do you start character-wise visual mode in vim?

A

lowercase v

464
Q

How do you start line-wise visual mode in vim?

A

uppercase V

465
Q

How do you start block-wise visual mode in vim?

A

CTRL+n+v

466
Q

Using the pip package manager, how can you tell what packages are installed from the command line?

A

pip list

or

pip3 list

467
Q

What command can you use to create a new virtual environment in Python? Suppose the new environment is called new-environment.

A

python3 -m venv new-environment

468
Q

Given a virtual environemnt called new-environment, how can we activate it from the command line?

A

source new-environment/bin/activate

469
Q

What command lets you know which Python virtual environment is current running?

A

which python

470
Q

How do you deactivate a virtual environment in Python?

A

deactivate

471
Q

What is the common naming convention for virtual environments in Python projects?

A

Saving the environment in a folder called ‘venv’ within the projects’ directory

472
Q

How can you import all of the packages from a requirements.txt file in Python?

A

pip install -r requirements.txt

The -r command means it will be expecting a reqiurements.txt file

473
Q

Virtual environments should usually be included in the ____ file

A

.gitignore

With that said, the requirements.txt should be included

474
Q

How can you clone a GitHub repository using SSH?

A

git clone (SSH URL)

475
Q

How do you pull in all changes to a local clone of a repository on GitHub?

A

git fetch

476
Q

Performing a ____ prior to a GitHub push is considered a best practice.

A

fetch or a pull

477
Q

In git, the ___ and ___ URLs are usually identical

A

push

fetch

478
Q

Assume you’ve cloned a GitHub repo to your local machine, and someone has made modifications to the repository using the GitHub web application. What two commands allow you to (1) check for any new commits and (2) pull the new commits into your local clone of the repository?

A
  1. git fetch

2. git pull

479
Q

Given a SHA-1 hash, how can you find more informaiton about that commit from the command line?

A

git show (SHA-1 hash)

480
Q

What are gists used for?

A

sharing code snippets

481
Q

What does npm install do?

A

Installs all of the dependencies specified in a package.json file.

482
Q

How do you get a React app to begin working on port 3000?

A

npm start

483
Q

How do you clone a gist to your local machine from GitHub?

A

The same way you clone a repository:

git clone SSH-URL

484
Q

Assuming you’re working on the master branch and use default nomenclature, what command pushes local commits to GitHub?

A

git push origin master

485
Q

What is the cleanest way to list files using the command line?

A

ls -al

486
Q

How can you create a new branch on the command line, and then switch into that branch? Assume the new branch is called example-branch

A

git checkout -b example-branch

487
Q

What is the purpose of the git checkout command?

A

To navigate between the branches created by a git branch.

488
Q

How do you bold text in Markdown?

A

__this is bolded__

Double underscores

489
Q

How are emoticons accessed in GitHub comments?

A

With the colon (:) character

490
Q

Given a branch called example-branch, how would you merge it into master from the command line?

A

git merge example-branch

Make sure this command is executed from the master branch

491
Q

What is the LAMP stack?

A

Linux, Apache, MySQL and PHP

492
Q

Anything you can execute on the command line you can put into a ____ script.

A

shell

493
Q

What is shebang?

A
#!
An inexact abbreviation of 'sharp' 'bang'
494
Q

What follows the shebang operator in a shell script?

A

The interpreter to be used for that script.

495
Q

By convention, shell variable names are ____

A

all uppercase

496
Q

Provide an example of string interpolation within a shell script.

A

“I am ${MY_SHELL}ing on my keyboard”

497
Q

What is the (highly) generalized syntax for a condition test within a shell script?

A

[ condition-to-test-for ]

498
Q

Write a generalized example of an if statement within a shell script.

A
if [ condition-is-true ]
then
   command 1
   command 2
   ...
   command N
fi
499
Q

How do if statements end in a shell script?

A

fi

500
Q

Write a generalized example of an if else statement within a shell script.

A
if [ condition-is-true ]
then
   command N
else
   command N
fi
501
Q

Provide a generalized example of a for loop within a shell script.

A
for VARIABLE_NAME in ITEM_1
do
   command 1
   ...
   command N
done
502
Q

How do you comment within a shell script?

A

#

503
Q

When assigning variable names in a shell script, there should be no ______

A

spaces before or after the equals sign

504
Q

Provide an example of variable assignment within a shell script.

A

VARIABLE_NAME=”Value’

505
Q

How do you make a string all lowercase in Python?

A

By using the .lower() method

506
Q

What does ‘origin’ mean in git?

A

In Git, “origin” is a shorthand name for the remote repository that a project was originally cloned from. More precisely, it is used instead of that original repository’s URL - and thereby makes referencing much easier.

507
Q

How do you update all branches of a cloned repository in git?

A

git pull –all

508
Q

In GitHub, releases and ____ are nearly synonymous.

A

tags

509
Q

How does the count function work in Python?

A

The count() method returns the number of occurrences of an element in a list.

510
Q

What is the best way to print numbers from 0 to 9 in Python?

A

for i in range(10):

print(i)

511
Q

How can you generate a sorted array of a string’s characters in Python?

A

sorted(string)

512
Q

How can you transform a string into a list where every character is an item in the list? Assume you are working in Python.

A

splitString = list(string)

513
Q

There is no null value in Python. Instead, there is ____

A

None

514
Q

What command activates a virtual environment in Python?

A

source bin/activate

515
Q

In Django, one of the main commands is ____

A

django-admin

516
Q

How could you start a new Django project called trydjango?

A

django-admin startproject trydjango .

The period is imporant otherwise you’ll have an unnecessary directory layer

517
Q

How can you start running a Django directory on a local server?

A

python3 manage.py runserver

518
Q

In a Django’s project’s settings.py file, what is the BASE_DIR variable?

A

The directory of the Django project

519
Q

When you deploy a Django project into production, the ___ variable should be set to False.

A

DEBUG

520
Q

Django installed apps are similar to ______

A

react components

521
Q

What does WSGI stand for?

A

Web Server Gateway Interface

522
Q

A Django project pairs with a ___ database by default

A

SQLite

523
Q

What command performs a database migration in Django?

A

python3 manage.py migrate

524
Q

How do you create your first superuser in a Django app?

A

python3 manage.py createsuperuser

525
Q

The root of a Django project is where the ___ file is contained

A

manage.py

526
Q

How would you create a new app called blog in a Django project?

A

python3 manage.py startapp blog

527
Q

What two commands should be run every time you make changes to a models.py file in a Django project?

A

python3 manage.py makemigrations

python3 manage.py migrate

528
Q

how would you connect a variable to a text field in a Django database? Assume the variable is called ‘title’

A

title = models.TextField()

529
Q

What is a relative class import?

A

Importing a class from another file within the same parent folder.

530
Q

Assume you created an app named “Product” in a Django project. How do you add it to the admin dashboard?

A

go into admin.py
add ‘from .models import Product’
add ‘admin.site.register(Product)’

531
Q

How can you work on your Django project from the Python shell?

A

python3 manage.py shell

532
Q

How could you create a new Product object in a Django project from the Python shell?

A

Product.objects.create(variables)

533
Q

Whenever you create a new app within a Django project, you should add it to ____

A

INSTALLED_APPS within the settings.py file

534
Q

What is *args in Python?

A

The special syntax *args in function definitions in python is used to pass a variable number of arguments to a function.

535
Q

What is **kwargs in Python?

A

The special syntax **kwargs in function definitions in python is used to pass a keyworded, variable-length argument list.

536
Q

What does REPL stand for?

A

read-evaluate-print-loop

537
Q

What does it mean to serialize something?

A

to serialize something is to convert a rich object (like an instantiated class that you use inside an application) into one long structured string so that you can send it over an HTTP request. then on the other end, the client can convert it back into a rich object

538
Q

To create a page in a Django project, you must create a function that returns ____.

A

HttpResponse(html goes here)

539
Q

What is a best practice name for the folder that acts as the root of a Django project?

A

src

540
Q

In a Django project, each template corresponds to ____.

A

A page on the website

541
Q

What is the best practice filename for the HTML document that all templates inherit from in a Django project?

A

base.html

542
Q

In a Django project, the base.html file must be ____

A

an actual formal HTML document

543
Q

What wrapper sits around templates in a Django project?

A

{% block content %}
{% endblock %}

Note - ‘content’ can be replaced with other blocks like script, title, etc

544
Q

What statement must be at the top of every page in a Django project?

A

{% extends ‘base.html’ %}

545
Q

What are the two possible syntaxes for closing a wrapper block in a Django template?

A

{% endblock %}

{% endblock content %}

note - content can be replaced

546
Q

How can you include a template as an interpolation in a different Django template? Assume the template to be interpolated is called navbar.html

A

{% include ‘navbar.html’ %}

547
Q

What is context in a Django project?

A

It is a key-value pair that allows you to embed {{ key }} in the Django template, while the website renders the value from the dictionary

548
Q

How do you embed context within a Django template?

A

{{ context }}

549
Q

What is one notable way that Django for loops are different from Python for loops?

A

Django for loops must be closed. Example:

{% for item in items %}
<li>{{ item }}</li>
{% endfor %}

550
Q

What is one notable way that Django if statements are different from Python for loops?

A

Django if statements must be closed. Example:
{% if abc == 123 %}
print(‘yes’)
{% endif %}

551
Q

What syntax is noticeably used in Django template tags?

A

The { character

552
Q

Django filters are implemented using what character?

A

The pipe operator

553
Q

What does the dir() functino do in Python?

A

Returns a list of the attributes and methods of the object passed into it

554
Q

In a Django project’s views.py file, each function’s return statement follows what format?

A

return render(request, template.html, {context})

555
Q

How do you import Django’s forms library?

A

from django import forms

556
Q

Django’s built-in ___ function renders out a form using <p> tags</p>

A

.as_p

557
Q

What does Django ORM stand for?

A

Object Relational Mapper

558
Q

What HTTP method is default for an HTML form?

A

GET

559
Q

How can you set up a Google search on your website?

A

Use an HTTP GET method with

action=’http://www.google.com/search’

and input name=’q’

560
Q

In an HTML form, what does the ‘action’ field do?

A

It sends the browser to that URL upon completion of the form.

561
Q

Which HTTP request is used for saving information to a database?

A

POST

562
Q

Django has a nice suite of ___ for HTML forms.

A

validation techniques

563
Q

What is a model in Django?

A

A model is the single, definitive source of information about your data. It contains the essential fields and behaviors of the data you’re storing. Generally, each model maps to a single database table.

564
Q

What is django.shortcuts?

A

The package django.shortcuts collects helper functions and classes that “span” multiple levels of MVC.

565
Q

What function redirects a Django project to a 404 error page is a database entry cannot be found?

A

get_object_or_404

566
Q

In a Django project, how could you get a list of all the entries in a database table called Product?

A

queryset = Product.objects.all()

567
Q

The ____ function allows you to have subfolders for directories on a website (like /products/)

A

includes()

568
Q

By default, the HTTP protocol is served on port ____ of the web server (although this can be modified).

A

80

569
Q

HTTP status ___ means a request has been served successfully.

A

200

570
Q

Nginx is easily able to serve rising levels of ____ requests.

A

concurrent

571
Q

What is a reverse proxy?

A

A reverse proxy is a service that stands between the client and the web servers. It receives the request from the client and sends it on its behalf to the web servers behind it.

572
Q

What does SSL stand for?

A

Secure sockets layer

573
Q

Most of the time you will see Nginx working side-by-side with ____.

A

Apache

574
Q

Having multiple ____ web servers in the backend and using one or more ____ servers in front of them as a reverse proxy will give you the best of both worlds.

A

Apache

Nginx

575
Q

What are the two methods for installing Nginx?

A
  1. Download it and install the percompiled binaries

2. Compile it from source

576
Q

What is Lynx?

A

A text-based web browser

577
Q

What is Wget?

A

A tool used to download files from the Internet using HTTP, HTTPS, or FTP

578
Q

What are the 4 main HTTP methods?

A

GET
POST
PUT
DELETE

579
Q

The ____ HTTP method is typically used to fetch data from a server.

A

GET

580
Q

The ____ and ____ HTTP methods are used to create and update resources in a database.

A

PUT

POST

581
Q

What are the main differences between the PUT and POST HTTP methods?

A

POST should be used to create content

PUT should be used to update content

582
Q

Name the ‘safe’ HTTP methods.

A

GET

583
Q

Name the ‘unsafe’ HTTP methods.

A

PUT, POST, DELETE

584
Q

When it comes to HTTP methods, which methods are considered idempotent?

A

PUT and DELETE

585
Q

What does idempotent mean when it comes to HTTP methods?

A

Multiple executions of an HTTP request will only change the backend database once

586
Q

Of the unsafe HTTP methods, which method is not idempotent?

A

POST

587
Q

What is REST-ful routing?

A

Given a collection of records on a server, there should be a uniform URL and HTTP request method used to utilize that collection of records.

588
Q

Provide an example of a RESTful URL naming convention

A

//:id

589
Q

What are the three situations were RESTful routing tends to fall short?

A
  1. Heavily nested relationships
  2. Too many HTTP requests
  3. Overfetching data (fetching data that is not required)
590
Q

____ is a pre-built application authored by the GraphQL team made solely for development purposes.

A

GraphiQL

591
Q

What are the four main packages required to install express to work with GraphQL?

A

express
express-graphql
graphql
lodash

592
Q

____ is a package that acts as a compatability layer between Express and GraphQL.

A

express-graphql

593
Q

In a GraphQL application, ____ is the file where all of the logic related to Express side of the application will live.

A

server.js

594
Q

_____ is an excellent software tool for creating educational charts and visuals

A

Balsamiq Mockups

595
Q

The ____ file tells GraphQL what your data looks like and what properties are contained within it.

A

schema.js

596
Q

What should always be the first line in a GraphQL schema.js file?

A

const graphql = require(‘graphql’);

597
Q

What is the GraphQL data type for a string?

A

GraphQLString

598
Q

What is the GraphQL data type for an integer?

A

GraphQLInt

599
Q

What is a class method in Python?

A

A class method is a method which is bound to the class and not the object of the class.

600
Q

What does the leading single underscore mean in Python?

A

It is a hint that the variable/method is intended for internal use only

601
Q

When is the trailing underscore used in Python?

A

To avoid conflicts with existing Python keywords

class_ is an example

602
Q

What is the purpose of a lone backslash in Python?

A

A backslash at the end of a line tells Python to extend the current logical line over across to the next physical line.

603
Q

What does it mean when a string literal is preceded by the character r in Python?

A

The r means that the string is to be treated as a raw string, which means all escape codes will be ignored.

604
Q

What does the dj-stripe module do in Python?

A

dj-stripe implements all of the Stripe models, for Django

605
Q

What is the purpose of the requests ilbrary in Python?

A

The requests library is the de facto standard for making HTTP requests in Python.

606
Q

How can you tell which version of node is installed on your computer at the command line?

A

Type

node -v

607
Q

How can you start a development server using the node package manager?

A

npm start

608
Q

create-react-app runs ____ under the hood

A

Webpack

609
Q

How do you import React into a .js file, assuming that it was installed from your package.json using npm install?

A

import React from ‘react’

610
Q

Assume that you are creating a new React component called StorePicker, and you have imported React into your .js folder using the command ‘import React from ‘react’’. How would you create the component?

A

class StorePicker extends React.Component{

}

611
Q

What is the purpose of a .gitkeep file?

A

People who want to track empty directories in Git have created the convention of putting files called .gitkeep in these directories.

612
Q

JSX uses ____ instead of “class”

A

className

613
Q

Using JSX, you can only ever render ____ element(s).

A

one

614
Q

If you’d like to render adjacent elements in a React component, you can wrap them in ____ tags.

A
615
Q

React props are similar to HTML ____.

A

attributes

616
Q

Are there predetermined names for React props?

A

No, you can literally just make them up

617
Q

What is the syntax for any type of React prop that is not a string?

A

prop={500}

618
Q

What is the purpose of curly brackets in JSX?

A

To embed JavaScript snippets within the HTML block

619
Q

In a React component’s file (say, Component.js), how would you embed a prop called ‘tagline’ into an HTML block?

A

this.props.tagline

620
Q

What does the $ do in devtools?

A

You can use $0 to select the last element you selected, $1 for the second last, etc.

621
Q

In React, you can view what ‘this’ is by typing in ___ in the devtools console.

A

$r

622
Q

What is the best practice syntax for a stateless functional component?

A

arrows function & implicit return

623
Q

In JavaScript functions, what is the difference between ‘normal’ export and ‘export default’?

A

A normal export must be imported with curly brackets, like this:

import { getFunName } from ‘../helpers’;

624
Q

The router in React is a _____

A

component

625
Q

The React router is similar to the ____ file in a Django project

A

urls.py

626
Q

What is the purpose of a SyntheticEvent in React?

A

To ensure that the event functions properly across all browsers and platforms

627
Q

How would you call a function called “handleClick” in an HTML element within a React component?

A

Click me!

628
Q

What is the ‘golden rule’ of React?

A

Don’t touch the DOM

629
Q

How do you create an empty ref in a React component? Assume it is called ‘myInput’.

A

myInput = React.createRef();

630
Q

When implementing the constructor for a React.Component subclass, you should call ____ before any other statement.

A

super(props)

631
Q

If you need to access ‘this’ within a React component’s method, what are the two options available to you?

A
  1. use the constructor method at the beginning of the Component
  2. define the method as a prop assigned to an arrow function
632
Q

What is the purpose of ‘push state’ in React?

A

Change the page’s appearance without refreshing the browser

633
Q

In React, ____ is an object that holds data that itself needs and its children may need.

A

state

634
Q

When it comes to React state management, you can’t pass data ____, but you can always pass data ____.

A

up

down

635
Q

What is a linter?

A

lint, or a linter, is a tool that analyzes source code to flag programming errors, bugs, stylistic errors, and suspicious constructs.

636
Q

When accessing data in state, it is considered a best practice to first create ____

A

a copy - to avoid mutating the original state

637
Q

How can you merge two dictionaries into a single dictionary using a single expression? Use Python.

A

z = {**x, **y}

638
Q

What is the MERN stack?

A

Mongo, Express, React, and Node.js