0% found this document useful (0 votes)
26 views13 pages

React + Node

The document contains the questions and answers from a quiz about React and Node.js concepts. It includes 18 multiple choice questions testing knowledge of topics like debugging in Node, environment variables, DOM access, component architecture, and code quality best practices. The responses show an understanding of using tools like console.log() for debugging, storing credentials securely, platform detection, and implementing single responsibility principles.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
26 views13 pages

React + Node

The document contains the questions and answers from a quiz about React and Node.js concepts. It includes 18 multiple choice questions testing knowledge of topics like debugging in Node, environment variables, DOM access, component architecture, and code quality best practices. The responses show an understanding of using tools like console.log() for debugging, storing credentials securely, platform detection, and implementing single responsibility principles.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 13

9/4/23, 7:58 PM React + Node

React + Node
The respondent's email (wehfis@[Link]) was recorded on submission of this form.

ID Code *

ZN36W

Question 1

Use npm run debug to print all values to the terminal

Pass them to [Link]()

Add a print statement

Write them to the standard output with [Link]()

Question 2

Access the credentials with env vars using [Link]

Obfuscate the creds by using unconventional variable names

Host the creds via a shared API that the app can call

Edit out the creds when distributing the code, and edit them back in before deploying

Question 3

[Link] 1/13
9/4/23, 7:58 PM React + Node

Use the built-in input() function to get a line of input as a single string

Use the createInterface method from the readline module to create a prompt

Open the stdin file with readFileSync and read a single line

Open a raw socket and connect it to the file descriptor for standard input

Question 4

[Link] does not have a DOM

[Link] has a read-only, immutable DOM

[Link] limits access to the DOM

[Link] has a different syntax for accessing the DOM

Question 5

[Link] 2/13
9/4/23, 7:58 PM React + Node

Use [Link] to detected the platform

Check the value of the User-Agent request header

Request [Link] configuration file from their browser for platform-specific data

Try to load proprietary features to see which platform-specific functionality their


browser supports

Question 6

orange

apple

{ context: 'apple', value: 'orange' }

undefined

Question 7

[Link] 3/13
9/4/23, 7:58 PM React + Node

MyChild component

TripleValue component

Container component

DoubleValue component

Question 8

[Link] 4/13
9/4/23, 7:58 PM React + Node

No value will be displayed inside the button

morning good

good morning

undefined

Question 9

[Link] 5/13
9/4/23, 7:58 PM React + Node

MyRedComponent

null

None. The code will result in an error

MyBlueComponent

Question 10

[Link] 6/13
9/4/23, 7:58 PM React + Node

World Hello World

Hello World

World Hello

Hello World World

Question 11

[Link] 7/13
9/4/23, 7:58 PM React + Node

Use an array of errors for endpoints that can have multiple errors, and use a string
for endpoints that can only have one

Always respond with an error string showing the first error

Respond with an array of errors when it has two or more errors and use string
otherwise

Respond with an array of errors, even if it only contains one error

Question 12

Delete the code and start over

Add comments to the code. Comments allow everyone to know whats going on and
which section do what

Condense your code. Your method should be under 15 lines

Move each individual functionality into its own method. Each method should be
under 10 lines

Question 13

[Link] 8/13
9/4/23, 7:58 PM React + Node

Use a multi-line comment under the function header to describe what you did in the
method

Use single-line comments throughout the code in each method to describe the
complex aspects of what your code does

Document them in the docs, where appropriate, and dont comment on your code
(i.e., code should comment itself)

Use a docblock and remind readers to check the code to make sure the comments is
still accurate

Question 14

Leave the methods long so you can accomplish more with less method usage.

Making every class be in its own file with the filename starting with "class."

Keeping methods short and single-purposed. Also make sure that the code follows
SOLID, DRY, and YAGNI

Keep methods short and single-purposed. Also make sure that all variables use
easy-to-understand names

Question 15

[Link] 9/13
9/4/23, 7:58 PM React + Node

Always rely on the API's response. Never use the cache value

Make a new method to get the total. That method should take a cache value

Make all code use only the cached data. If the cache is null, then switch to the API
and cache it

Make the cache store the API response for a day, and every day that same method
should reach out to the API again

Question 16

No one

Kirk

Sophie

Kirk and Sophie

Question 17

[Link] 10/13
9/4/23, 7:58 PM React + Node

13

38

63

65

Question 18

Only for 60%

No, the water is flowing out faster than the pump can fill it

Yes, but much slower

Only for 40%

Question 19

[Link] 11/13
9/4/23, 7:58 PM React + Node

Step C

Step D

Step E

Step Y

Question 20

20

25

This content is neither created nor endorsed by Google. - Terms of Service - Privacy Policy

Forms

[Link] 12/13
9/4/23, 7:58 PM React + Node

[Link] 13/13

You might also like