Synechron
10+ TCS Interview Questions and Answers
Q1. Ngrx state management, how do you manage state in your current project?
I use Ngrx for state management in my current project by defining actions, reducers, effects, and selectors.
Define actions to describe user events or interactions
Create reducers to specify how state should change in response to actions
Implement effects to manage side effects like API calls
Use selectors to retrieve specific pieces of state for components
Q2. Would transaction be rolled back if innermost stored procedure throws an error ?
Yes, the transaction will be rolled back if the innermost stored procedure throws an error.
If an error occurs in the innermost stored procedure, it will cause the entire transaction to be rolled back.
This ensures that the database remains in a consistent state.
Rolling back the transaction means that any changes made by the stored procedures within the transaction will be undone.
Q3. Write a query to identify and remove duplicated from a table.
Use a query with GROUP BY and HAVING clause to identify and remove duplicates from a table.
Use GROUP BY to group rows with the same values
Use HAVING COUNT(*) > 1 to identify duplicates
Use DELETE statement to remove duplicates
Q4. Dom Sanitizer in Angular
DOM sanitizer in Angular is used to sanitize untrusted HTML to prevent XSS attacks.
DOM sanitizer is used to sanitize HTML content before rendering it in Angular templates.
It helps prevent Cross-Site Scripting (XSS) attacks by removing potentially harmful content.
Angular provides a built-in DomSanitizer service for sanitizing HTML content.
Example: Using DomSanitizer in Angular template to sanitize a URL before rendering it.
Q5. MVC vs .NET lifecycle
MVC is a design pattern used in .NET development, while .NET lifecycle refers to the stages of a .NET application's execution.
MVC is a design pattern that separates an application into three main components: Model, View, and Controller.
.NET lifecycle refers to the stages of a .NET application's execution, including initialization, execution, and termination.
MVC helps in achieving separation of concerns and making the code more maintainable.
Understanding the .NET lifecycle is ...read more
Q6. Stored procedure vs Functions
Stored procedures are precompiled SQL queries stored in the database, while functions are reusable code blocks that return a value.
Stored procedures are used for performing specific tasks or operations on the database.
Functions are used to encapsulate logic and can be called within SQL queries or other functions.
Stored procedures can have input and output parameters, while functions always return a value.
Stored procedures can contain DML and DDL statements, while functions ar...read more
Q7. NgOninit vs Constructor
NgOnInit is a lifecycle hook in Angular that is called after the component has been initialized, while the constructor is a TypeScript feature used to initialize class properties.
NgOnInit is specific to Angular components, while constructor is a general TypeScript feature.
NgOnInit is used for initialization logic that relies on Angular's view and input bindings being initialized, while constructor is used for basic initialization of class properties.
NgOnInit is called after A...read more
Q8. Dispose vs Finalize
Dispose is used to release unmanaged resources immediately, while Finalize is used for cleanup operations before an object is destroyed by the garbage collector.
Dispose is called explicitly by the developer, while Finalize is called by the garbage collector.
Dispose should be implemented in classes that directly interact with unmanaged resources.
Finalize should be implemented in classes that need to release resources before being garbage collected.
Example: Implement IDisposabl...read more
Q9. Model binder in MVC
Model binder in MVC is used to map data from HTTP requests to action method parameters in controllers.
Model binder maps form data, query string parameters, and route data to action method parameters in MVC controllers.
It helps in simplifying the process of extracting data from HTTP requests.
Model binder can be customized by creating custom model binders to handle complex data binding scenarios.
Q10. Use of zone.js file
zone.js is a library for managing asynchronous operations in Angular applications.
zone.js helps in tracking asynchronous operations and their execution context in Angular applications.
It provides hooks for intercepting asynchronous tasks like setTimeout, setInterval, and promises.
zone.js can be used for profiling, debugging, and error handling in Angular applications.
More about working at Synechron
Top DOT NET Developer Interview Questions from Similar Companies
Reviews
Interviews
Salaries
Users/Month