Fullstack Trivia: Can You Answer These Interview Questions in 5 Minutes?
Tags: git, javascript, career, interview
Published: 2020-09-11 22:46:22

Technical interviews come in all shapes and sizes. Some companies go for the traditional algorithm challenges, others tend to be more creative, such as this Fullstack Engineer interview I had the other day. 

Toward the end of a fun, relaxing conversation, the interviewer gave me a quick challenge: Answer a series of trivia-like tech questions that involve varying levels of knowledge in software development.

I got roughly a third of them right, which wasn't too bad considering the time constraints and my "freshness" in the field.

During the 5-minute exercise, I also jotted down as many questions as I could in order to share with you all, my beloved DEV community.

So grab a timer, fasten your seat belt, see if you can answer these 10 questions in 5 minutes.

Ready, 

Set, 

Go!

⏳




## Questions List
1. [What's the difference between `git fetch` and `git pull`?](#1)
2. [What does `git rebase` do?](#2)
3. [In HTML, what's the difference between `div` tag and `span` tag?](#3)
4. [What are CSS vendor prefixes?](#4)
5. [Is JavaScript single-threaded or multi-threaded?](#5)
6. [In JavaScript, what is an arrow function?](#6)
7. [In SQL, what are primary keys and foreign keys?](#7)
8. [What is caching in terms of different layers/stages?](#8)
9. [What are generators?](#9)
10. [In unit testing, what are some quantitative metrics for testing a codebase?](#10)

<hr>

If those questions seem easy to you, well, congratulations, you are definitely more than a junior developer! 

If you had trouble answering many of the questions above, worry not, here are some resources I've collected from the world wide web:


### 1. What's the difference between Git fetch and Git pull?<a name="1"></a>

> `git fetch` is the command that tells your local git to retrieve the latest meta-data info from the original.

> `git pull` does what `git fetch` does AND brings (copy) those changes from the remote repository.

Source: [freeCodeCamp](https://www.freecodecamp.org/news/git-fetch-vs-pull/#:~:text=git%20fetch%20is%20the%20command,changes%20from%20the%20remote%20repository.) 

### 2. What does Git rebase do?<a name="2"></a>

> We use `git rebase` when we want to take all commits from our feature branch, and move them into the main branch.

> Rebasing is often used as an alternative to merging. Rebasing a branch updates one branch with another by applying the commits of one branch on top of the commits of another branch.

Source: [Rebase — One of the Most Powerful Git Commands](https://medium.com/osedea/git-rebase-powerful-command-507bbac4a234)

### 3. In HTML, what's the difference between `div` tag and `span` tag? <a name="3"></a>

`<div>`: block-level, primarily used to organize the layout of the page.

`<span>`: inline-level, mainly used to style a part of a text.

### 4. What are CSS vendor prefixes? <a name="4"></a>

> Vendor prefixes are one way browsers use to give CSS developers access to newer features not yet considered stable.

Source: [CSS Vendor Prefixes](https://flaviocopes.com/css-vendor-prefixes/)

### 5. Is JavaScript single-threaded or multi-threaded? <a name="5"></a>

Single-threaded. Here's a [cool explainer](https://medium.com/@samimyaquby/how-can-javascript-be-asynchronous-and-single-threaded-at-the-same-time-c13c99bb4703) on how JavaScript can be asynchronous AND single-thread at the same time.

### 6. In JavaScript, what is an arrow function? <a name="6"></a>

An arrow function is a part of ES6 syntax. It does NOT have its own 'this' keyword. Instead, an arrow function will use the 'this' keyword of whatever 'this' was outside the function when it was created.

You can take ["this" quiz](https://dev.to/liaowow/take-this-quiz-understand-how-this-works-in-javascript-44dj) (pun intended) I created to become more familiar with the `this` keyword.

### 7. In SQL, what are primary keys and foreign keys? <a name="7"></a>

Primary key: unique ID/address of each row of the table.
Foreign key: a set of columns in a table that refers to the primary key of another table.

### 8. What is caching in terms of different layers/stages? <a name="8"></a>

I found a caching overview on [the AWS site](https://aws.amazon.com/caching/), which has a nice diagram and table explaining the use case for each layer: client-side, DNS, Web, App, and Database.

Feel free to also check out an intro to caching in [Django documentation](https://docs.djangoproject.com/en/3.1/topics/cache/).

### 9. What are generators? <a name="9"></a>

In some programming languages, e.g. Python, a generator is "an iterator in the style of iterating by need."

> We won’t calculate and store the values at once but generate them on the fly when we’re iterating.

Source: [What Are Generators, Yields, and Streams in Python?](https://medium.com/better-programming/what-are-generators-yields-and-streams-in-python-a94072b3eb93)

### 10. In unit testing, what are some quantitative metrics for testing a codebase? <a name="10"></a>

According to my interviewer, **code coverage** is one way of verifying the extent to which the code has been executed.

If you're interested in learning more about testing metrics, I found a post that introduces [25 metrics](https://softcrylic.com/blogs/top-25-metrics-measure-continuous-testing-process/) you can use in a continuous testing process.

<hr>

As always, if you have other helpful resources or tutorials on any of the questions, please let me know in the comments.

Happy learning!