DEV Community

Annie Liao
Annie Liao

Posted on

Fullstack Trivia: Can You Answer These Interview Questions in 5 Minutes?

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?
  2. What does git rebase do?
  3. In HTML, what's the difference between div tag and span tag?
  4. What are CSS vendor prefixes?
  5. Is JavaScript single-threaded or multi-threaded?
  6. In JavaScript, what is an arrow function?
  7. In SQL, what are primary keys and foreign keys?
  8. What is caching in terms of different layers/stages?
  9. What are generators?
  10. In unit testing, what are some quantitative metrics for testing a codebase?

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?

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

2. What does Git rebase do?

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

3. In HTML, what's the difference between div tag and span tag?

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

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

Source: CSS Vendor Prefixes

5. Is JavaScript single-threaded or multi-threaded?

Single-threaded. Here's a cool explainer on how JavaScript can be asynchronous AND single-thread at the same time.

6. In JavaScript, what is an arrow function?

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 (pun intended) I created to become more familiar with the this keyword.

7. In SQL, what are primary keys and foreign keys?

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?

I found a caching overview on the AWS site, 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.

9. What are generators?

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?

10. In unit testing, what are some quantitative metrics for testing a codebase?

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 you can use in a continuous testing process.


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

Happy learning!

Top comments (6)

Collapse
 
tomstreeter profile image
Tom Streeter • Edited

An alternate (NOT better) answer to #3: They are both generic HTML containers. A <div> defines a two-dimensional container that has both definable horizontal and vertical dimensions. A <span>is one-dimensional in that it only describes length in the direction the user reads text (either horizontally or vertically based on culture).

Collapse
 
liaowow profile image
Annie Liao

I did not know that. Thanks for the input, Tom!

Collapse
 
bloodgain profile image
Cliff

I don't find trivia questions like these very useful in an interview. Many of these are looking for a definition, often a non-textbook one at that, and people tend to be bad at that. For instance, I understand generators very well, and I don't think I would have come up with that definition on the fly. I could definitely teach you about them, how to use them, and even how to create them in Python -- but probably not in less than 5 minutes. But if you couldn't answer any of these, it wouldn't mean you don't know what I need you to know to start working.

The closest I get to asking these types of trivia questions is gauging how well someone knows the languages on their resume and deep programming concepts in general. For instance, I might ask them to compare and contrast C++ and Python if they have both on their resume, and sometimes help them along by asking about the differences in how they pass parameters to a function, for instance. But what I'm usually trying to find out is how advanced their knowledge is, not whether or not they're a good hire. These are core concepts I would expect any experienced programmer to grasp, though, not trivia.

The only other occasion I might lean toward the trivia end is if someone claims mastery. If you tell me you're a C++ expert, but you can't tell me how a struct and a class differ (hint: there's really only one difference, and it's the default access modifier), I have some questions about your claim. A Java expert had better be able to talk about garbage collection and the limitations/gotchas of the Java generics system (the phrase "type erasure" should really come up).

Collapse
 
romank0 profile image
Roman Konoval

The answer to #1 is slightly incorrect. git fetch does download all the changes from the remote, but unlike git pull it does not incorporate them in your local branch.

Collapse
 
liaowow profile image
Annie Liao

Ah, I see. Thanks for clarifying. I recently saw a diagram that describes git pull as git fetch + git merge. That makes it easier for me to distinguish the two.

Collapse
 
bloodgain profile image
Cliff

Not only can it be described as such, it is exactly that. From the git pull doc page:
"In its default mode, git pull is shorthand for git fetch followed by git merge FETCH_HEAD."