• 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?

The status code that is returned is 409. There also might be a message letting the user know that a resource already exists with the name that was being used.

  • 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?

To make a full-width image fit in all responsive states on a website you could use the @media rule in css to make it so that the appropriate sized image will show up at certain responsive states.

  • When should you npm and when should you yarn?

It’s all based on whether I cared about the difference in speed between NPM and yarn. NPM is slower and is what I would use now because I’m not trying to download tons of different dependencies for my projects. In the future I’m sure that yarn would be the better option only because my projects would be much larger compared to what I do now.

  • How can you make sure your dependencies are safe?

To make sure a dependency is safe it’s important to look at who published the package, the number of versions and the number of weekly downloads. If the numbers come out very low it might be better to just try a different package.

  • What are the differences between CHAR and VARCHAR data types (MySQL)?

The difference between char and varchar is that char is a fixed length variable while varchar is a varied length variable. A Char(x) string has exactly x characters in length. A varchar(x) string can have up to x number of characters but doesn’t have to be exactly x it can be less. Another difference I’ve read about was when pulling data from a table if the data you’re pulling from a CHAR field it is faster because it doesn’t have to do any data manipulation or index lookups like you would have to do on a VARCHAR field.

  • 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

I couldn’t figure out how to get my code to get the exact same output but the idea was to use setImmediate from node to make second come after third in the console output by forcing it to come out after every other output was returned. I definitely need to look over this more.