
TCS


20+ TCS Front end Developer Interview Questions and Answers
Q1. Allocate Books Problem Statement
Given an array of integers arr
, where arr[i]
represents the number of pages in the i-th
book, and an integer m
representing the number of students, allocate all the books in suc...read more
Allocate books to students in a way that minimizes the maximum number of pages assigned to a student.
Iterate through possible allocations and calculate the maximum pages assigned to a student.
Find the minimum of these maximums to get the optimal allocation.
Return the minimum pages allocated in each test case, or -1 if not possible.
Q2. Do you know about React middlewares? why are they used?
React middlewares are functions that intercept and modify requests and responses in a React application.
Middlewares are used to add additional functionality to an application without modifying the core code.
They can be used for authentication, logging, error handling, and more.
Examples of React middlewares include Redux Thunk, Redux Saga, and React Router.
They are typically implemented using higher-order functions.
Middlewares can be chained together to create a pipeline of fu...read more
Q3. What is Redux, and what are the differences between Redux and Context?
Redux is a predictable state container for JavaScript apps. It helps manage the state of an application in a centralized way.
Redux is a state management library commonly used with React to manage the state of an application.
It follows a unidirectional data flow pattern, where the state is stored in a single store and changes are made through actions and reducers.
Redux allows for a more structured way of managing state compared to local component state in React.
Context, on the...read more
Q4. What are JavaScript closures, the temporal dead zone (TDZ), hoisting, and the JavaScript engine?
JavaScript closures, TDZ, hoisting, and the JavaScript engine are key concepts in understanding how JavaScript works.
JavaScript closures are functions that have access to variables from their outer scope even after the outer function has finished executing.
Temporal Dead Zone (TDZ) is the period between entering a scope and the variable being declared where accessing the variable results in a ReferenceError.
Hoisting is the JavaScript behavior where variable and function declar...read more
Q5. What is the difference between visibility: hidden and display: none in CSS?
visibility: hidden hides an element but still takes up space, while display: none hides an element and removes it from the flow of the document.
visibility: hidden hides the element but it still occupies space on the page
display: none hides the element and removes it from the document flow
visibility: hidden elements are still rendered, just not visible
display: none elements are not rendered at all
Q6. what is box model? What is Clousers ? let var and const difference
Box model is a concept in CSS where every HTML element is considered as a rectangular box with 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 the adjacent elements
Box-sizing property can be used to change the default box model behavior
Q7. Do you know about React Native Context Api?
Yes, React Native Context API is a way to manage global state in React Native applications.
Context API allows passing data through the component tree without having to pass props down manually at every level.
It is useful for managing global state such as user authentication, theme, and language preferences.
Context API consists of two parts: the Provider component and the Consumer component.
The Provider component is used to wrap the components that need access to the global st...read more
Q8. Is multiple inheritance supported in Java
No, Java does not support multiple inheritance.
Java only supports single inheritance through classes.
However, multiple inheritance can be achieved through interfaces.
Diamond problem can be avoided in interfaces by implementing default methods.
Example: class A extends B implements C, D {}
Q9. React Native Functional components lifecycle methods?
React Native functional components have limited lifecycle methods compared to class components.
Functional components use useEffect() instead of componentDidMount() and componentDidUpdate()
useEffect() can be used to handle component mount, update, and unmount
useEffect() takes a callback function and an array of dependencies as arguments
The callback function can return a cleanup function to handle component unmount
Functional components do not have access to shouldComponentUpdat...read more
Q10. What is api? Application programming interface collect the backend data show the UI
API stands for Application Programming Interface. It is a set of rules and protocols that 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 system or service without needing to understand its internal workings.
Examples of APIs include Google Maps API for embedding maps in websites, Twitter API for acc...read more
Q11. Sql server stored procedure and functions
SQL Server stored procedures and functions
Stored procedures are precompiled SQL statements that can be executed with parameters
Functions return a single value and can be used in SQL statements
Both can improve performance and security by reducing network traffic and preventing SQL injection attacks
Q12. What are spread and rest operator
Spread operator allows an iterable to be expanded in places where zero or more arguments are expected. Rest operator collects all the remaining elements into an array.
Spread operator is denoted by three dots (...)
Spread operator can be used to copy an array or object
Rest operator is also denoted by three dots (...) and is used in function parameters to collect all remaining arguments into an array
Q13. What is front end development
Front end development is the creation of the user interface and user experience of a website or application.
Involves HTML, CSS, and JavaScript
Focuses on the visual and interactive aspects of a website or application
Requires knowledge of design principles and user behavior
Examples include creating responsive layouts, implementing animations, and optimizing performance
Q14. Css full form and html full form
CSS stands for Cascading Style Sheets and HTML stands for HyperText Markup Language.
CSS - Cascading Style Sheets is used for styling web pages
HTML - HyperText Markup Language is used for creating the structure of web pages
Q15. What is props in react?
Props in React are read-only properties that are passed from a parent component to a child component.
Props allow data to be passed down the component tree.
Props are immutable and cannot be changed by the child component.
Props are accessed in the child component using this.props.
Q16. Tell about Angular new versions
Angular releases new versions regularly with updates and improvements.
Angular follows a semantic versioning scheme with major, minor, and patch updates.
Major updates introduce breaking changes and new features.
Minor updates add new features and improvements.
Patch updates include bug fixes and minor enhancements.
For example, Angular 10 introduced stricter types, improved performance, and updated dependencies.
Q17. what is state and props
State and props are two important concepts in React for managing and passing data between components.
State is used to store and manage data within a component. It is mutable and can be updated using setState() method.
Props (short for properties) are used to pass data from parent to child components. They are immutable.
State is internal to a component, while props are external and passed down from parent components.
Example: State can be used to store form input values, while p...read more
Q18. Difference b/w props and state?
Props are used to pass data from parent to child components, while state is used to manage data within a component.
Props are read-only and cannot be modified by the component receiving them.
State is mutable and can be changed by the component that owns it.
Props are passed down from parent components, while state is managed locally within a component.
Example: Passing a user's name as a prop to a child component vs. storing the user's input in a form field as state.
Q19. what are pure functions
Pure functions are functions that always return the same output for the same input and have no side effects.
Always return the same output for the same input
Have no side effects, meaning they do not modify external state or variables
Pure functions are predictable and easier to test and debug
Q20. How to create loops
Loops are used to repeatedly execute a block of code until a certain condition is met.
Use 'for' loop to iterate over a block of code a specified number of times
Use 'while' loop to execute a block of code as long as a specified condition is true
Use 'do...while' loop to execute a block of code once, and then repeat the loop as long as a specified condition is true
Q21. Explain about react js?
React JS is a JavaScript library for building user interfaces.
React is component-based, allowing for reusable UI elements.
Uses a virtual DOM for efficient updates to the actual DOM.
Supports server-side rendering for improved performance.
Uses JSX syntax to write HTML within JavaScript code.
State management is handled using props and state.
Q22. Explain about angular?
Angular is a popular front-end framework developed by Google for building dynamic web applications.
Angular is based on TypeScript, a superset of JavaScript.
It uses a component-based architecture for building reusable UI components.
Angular provides features like data binding, dependency injection, and routing.
It has a powerful CLI for scaffolding and managing projects.
Angular has a large ecosystem of libraries and tools like Angular Material for UI components.
More about working at TCS







Top HR Questions asked in TCS Front end Developer
Interview Process at TCS Front end Developer

Top Front end Developer Interview Questions from Similar Companies








Reviews
Interviews
Salaries
Users/Month

