Austin Coding Academy Blog 3

matt coston
2 min readOct 25, 2020

--

1. If a user attempts to create a resource that already exists — for example, an email address that’s already registered — what HTTP status code would you return? Answer: 409 Conflict

2. Consider a responsive site design that requires a full-width image in all responsive states. What would be the correct way to code this to ensure the page loads the smallest image required to fill the space? Answer: The practice consists of a mix of flexible grids and layouts, images, and intelligent use of CSS media queries.

3. When should you npm and when should you yarn? Answer: When installing a package, npm performs the necessary steps sequentially, meaning that each package must be fully installed before moving to the next. However, Yarn has the power to perform multiple installation steps at once, which drastically speeds up the process. It also appears from my Google search that Yarn seems to take put security at the forefront of operations.

4. How can you make sure your dependencies are safe? Answer: When writing Node.js applications, ending up with hundreds or even thousands of dependencies can easily happen.
For example, if you depend on Express, you depend on 27 other modules directly, and of course on those dependencies’ as well, so manually checking all of them is not an option!

The only option is to automate the update/security audit of your dependencies. For that there are free and paid options:

1. npm outdated
2. Trace by RisingStack
3. NSP
4. GreenKeeper
5. Snyk

5. What are the differences between CHAR and VARCHAR data types (MySQL)? Answer: A CHAR field is a fixed length, and VARCHAR is a variable-length field. This means that the storage requirements are different — a CHAR always takes the same amount of space regardless of what you store, whereas the storage requirements for a VARCHAR vary depending on the specific string stored.

6. How else can the JavaScript code below be written using Node.Js to produce the same output?

console.log(“first”); 
setTimeout(function() {
console.log(“second”); }, 0);
console.log(“third”);
// Output:
// first
// third
// second
Answer: console.log(“first”);
setImmediate(() => {
console.log(“second”); });
console.log(“third”);

--

--

matt coston
matt coston

Written by matt coston

0 Followers

Hey there! I'm an IT manager by day, and I dabble in all things web development by night.

No responses yet