Skip to content

Instantly share code, notes, and snippets.

@hrdwdmrbl
Last active May 21, 2021 16:35
Show Gist options
  • Save hrdwdmrbl/7c403de170e91cf3bb5a67a32e310c5a to your computer and use it in GitHub Desktop.
Save hrdwdmrbl/7c403de170e91cf3bb5a67a32e310c5a to your computer and use it in GitHub Desktop.
Interview Questions

Topic: REST

Q. Can you tell me what a RESTful API is and isn't?

A. Technically it means that the server holds no state. All state comes from the client. All API endpoints each serve a single purpose.

Topic: Rails

Q. What is CSRF and how does Rails protect against it?

A. Cross Site Request Forgery is when one website tries tells your browser to make a rquest to another website. Rails prevents this by embedding a secret token on its page that you have to give it back when you make a request. Other websites won't have that token.

Q. What is the difference between Ruby's Hash and Rail's HashWithIndifferentAccess?

A. HashWithIndifferentAccess can use strings OR symbols as keys to access values.

Topic: Ruby

Q. What is the difference between String vs Symbols?

A. Symbols are unique / singletons / global. All symbols with the same content share the same object ID. Symbols are immutable. The same things cannot be said about strings.

Topic: Git

Q1. What are the functions you commonly use with Git?

A. Expect them to include rebase. If they don't, skip Q2.

Q2. Tell me about what rebase does

A. Rebase ise used to move one brand on top of another. Technically it is used to change the branching point of the brand. It makes it so that different history is included. It takes a branch and brings it up to date with another branch. Generally this is used to rebase a feature branch on top of master to include master's new history. This prevent merge conflicts and makes history nicer.

Q3. Why can rebasing be dangerous?

A. Because it changes history.

Topic: Javascript

// Case 1
const object1 = {
  foo: function() {
    console.log(this)
  }
}

object1.foo()

Q. What is this in Case 1?

A. this is object1.

// Case 2
const bar = function() {
    console.log(this)
}

bar()

Q. What is this in Case 2? A. In a browser, this is window.

Topic: The web

Q. What are web workers?

A. Webworkers allow you to perform work in another thread in a browser. Usually used for background work.

Q. What are service workers?

A.

Q. What is HTTP2 and how does it change the way web applications are developed?

A. From a developer's perspective it changes the optimal way to serve "assets" (javascript, CSS, images). With HTTP2 it is now better to not bundle all JS or CSS into a single file. This is because all traffic to a website shares a single connection instead of multiple being created.

Q. What do the 400 series of status codes do?

A. The 400 series are all various kinds of errors that the client made.

Topic: HTML

Q. What is the different between a span and a div?

A. The difference is that span uses display: inline and div uses display: block.

Topic: CSS

Q. Explain what elements will match each of the following CSS selectors:

div, p
div p
div > p
div + p
div ~ p

A.

div, p - Selects all <div> elements and all <p> elements
div p - Selects all <p> elements that are anywhere inside a <div> element
div > p - Selects all <p> elements where the immediate parent is a <div> element
div + p - Selects all <p> elements that are placed immediately after a <div> element
div ~ p - Selects all <p> elements that are anywhere preceded by a <div> element

Topic: Deployment

Q. When deploying a large-scale Rails application, what are the different services you would use?

A. Services would include the webservers, load balancer, database, CDN, and caching.

Topic: Scaling

Q. What would you do on the backend to scale a website a website from 100 to 100,000 customers?

A. Answers could incldue: Caching, larger machines, multiple machines with a load balancer, bigger database, optimizing database usage, and more.

Topic: SQL

Q. What are SQL window functions?

A. Window functions allow you to divide a set of rows (or table) into multiple sets to perform the query on each set.

Topic: The internet

Q. What is DNS? When setting up a website, what does an application developer need to do?

A. With their domain registrar they need to configure their DNS settings to point to their servers or web service provider.

Topic: Learning

Note: Feel free to change these questions

Q. What do you hope to learn in the next year?

A. No correct answer, just that they are wanting to learn.

Q. How to learn about new topics?

A. No correct answer, make probe their learning.

Q. What have to learned in the last month?

A. Again, just trying to probe their learning.

Topic: Brag about something

Talk about a technical skill or deep experience with a specific area that you feel makes you stand out from the rest of your colleagues.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment