/back-end-interview-topics

A list of helpful Back-End related interview topics.

MIT LicenseMIT

Back-End Interview Topics

This repository contains a list of Back-End interview topics that I had to review, or want to deepen.

Feel free to contribute, it would be highly appreciated!

[⬆] return to Table of Contents

  • Is everything that’s asynchronous in Node.js handled by the libuv's Worker Pool?

  • What are the phases of the Event Loop?

  • What do you know about Worker Threads module in Node.js?

  • What is the difference between process.nextTick(), setTimeout(), setInterval(), and setImmediate()?

  • What are the Timers functions of Node.js?

  • What can be done if a Timeout or Immediate object needs to be cancelled?

  • What will printed by running the following code:

    const fs = require('fs');
    
    fs.readFile(__filename, () => {
      setTimeout(() => {
          console.log('timeout');
      }, 0);
      setImmediate(() => {
          console.log('immediate');
      });
      process.nextTick(() => {
          console.log('nextTick');
      });
    });
  • Explain what is Reactor Pattern in Node.js?

  • Rewrite the code sample without try/catch block:

    async function check(req, res) {
      try {
          const a = await someOtherFunction();
          const b = await somethingElseFunction();
          res.send("result")
      } catch (error) {
          res.send(error.stack);
      }
    }
  • What is Globals in Node.js? (explain global, process, and buffer)

  • What is the use of Underscore (_) in Node.js?

  • What are Error First Callbacks in Node.js?

  • How to gracefully shutdown/kill Node.js process? (explain process.kill())

  • What is the difference between readFile() vs createReadStream()?

  • What is the EventEmitter in Node.js?

  • How many types of Streams are present in Node.js?

  • How to solve Process out of Memory Exception in Node.js?

  • What is the use of DNS module in Node.js?

  • What's wrong with the following code snippet? (explain timing attacks)

    function checkApiKey (apiKeyFromDb, apiKeyReceived) {
      if (apiKeyFromDb === apiKeyReceived) {
          return true
      }
      return false
    }
  • How does Node.js support multi-processor platforms, and does it fully utilize all processor resources? (explain Cluster module)

  • Consider the following code snippet:

    {
      console.time("loop");
      for (var i = 0; i < 1000000; i += 1){
          // Do nothing
      }
      console.timeEnd("loop");
    }

Resources:

[⬆] return to Table of Contents

  • What are the pros and cons of functional programming vs object-oriented programming?
  • What are the four pillars of OOP? (A brief description for each one)
  • What is dynamic or run time polymorphism?
  • What is static/early binding and dynamic/late binding?
  • When is classical inheritance an appropriate choice?
  • When is prototypal inheritance an appropriate choice?
  • What does “favor object composition over class inheritance” mean? When should we choose inheritance over composition?
  • When it is more appropriate to use a structure (struct) instead of a class?
  • What are abstract classes? What are the distinct characteristics of an abstract class?
  • How is method overriding different from method overloading?
  • What is the difference between cohesion and coupling?
  • Why should we strive for "high cohesion, and low coupling" in designing a system?
  • Explain the concept of destructor/deinitializer?
  • What is LSP (Liskov Substitution Principle) and what are some examples of its use?
  • What is the difference between association, aggregation and composition?

[⬆] return to Table of Contents

  • What does the term network topology refer to? Describe the star topology and its cons?
  • What are the layers of the OSI reference model? (A brief description for each layer)
  • What are the layers of the TCP/IP model? (A brief description for each layer)
  • What are the differences between IPv4 and IPv6?
  • What are the differences between TCP and UDP?
  • What are DNS, DHCP, and NAT?
  • What does the tracert tool (Windows) or the traceroute tool (Linux) do?
  • What are CDNs? What are its pros and cons?
  • What are the differences between reverse proxies and forward proxies?
  • What does the term AAA mean in network security?
  • What is DoS/DDoS? How can protect servers from it?

[⬆] return to Table of Contents

  • Microservices Architecture:

    • What is the Microservices architecture? And what are its pros and cons?
    • What are the differences between Monolithic, SOA and Microservices?
    • What is the API Gateway pattern?
    • What are the decomposition patterns used in Microservices? (briefly describe decomposition by business capability, decomposition by subdomain, and self-contained services)
    • What are the deployment strategies used in Microservices?
    • What are the challenges faced while working with Microservices?
    • What is Domain Driven Design (DDD)?
    • What is Ubiquitous Language (UL) and what is its uses in DDD?
    • What is the Distributed Transaction pattern?
    • What is the Bounded Context pattern?
    • What do you understand by Contract Testing?
    • What is End to End Testing in Microservices?
    • What are Reactive Extensions in Microservices?

[⬆] return to Table of Contents

  • Suppose we have two tables tbl1 and tbl2; Each of these tables contains one column on which join condition has been defined. The table tbl1 contains the column col1 and the table tbl2 contains the column col2.

    • What will the outcome of the following inner join query?
    SELECT a.col1, b.col2
    FROM tbl1 a INNER JOIN tbl2 b
    ON a.col1 = b.col2
    • What will the outcome of the following left outer join query?
    SELECT a.col1, b.col2
    FROM tbl1 a LEFT OUTER JOIN tbl2 b
    ON a.col1 = b.col2
    • What will the outcome of the following right outer join query?
    SELECT a.col1, b.col2
    FROM tbl1 a RIGHT OUTER JOIN tbl2 b
    ON a.col1 = b.col2
    • What will the outcome of the following full outer join query?
    SELECT a.col1, b.col2
    FROM tbl1 a FULL OUTER JOIN tbl2 b
    ON a.col1 = b.col2

    In case of:     - Join columns having unique values.     - Join columns having duplicate values.      - One Join table contains Null value.      - Both tables containing Null values.

  • Consider the following staffs table:

    id first_name last_name manager_id
    1 Genna Jakson NULL
    2 Adam Ahmed 1
    3 Kali Boyer 2
    4 Layla David 2
    5 Ali Mohamed 3

    The staffs table stores the staff information such as id, first_name, and last_name. It also has a column named manager_id that specifies the direct manager.

    Use self join and recursive common table expression (CTE) to get who reports to whom?

  • Describe and give an example of the cross join?

[⬆] return to Table of Contents

  • What is the difference between Docker and VM (Virtual Machine)?
  • What is Docker?
  • What is the advantage of Docker over Hypervisors? (briefly describe What is the main difference between the approaches of Docker and standard hypervisor virtualization?)
  • What is Docker Image and Container?
  • What is the default Docker network driver, and how can you change it when running a Docker image?
  • What are the four different restart policies in Docker?
  • What is Docker Compose? What can it be used for?
  • What is Docker Hub and what is the other type of Docker Image Registry?
  • What are the possible ways of using insecure Docker image registries? What are the possible ways of using insecure Docker image registries?
  • What is Docker Swarm? What can it be used for?
  • What is Dockerfile? What can it be used for?
  • Is there any data loss when the Docker container exits?
  • Why docker-compose down may take 10 seconds to recreate or stop? (briefly describe SIGTERM and SIGKILL)
  • What’s the difference between docker-compose up, docker-compose run, and docker-compose start?
  • What’s the benefit of Dockerizing?
  • Is there a possibility to include specific code with COPY/ADD or a volume?
  • What are the differences between the docker run and the docker create?
  • What are the various states that a Docker container can be in at any given point in time?
  • What is the preferred way of removing containers - docker rm -f or docker stop then followed by a docker rm?
  • What does the volume parameter -v do in a docker run command?
  • What is the use of the docker save and docker load commands?
  • Is there any problem with just using the latest tag in a container orchestration environment? What is considered best practice for image tagging?

[⬆] return to Table of Contents

  • What is JSON Web Token? And when to use it?
  • What is the JSON Web Token structure? And How does it work?
  • What is OAuth 2.0? What are its roles?
  • What are the five grants for acquiring an access token in OAuth 2.0?

[⬆] return to Table of Contents

Resources:

[⬆] return to Table of Contents

Resources:

[⬆] return to Table of Contents

  • What is the difference between static array and dynamic array?
  • Compare the time complexity and space complexity of searching, insertion, and deletion for the following data structures:
    • Dynamic Array
    • Linked List
    • Hash Table (Hash Map)
    • Binary Search Tree (BST)
    • Heap (Max Heap/Min Heap)
    • Red-Black Tree
    • AVL Tree
  • Compare the time complexity and space complexity for the following sorting algorithms:
    • Bubble Sort
    • Insertion Sort
    • Selection Sort
    • Merge Sort
    • Heap Sort
    • Quick Sort
    • Counting Sort
  • What is the difference between inorder, preorder, and postorder tree traversal algorithms?
  • What is the difference between breadth-first-search (BFS) and depth-first-search (DFS)?

[⬆] return to Table of Contents

  • What is the Agile Software Development standing for? And why we should use it!
  • What is the difference between the Agile and Waterfall software development models?
  • What is the four main principles of the Agile Software Development? (Agile Manifesto)
  • How does Agile work?
  • List some Agile software development (or system development) methodologies?
  • What is the difference between Kanban and Scrum Agile frameworks?
  • What is the duration of a Scrum sprint?
  • What is the Scrum of Scrums?
  • What is the term increment standing for, in Scrum context?
  • Explain the scrum poker/planning poker technique?
  • What is the Release candidate?
  • What is a story point in the Scrum?
  • What are the main roles in the Scrum?
  • What are the Sprint Planning meeting, Stand-up meeting, Definition of Done (DoD) meeting, and Sprint Retrospective meeting?

[⬆] return to Table of Contents