Fullstack Developer Intern
40+ Fullstack Developer Intern Interview Questions and Answers
Q1. Shortest Path in an Unweighted Graph
The city of Ninjaland is represented as an unweighted graph with houses and roads. There are 'N' houses numbered 1 to 'N', connected by 'M' bidirectional roads. A road conne...read more
Implement a function to find the shortest path in an unweighted graph from house 'S' to house 'T'.
Use Breadth First Search (BFS) algorithm to find the shortest path in an unweighted graph.
Create a queue to store the current house and its neighbors, and a visited set to keep track of visited houses.
Start BFS from house 'S' and stop when reaching house 'T'.
Return the path from 'S' to 'T' once 'T' is reached.
If multiple shortest paths exist, any one can be returned.
Example: For ...read more
Q2. Dijkstra's Shortest Path Problem
Given an undirected graph with ‘V’ vertices (labeled 0, 1, ... , V-1) and ‘E’ edges, where each edge has a weight representing the distance between two connected nodes (X, Y).
Y...read more
Dijkstra's algorithm is used to find the shortest path from a source node to all other nodes in a graph with weighted edges.
Implement Dijkstra's algorithm to find the shortest path distances from the source node to all other nodes
Use a priority queue to efficiently select the next node with the shortest distance
Update the distances of neighboring nodes if a shorter path is found
Handle disconnected vertices by assigning a large value (e.g., 2147483647) as the distance
Ensure no...read more
Fullstack Developer Intern Interview Questions and Answers for Freshers
Q3. Longest Common Subsequence Problem Statement
Given two strings STR1
and STR2
, determine the length of their longest common subsequence.
A subsequence is a sequence that can be derived from another sequence by d...read more
The task is to find the length of the longest common subsequence between two given strings.
Implement a function to find the longest common subsequence between two strings.
Use dynamic programming to solve the problem efficiently.
Iterate through the strings and build a matrix to store the lengths of common subsequences.
Return the length of the longest common subsequence.
Example: For input STR1 = 'abcde' and STR2 = 'ace', the longest common subsequence is 'ace' with a length of ...read more
Q4. Second Most Repeated Word Problem Statement
You are given an array of strings ARR
. The task is to find out the second most frequently repeated word in the array. It is guaranteed that each string in the array h...read more
Find the second most repeated word in an array of strings with unique frequencies.
Iterate through the array and count the frequency of each word using a hashmap.
Sort the hashmap by frequency in descending order.
Return the second key in the sorted hashmap.
Q5. Graph Connectivity Queries Problem
Given a graph with N
nodes and a threshold value THRESHOLDVALUE
, two distinct nodes X
and Y
are directly connected if there exists a Z
such that:
X % Z == 0
Y % Z == 0
Z >= THRE...read more
Determine if two nodes in a graph are connected directly or indirectly based on a given threshold value and queries.
Iterate through each query and check if the nodes are connected based on the given conditions
Use the concept of greatest common divisor (GCD) to determine connectivity
Return a list of 1s and 0s indicating connectivity for each query
Q6. Four Keys Keyboard Problem Statement
Imagine you have a special keyboard with four keys:
- Key 1: (A) to print one ‘A’ on screen.
- Key 2: (Ctrl-A) to select the entire screen.
- Key 3: (Ctrl-C) to copy the selectio...read more
Given a special keyboard with four keys, determine the maximum number of 'A's that can be printed on the screen by pressing the keys 'N' times.
Use dynamic programming to keep track of the maximum number of 'A's that can be printed at each step.
At each step, consider the possibilities of pressing 'A', 'Ctrl-A', 'Ctrl-C', and 'Ctrl-V'.
Optimally choose the sequence of keys to maximize the number of 'A's printed on the screen.
Example: For N = 7, the optimal sequence is: A, A, A, ...read more
Share interview questions and help millions of jobseekers 🌟
Q7. N Queens Problem
Given an integer N
, find all possible placements of N
queens on an N x N
chessboard such that no two queens threaten each other.
Explanation:
A queen can attack another queen if they are in the...read more
The N Queens Problem involves finding all possible placements of N queens on an N x N chessboard where no two queens threaten each other.
Use backtracking algorithm to explore all possible configurations.
Keep track of rows, columns, and diagonals to ensure queens do not threaten each other.
Generate all valid configurations and print them out.
Consider edge cases like N = 1 or N = 2 where no valid configurations exist.
Q8. Snake and Ladder Problem Statement
Given a 'Snake and Ladder' board with N rows and N columns, where positions are numbered from 1 to (N*N) starting from the bottom left, alternating direction each row, find th...read more
Find the minimum number of dice throws required to reach the last cell on a 'Snake and Ladder' board.
Use Breadth First Search (BFS) algorithm to find the shortest path from start to end cell.
Create a mapping of each cell to its corresponding row and column on the board.
Consider the special cases of snakes and ladders while calculating the next possible moves.
Keep track of visited cells to avoid revisiting them during the traversal.
Fullstack Developer Intern Jobs
Q9. What is a linkedlist and its pros ?
A linked list is a linear data structure where each element is a separate object with a pointer to the next element.
Linkedlist allows for efficient insertion and deletion of elements
It can be used to implement stacks, queues, and graphs
Traversal is slower compared to arrays
Examples include singly linked list, doubly linked list, and circular linked list
Q10. You are given a series of strings: ['asa', 'adsf', 'das2g', 'dasd4', 'ds230']. Your task is to print the strings that contain at least one digit. After your initial approach, you were asked to optimize it furth...
read morePrint strings with at least one digit from given array.
Iterate through each string in the array and check if it contains a digit using regular expressions.
Use the regex pattern '\d' to match any digit in a string.
Print the strings that match the pattern.
Q11. What is Hoisting? What is closure?
Hoisting is a JavaScript mechanism where variables and function declarations are moved to the top of their scope.
Hoisting applies to variable declarations and function declarations
Variables are initialized with undefined and functions are fully defined
Hoisting only moves the declarations, not the assignments
Example: console.log(x); var x = 5; // Output: undefined
Closure is a function that has access to its outer function's variables, even after the outer function has returned...read more
Q12. What is this in javascript ?
This could refer to anything in javascript, please provide more context.
Please provide more context for a specific answer.
It could be a variable, function, object, or any other javascript construct.
Without more information, it is impossible to provide a specific answer.
Q13. What marks NodeJS different than javascript and why to use it
NodeJS is a runtime environment for executing JavaScript code outside of a web browser.
NodeJS allows JavaScript to be run on the server-side, enabling backend development.
NodeJS has a built-in library of modules that can be easily integrated into applications.
NodeJS is event-driven and non-blocking, making it efficient for handling multiple requests simultaneously.
Q14. You are given two numbers, 'n' and 'm' calculate and print the sum of the series n/1, n/2, n/3, ..., n/m?
The sum of the series n/1, n/2, n/3, ..., n/m is calculated and printed.
Iterate from 1 to m and calculate n divided by the current number in the iteration.
Add all the calculated values to get the sum of the series.
Print the final sum of the series.
Q15. What is box model? Center the input tag?
Box model is a way of representing HTML elements as rectangular boxes with content, padding, border, and margin.
The box model consists of content, padding, border, and margin.
Content is the actual content of the element.
Padding is the space between the content and the border.
Border is the line that surrounds the padding and content.
Margin is the space between the border and other elements.
To center an input tag, set margin-left and margin-right to auto and display to block.
Q16. Explain All sorting techniques and implement bubble sort in online compiler.
Explanation of sorting techniques and implementation of bubble sort
Sorting techniques include bubble sort, selection sort, insertion sort, merge sort, quick sort, etc.
Bubble sort compares adjacent elements and swaps them if they are in the wrong order, repeating until the array is sorted.
Example: [5, 3, 8, 2, 1] -> [3, 5, 8, 2, 1] -> [3, 5, 2, 8, 1] -> [3, 5, 2, 1, 8] -> [3, 2, 5, 1, 8] -> [3, 2, 1, 5, 8] -> [2, 3, 1, 5, 8] -> [2, 1, 3, 5, 8] -> [1, 2, 3, 5, 8]
Q17. can we store database using only post
No, databases cannot be stored using only POST requests.
Databases are typically stored on a server or in the cloud, not through HTTP requests.
POST requests are used to send data to a server, not to store databases.
Database management systems like MySQL, PostgreSQL, or MongoDB are used to store and manage databases.
Q18. What is useState in react?
useState is a hook in React that allows functional components to have state variables.
useState is a built-in hook in React.
It allows functional components to have state variables.
It takes an initial state value and returns an array with the current state value and a function to update it.
The state can be updated using the function returned by useState.
Example: const [count, setCount] = useState(0);
Q19. What is temporal deadzone ?
Temporal dead zone is a behavior in JavaScript where a variable cannot be accessed before it is declared.
Variables declared with let and const are hoisted but cannot be accessed before their declaration
Trying to access a variable in its temporal dead zone results in a ReferenceError
Temporal dead zone is a feature introduced in ES6 to improve JavaScript's scoping mechanism
Q20. Data Types In Javascript
Data types in JavaScript include primitive and object types.
Primitive types include string, number, boolean, null, undefined, and symbol.
Object types include arrays, functions, and objects.
Typeof operator can be used to determine the type of a variable.
Type coercion can occur when different types are used together.
Q21. What are APIs? Different types of methods
APIs are sets of rules and protocols that allow different software applications to communicate with each other.
APIs stand for Application Programming Interfaces
Types of APIs include REST, SOAP, and GraphQL
API methods include GET, POST, PUT, DELETE
Examples: GET method retrieves data from a server, POST method sends data to a server
Q22. What are hooks in reactjs? How many you used?
Hooks in ReactJS are functions that let you use state and other React features in functional components. I have used useState and useEffect hooks.
Hooks are introduced in React 16.8 to allow state and lifecycle features in functional components.
useState hook is used to add state variables in functional components.
useEffect hook is used to perform side effects in functional components, similar to componentDidMount and componentDidUpdate in class components.
Q23. worst case time complexity of merge-sort
The worst case time complexity of merge-sort is O(n log n).
Merge-sort divides the array into two halves, recursively sorts them, and then merges them back together.
In the worst case scenario, the array is divided log n times and each division takes O(n) time.
Therefore, the worst case time complexity of merge-sort is O(n log n).
Q24. Difference between Path Variable and Query Variable and it's Significance
Path variables are part of the URL path, while query variables are part of the URL query string.
Path variables are used to identify a specific resource in the URL path, while query variables are used to provide additional parameters for a resource.
Path variables are typically used for essential parameters, while query variables are optional.
Example: Path variable in URL - /users/{userId}, Query variable in URL - /users?sortBy=name
Path variables are more secure as they are not...read more
Q25. What is Hashmap and its time complexity?
Hashmap is a data structure that stores key-value pairs and provides constant time complexity for insertion, deletion, and retrieval.
Hashmap is also known as dictionary, associative array, or hash table.
It uses a hash function to map keys to their corresponding values in an array.
Time complexity for insertion, deletion, and retrieval is O(1) on average, but can be O(n) in worst case scenarios.
Example: HashMap
map = new HashMap<>(); map.put("apple", 5); int value = map.get("ap...read more
Q26. what is transactions and limits in sql?
Transactions in SQL are a way to ensure data integrity by grouping multiple SQL statements into a single unit of work.
Transactions help maintain the ACID properties of a database (Atomicity, Consistency, Isolation, Durability).
They allow multiple SQL statements to be executed as a single unit, either all succeeding or all failing.
Limits in SQL refer to constraints set on the amount of data that can be stored or processed in a database table or query result.
Examples of limits ...read more
Q27. What are the cookies and where they are stored.
Cookies are small pieces of data stored on a user's computer by websites to remember user information and preferences.
Cookies are stored on the user's computer in the form of text files.
They are used by websites to track user activity, remember login credentials, and personalize user experiences.
Cookies can be either session cookies (temporary) or persistent cookies (stored for longer periods).
Q28. What is Passport JS(I have used it in my project).
Passport JS is a popular authentication middleware for Node.js.
Passport JS is used for authenticating users in Node.js applications.
It supports various authentication strategies such as local, OAuth, OpenID, etc.
Passport JS simplifies the process of implementing authentication by providing a flexible and modular framework.
Example: passport.use(new LocalStrategy(...));
Q29. Difference between Javascript and Java
Javascript is a scripting language used for web development, while Java is a general-purpose programming language.
Javascript is interpreted, while Java is compiled
Javascript is used for client-side scripting, while Java is used for server-side programming
Javascript is loosely typed, while Java is strongly typed
Javascript has a prototype-based object model, while Java has a class-based object model
Q30. What is React Vdom ?
React Vdom is a virtual representation of the actual DOM used by React to optimize rendering performance.
Vdom is a lightweight copy of the actual DOM tree.
React compares the previous and current Vdom trees to determine the minimum number of changes required to update the actual DOM.
This approach reduces the number of DOM manipulations and improves performance.
Vdom can be created using React.createElement() or JSX syntax.
Q31. what is dependency injection
Dependency injection is a design pattern where components are given their dependencies rather than creating them internally.
Dependency injection helps in achieving loose coupling between classes.
It allows for easier testing by providing mock dependencies.
There are three types of dependency injection - constructor injection, setter injection, and interface injection.
Q32. what is functional interface
Functional interface is an interface with only one abstract method, used in Java to achieve functional programming.
Functional interface has only one abstract method, but can have multiple default or static methods.
It can be annotated with @FunctionalInterface to ensure it has only one abstract method.
Functional interfaces are used in Java to enable functional programming features like lambda expressions.
Examples of functional interfaces in Java include Runnable, Callable, and...read more
Q33. Tell something about React lifecycle management
React lifecycle management refers to the sequence of events that occur during the lifespan of a React component.
React components go through various stages such as mounting, updating, and unmounting.
During mounting, constructor, render, and componentDidMount methods are called.
During updating, componentDidUpdate method is called after a component's state or props change.
During unmounting, componentWillUnmount method is called before a component is removed from the DOM.
Lifecycl...read more
Q34. Difference between Controlled Components and Uncontrolled Components
Controlled components are controlled by React state, while uncontrolled components manage their own state internally.
Controlled components are controlled by React state and their value is set by the parent component.
Uncontrolled components manage their own state internally and their value is handled by the DOM.
Controlled components provide more control and flexibility, while uncontrolled components are simpler to implement.
Example: Controlled components - input fields with va...read more
Q35. What are API, explain in brief?
API stands for Application Programming Interface, it allows different software applications to communicate with each other.
APIs define the methods and data formats that applications can use to request and exchange information.
They allow developers to access the functionality of a service or application without needing to understand its internal workings.
Examples of APIs include Google Maps API for integrating maps into websites, Twitter API for accessing tweets and user data,...read more
Q36. What is Node.js and its architecture.
Node.js is a runtime environment that allows you to run JavaScript on the server side.
Node.js is built on Chrome's V8 JavaScript engine.
It uses an event-driven, non-blocking I/O model that makes it lightweight and efficient.
Node.js has a single-threaded event loop that handles all asynchronous operations.
It has a module-based architecture, allowing developers to easily add functionality through npm packages.
Node.js is commonly used for building server-side applications, APIs,...read more
Q37. what is JWT and authentication?
JWT is a JSON Web Token used for authentication in web applications.
JWT is an open standard for creating access tokens that can securely transmit information between parties.
It consists of three parts: header, payload, and signature.
JWTs are commonly used for user authentication and authorization in web applications.
Example: 'eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxMjM0NTY3ODkwIiwibmFtZSI6IkpvaG4gRG9lIiwiaWF0IjoxNTE2MjM5MDIyfQ.SflKxwRJSMeKKF2QT4fwpMeJf36POk6yJV_adQss...read more
Q38. What is DOM and how virtual dom works
DOM stands for Document Object Model, a tree-like structure representing the HTML elements of a web page. Virtual DOM is a lightweight copy of the actual DOM used for efficient updates.
DOM is a programming interface for web documents, allowing scripts to dynamically access and update the content, structure, and style of HTML documents.
Virtual DOM is a concept where a lightweight copy of the actual DOM is created in memory, allowing for efficient updates without directly manip...read more
Q39. introduction types of joins in sql and their use
Types of joins in SQL include inner join, left join, right join, and full outer join.
Inner join: Returns rows when there is a match in both tables.
Left join: Returns all rows from the left table and the matched rows from the right table.
Right join: Returns all rows from the right table and the matched rows from the left table.
Full outer join: Returns rows when there is a match in either table.
Q40. What is redux in react?
Redux is a predictable state container for JavaScript apps.
Redux is a state management tool commonly used with React.
It helps in managing the state of the application in a predictable way.
Redux stores the entire state of the application in a single immutable state tree.
Actions are dispatched to update the state, and reducers specify how the state changes in response to actions.
Redux is commonly used for larger applications with complex state management needs.
Q41. Explaining the algorithm used in projects
I have used various algorithms such as sorting, searching, and graph algorithms in my projects.
Implemented quicksort algorithm for sorting large datasets efficiently
Utilized Dijkstra's algorithm for finding shortest path in a graph
Implemented binary search algorithm for efficient searching in a sorted array
Q42. Which programing language you know
I am proficient in Java, Python, JavaScript, and C++.
Java
Python
JavaScript
C++
Q43. Explain Binary search
Binary search is a search algorithm that finds the position of a target value within a sorted array.
Divide the array into two halves and compare the target value with the middle element.
If the target value is less than the middle element, search the left half. If greater, search the right half.
Repeat the process until the target value is found or the subarray is empty.
Q44. What is socket programming
Socket programming is a way of connecting two nodes on a network to communicate with each other.
It involves creating a socket object, binding it to a specific port on a specific IP address, listening for incoming connections, and then sending and receiving data.
Commonly used in client-server applications where the server listens for incoming connections and the client initiates the connection.
Examples include chat applications, online gaming, and real-time data transfer.
Socke...read more
Q45. Design Database Model for
Design a database model for a social media platform
Create tables for users, posts, comments, likes, followers, etc.
Establish relationships between tables using foreign keys
Consider indexing for faster data retrieval
Implement user authentication and authorization mechanisms
Q46. What are event loop?
Event loop is a mechanism in JavaScript that allows for asynchronous operations to be executed in a non-blocking way.
Event loop is a part of the JavaScript runtime that handles asynchronous operations.
It allows for functions to be executed in a non-blocking manner, ensuring that the program remains responsive.
Event loop continuously checks the call stack and the callback queue, moving functions from the queue to the stack when the stack is empty.
Example: setTimeout() function...read more
Q47. difference between == and ===
The difference between == and === is that == checks for equality after type coercion, while === checks for equality without type coercion.
== is a loose equality comparison, allowing for type coercion (e.g. '1' == 1 is true)
=== is a strict equality comparison, requiring both value and type to be the same (e.g. '1' === 1 is false)
Q48. Explain Hook concept.
Hooks are a feature in React that allow you to use state and other React features in functional components.
Hooks were introduced in React 16.8 to allow functional components to have state and lifecycle methods.
useState() is a hook that allows you to add state to functional components.
useEffect() is a hook that allows you to perform side effects in functional components.
Custom hooks are reusable functions that can contain stateful logic and be shared across multiple components...read more
Interview Questions of Similar Designations
Top Interview Questions for Fullstack Developer Intern Related Skills
Interview experiences of popular companies
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
Reviews
Interviews
Salaries
Users/Month