Big Oh Notation
Tcg Digital Solutions Interview Questions and Answers
Q1. What is the difference between classes and struct
Classes are reference types while structs are value types.
Classes support inheritance while structs do not.
Classes have default access modifier as internal while structs have it as private.
Classes have a destructor while structs do not.
Classes are allocated on heap while structs are allocated on stack.
Classes can be null while structs cannot.
Q2. Implement linked list
A linked list is a data structure where each element points to the next one.
Create a Node class with a value and a next pointer
Create a LinkedList class with a head pointer and methods to add, remove, and traverse nodes
Example: LinkedList ll = new LinkedList(); ll.add(5); ll.add(10); ll.remove(5);
Q3. What is Higher Order Component ?
Higher Order Component is a function that takes a component and returns a new component with additional functionality.
Higher Order Components (HOCs) are a pattern in React for reusing component logic.
They are functions that accept a component and return a new component with enhanced capabilities.
HOCs can be used for cross-cutting concerns like authentication, logging, or data fetching.
They enable code reuse, composition, and separation of concerns in React applications.
Q4. What is Virtual DOM, Explain ?
Virtual DOM is a concept in web development where a lightweight copy of the actual DOM is created and manipulated for efficient rendering.
Virtual DOM is an abstraction of the real DOM.
It is used in frameworks like React to improve performance.
Changes made to the virtual DOM are compared with the actual DOM, and only the necessary updates are applied.
This approach reduces the number of direct manipulations on the actual DOM, resulting in faster rendering.
Virtual DOM allows dev...read more
Q5. Inorder tree traversal.
Inorder tree traversal is a way of visiting each node in a binary tree in a specific order.
Start at the leftmost node of the tree
Visit the left subtree recursively
Visit the current node
Visit the right subtree recursively
Q6. Life Cycle Methods in React
Life Cycle Methods in React
React components have several life cycle methods that are called at different stages of a component's life
These methods allow developers to perform actions like initializing state, fetching data, and updating the UI
Some commonly used life cycle methods are componentDidMount, componentDidUpdate, and componentWillUnmount
Q7. Dispatch Queue vs operations
Dispatch Queue is a thread-safe way to execute tasks asynchronously, while Operations are a way to encapsulate tasks.
Dispatch Queue is a high-level API for managing concurrent operations.
Operations are objects that encapsulate a single task or multiple tasks.
Dispatch Queue is simpler to use and recommended for most use cases.
Operations provide more control over task dependencies and cancellation.
Both can be used together to achieve complex concurrency scenarios.
Q8. Custom hook implementation
Custom hooks in React are reusable functions that contain logic shared between components.
Custom hooks start with 'use' keyword (e.g. useState, useEffect)
They can be used to share logic like fetching data, managing state, or subscribing to events
Example: Custom hook for fetching data from an API can be used in multiple components
Top HR Questions asked in Tcg Digital Solutions
Interview Process at Tcg Digital Solutions
Top Interview Questions from Similar Companies
Reviews
Interviews
Salaries
Users/Month