Codementor Events

8 Ultimate Full Stack Interview Questions and Answers

Published Jul 14, 2018

8 Ultimate Full Stack Interview Questions and AnswersA Full-Stack Web Developer is someone who is able to work on both the front-end and back-end portions of an application. Front-end generally refers to the portion of an application the user will see or interact with, and the back-end is the part of the application that handles the logic, database interactions, user authentication, server configuration, etc.

Q1: What is Inversion of Control?

Topic: Design Patterns
Difficulty: ⭐⭐

Inversion of control is a broad term but for a software developer it’s most commonly described as a pattern used for decoupling components and layers in the system.

For example, say your application has a text editor component and you want to provide spell checking. Your standard code would look something like this:

public class TextEditor {
    private SpellChecker checker;
    public TextEditor() {
        this.checker = new SpellChecker();
    }
}

What we’ve done here creates a dependency between the TextEditor and the SpellChecker. In an IoC scenario we would instead do something like this:

public class TextEditor {
    private IocSpellChecker checker;
    public TextEditor(IocSpellChecker checker) {
        this.checker = checker;
    }
}

You have inverted control by handing the responsibility of instantiating the spell checker from the TextEditor class to the caller.

SpellChecker sc = new SpellChecker; // dependency
TextEditor textEditor = new TextEditor(sc);

🔗 Source: stackoverflow.com

Q2: What are the success factors for Continuous Integration?

Topic: DevOps
Difficulty: ⭐⭐

  • Maintain a code repository
  • Automate the build
  • Make the build self-testing
  • Everyone commits to the baseline every day
  • Every commit (to baseline) should be built
  • Keep the build fast
  • Test in a clone of the production environment
  • Make it easy to get the latest deliverables
  • Everyone can see the results of the latest build
  • Automate deployment

🔗 Source: edureka.co

Q3: If Node.js is single threaded then how it handles concurrency?

Topic: Node.js
Difficulty: ⭐⭐

Node provides a single thread to programmers so that code can be written easily and without bottleneck. Node internally uses multiple POSIX threads for various I/O operations such as File, DNS, Network calls etc.

When Node gets I/O request it creates or uses a thread to perform that I/O operation and once the operation is done, it pushes the result to the event queue. On each such event, event loop runs and checks the queue and if the execution stack of Node is empty then it adds the queue result to execution stack.

This is how Node manages concurrency.

🔗 Source: codeforgeek.com

Q4: Explain a use case for Docker

Topic: DevOps
Difficulty: ⭐⭐⭐

  • Docker a low overhead way to run virtual machines on your local box or in the cloud. Although they’re not strictly distinct machines, nor do they need to boot an OS, they give you many of those benefits.
  • Docker can encapsulate legacy applications, allowing you to deploy them to servers that might not otherwise be easy to setup with older packages & software versions.
  • Docker can be used to build test boxes, during your deploy process to facilitate continuous integration testing.
  • Docker can be used to provision boxes in the cloud, and with swarm you can orchestrate clusters too.

🔗 Source: dev.to

Q5: Explain the main difference between REST and GraphQL

Topic: GraphQL
Difficulty: ⭐⭐⭐

The main and most important difference between REST and GraphQL is that GraphQL is not dealing with dedicated resources, instead everything is regarded as a graph and therefore is connected and can be queried to app exact needs.

🔗 Source: medium.com/codingthesmartway-com-blog

Q6: What is Event Loop?

Topic: Node.js
Difficulty: ⭐⭐⭐

Node.js is a single threaded application but it support concurrency via concept of event and callbacks. As every API of Node js are asynchronous and being a single thread, it uses async function calls to maintain the concurrency. Node uses observer pattern. Node thread keeps an event loop and whenever any task get completed, it fires the corresponding event which signals the event listener function to get executed.

🔗 Source: tutorialspoint.com

Q7: Can you explain what “git reset” does in plain english?

Topic: Git
Difficulty: ⭐⭐⭐⭐

In general, git reset function is to take the current branch and reset it to point somewhere else, and possibly bring the index and work tree along.

- A - B - C (HEAD, master)
# after git reset B (--mixed by default)
- A - B (HEAD, master) # - C is still here (working tree didn't change state), but there's no branch pointing to it anymore

Remeber that in git you have:

  • the HEAD pointer, which tells you what commit you’re working on
  • the working tree, which represents the state of the files on your system
  • the staging area (also called the index), which “stages” changes so that they can later be committed together

So consider:

  • git reset --soft moves HEAD but doesn’t touch the staging area or the working tree.
  • git reset --mixed moves HEAD and updates the staging area, but not the working tree.
  • git reset --merge moves HEAD, resets the staging area, and tries to move all the changes in your working tree into the new working tree.
  • git reset --hard moves HEAD and adjusts your staging area and working tree to the new HEAD, throwing away everything.

Use cases:

  • Use --soft when you want to move to another commit and patch things up without “losing your place”. It’s pretty rare that you need this.
  • Use --mixed (which is the default) when you want to see what things look like at another commit, but you don’t want to lose any changes you already have.
  • Use --merge when you want to move to a new spot but incorporate the changes you already have into that the working tree.
  • Use --hard to wipe everything out and start a fresh slate at the new commit.

🔗 Source: stackoverflow.com

Q8: Are there any disadvantages to GraphQL?

Topic: GraphQL
Difficulty: ⭐⭐⭐⭐

Disadvantages:

  • You need to learn how to set up GraphQL. The ecosystem is still rapidly evolving so you have to keep up.
  • You need to send the queries from the client, you can just send strings but if you want more comfort and caching you’ll use a client library -> extra code in your client
  • You need to define the schema beforehand => extra work before you get results
  • You need to have a graphql endpoint on your server => new libraries that you don’t know yet
  • Graphql queries are more bytes than simply going to a REST endpoint
  • The server needs to do more processing to parse the query and verify the parameters

🔗 Source: stackoverflow.com

Thanks 🙌 for reading and good luck on your interview!
Check more FullStack Interview Questions & Answers on 👉 www.fullstack.cafe

Discover and read more posts from Alex Ershov
get started
post commentsBe the first to share your opinion
Show more replies