Fullstack Javascript Developer

filter-iconFilter interviews by

10+ Fullstack Javascript Developer Interview Questions and Answers

Updated 19 Dec 2024

Popular Companies

search-icon

Q1. Write code to print numbers 1 to n where each number i should get printed after i seconds. Questions around let and var on the solution. Promisify the solution.

Ans.

Print numbers 1 to n with a delay of i seconds for each number.

  • Use a loop to iterate from 1 to n

  • Use setTimeout function to delay the printing of each number

  • Use let instead of var to avoid closure issues

  • Promisify the solution by returning a promise

Q2. What's difference between let , var and const ?

Ans.

let, var and const are all used to declare variables in JavaScript, but they differ in their scope and mutability.

  • let has block scope and can be reassigned

  • var has function scope and can be reassigned

  • const has block scope and cannot be reassigned, but its properties can be mutated

Q3. Given 2 linked list find the intersection node if they intersect

Ans.

To find the intersection node of two linked lists, iterate through both lists and compare each node until a common node is found.

  • Iterate through both linked lists simultaneously

  • Compare each node of the lists until a common node is found

  • If the lists have different lengths, align the starting points by advancing the longer list

Q4. Design a database schema for nested comments on a post

Ans.

Design a database schema for nested comments on a post

  • Create a table for posts with a unique ID

  • Create a table for comments with a unique ID, post ID, and parent comment ID

  • Use foreign keys to link comments to posts and parent comments

  • Use a recursive function to retrieve nested comments

Are these interview questions helpful?

Q5. what is event loop in javascript?

Ans.

Event loop is a mechanism in JavaScript that handles asynchronous operations.

  • Event loop continuously checks the call stack and the task queue.

  • If the call stack is empty, it takes the first task from the queue and pushes it to the call stack.

  • Event loop is responsible for handling callbacks and promises.

  • Event loop prevents blocking of the main thread.

Q6. What is maps, reduce, hoisting, strings, var, let, const

Ans.

Maps, reduce, hoisting, strings, var, let, const are important concepts in JavaScript development.

  • Maps: Used to transform elements in an array without changing the original array.

  • Reduce: Used to reduce an array to a single value by applying a function to each element.

  • Hoisting: Refers to the behavior in JavaScript where variable and function declarations are moved to the top of their containing scope.

  • Strings: Data type used to represent text in JavaScript.

  • Var: Declares a varia...read more

Share interview questions and help millions of jobseekers 🌟

man-with-laptop

Q7. Design a calculator in React

Ans.

A calculator app built using React

  • Create a component for the calculator

  • Use state to keep track of the input and result

  • Implement functions for basic arithmetic operations

  • Add buttons for each number and operation

  • Display the input and result on the screen

Q8. Explain Higher order functions

Ans.

Higher order functions are functions that take other functions as arguments or return functions as their output.

  • Higher order functions can be used to create more flexible and reusable code.

  • They allow for functions to be composed and combined in various ways.

  • Examples of higher order functions include map, filter, and reduce in JavaScript.

  • Higher order functions can also be used for currying and partial application.

Fullstack Javascript Developer Jobs

JavaScript Full stack developer - React, Node, Nest 3-10 years
Encora
3.8
Chennai
Fullstack JavaScript Developer 3-7 years
Inspirisys
4.0
Chennai
JavaScript Full Stack Developer - React.js/Node.js (1-2 yrs) 1-2 years
Techjays
4.3

Q9. What is event loops

Ans.

Event loops are mechanisms in programming languages that allow for asynchronous execution of code.

  • Event loops handle the execution of multiple tasks in a non-blocking manner.

  • They continuously check for tasks in the event queue and execute them one by one.

  • Event loops are commonly used in JavaScript to handle asynchronous operations like setTimeout, setInterval, and AJAX requests.

Q10. Implement custom hook

Ans.

Custom hook is a reusable function in React that allows you to extract component logic into a separate function.

  • Create a function starting with 'use' keyword (e.g. useCustomHook)

  • Use useState, useEffect, useContext, or other hooks inside the custom hook

  • Return the necessary values or functions from the custom hook

Q11. remove nth node from ll

Ans.

Remove the nth node from a linked list

  • Traverse the linked list to find the nth node

  • Update the pointers to skip over the nth node

  • Handle edge cases like removing the head node

Q12. Middleware in nodejs and uses

Ans.

Middleware in Node.js is a function that has access to the request and response objects, and can modify or terminate the request-response cycle.

  • Middleware functions are executed sequentially in the order they are defined.

  • They can be used for tasks such as logging, authentication, error handling, etc.

  • Example: Express.js uses middleware extensively for handling requests.

Interview Tips & Stories
Ace your next interview with expert advice and inspiring stories

Interview experiences of popular companies

3.7
 • 261 Interviews
3.5
 • 59 Interviews
4.0
 • 12 Interviews
4.4
 • 4 Interviews
View all

Calculate your in-hand salary

Confused about how your in-hand salary is calculated? Enter your annual salary (CTC) and get your in-hand salary

Recently Viewed
COMPANY BENEFITS
Dilip Buildcon
304 benefits
COMPANY BENEFITS
Dilip Buildcon
304 benefits
COMPANY BENEFITS
IRB Infrastructure
60 benefits
COMPANY BENEFITS
KNR Constructions
20 benefits
JOBS
Browse jobs
Discover jobs you love
INTERVIEWS
Vserv Digital Services
No Interviews
DESIGNATION
DESIGNATION
LIST OF COMPANIES
Indian Space Research Organisation
Overview
DESIGNATION
Fullstack Javascript Developer Interview Questions
Share an Interview
Stay ahead in your career. Get AmbitionBox app
qr-code
Helping over 1 Crore job seekers every month in choosing their right fit company
65 L+

Reviews

4 L+

Interviews

4 Cr+

Salaries

1 Cr+

Users/Month

Contribute to help millions

Made with ❤️ in India. Trademarks belong to their respective owners. All rights reserved © 2024 Info Edge (India) Ltd.

Follow us
  • Youtube
  • Instagram
  • LinkedIn
  • Facebook
  • Twitter