Add office photos
Engaged Employer

Shiprocket Private Limited

3.4
based on 254 Reviews
Filter interviews by

TCS Interview Questions and Answers

Updated 24 Oct 2024

Q1. Change detection strategy in Angular

Ans.

Change detection strategy in Angular is a mechanism used to detect changes in the application state and update the view accordingly.

  • Angular uses Zone.js for change detection by default

  • Change detection can be triggered manually using ChangeDetectorRef

  • Optimizing change detection using OnPush strategy

Add your answer

Q2. what is Closure

Ans.

Closure is a function that captures the variables from its surrounding scope, even after the surrounding function has finished executing.

  • Closure allows a function to access and manipulate variables from its outer scope.

  • It maintains a reference to its outer scope, even after the outer function has returned.

  • Closure is commonly used in event handlers and callbacks.

Add your answer

Q3. Dif between var, let, const

Ans.

var is function scoped, let is block scoped, const is block scoped and cannot be reassigned.

  • var is function scoped, let is block scoped, const is block scoped and cannot be reassigned

  • var can be redeclared and updated, let can be updated but not redeclared, const cannot be redeclared or updated

  • Example: var x = 10; let y = 20; const z = 30;

Add your answer

Q4. Rxjs operators used

Ans.

Rxjs operators are used for handling asynchronous operations in reactive programming.

  • Map operator: transforms the items emitted by an Observable

  • Filter operator: emits only those items from an Observable that pass a specified condition

  • Merge operator: combines multiple Observables into one by merging their emissions

  • SwitchMap operator: switches to a new Observable each time it is emitted

  • DebounceTime operator: emits a value from the source Observable only after a specified time h...read more

Add your answer
Discover TCS interview dos and don'ts from real experiences

Q5. Next highest number

Ans.

To find the next highest number, sort the numbers in ascending order and find the number immediately greater than the given number.

  • Sort the numbers in ascending order

  • Find the number immediately greater than the given number

  • Return the next highest number

Add your answer

Q6. Number of Island

Ans.

Count the number of islands in a given grid of '1's and '0's.

  • Iterate through the grid and for each '1' encountered, perform a depth-first search to mark all connected '1's as visited.

  • Increment the island count for each new island encountered.

  • Consider edge cases like grid boundaries and handling visited cells.

Add your answer
Contribute & help others!
Write a review
Share interview
Contribute salary
Add office photos

Interview Process at TCS

based on 4 interviews in the last 1 year
1 Interview rounds
One-on-one Round
View more
Interview Tips & Stories
Ace your next interview with expert advice and inspiring stories

Top Software Developer Interview Questions from Similar Companies

3.9
 • 86 Interview Questions
3.6
 • 48 Interview Questions
3.7
 • 21 Interview Questions
3.7
 • 18 Interview Questions
3.8
 • 12 Interview Questions
3.1
 • 12 Interview Questions
View all
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
70 Lakh+

Reviews

5 Lakh+

Interviews

4 Crore+

Salaries

1 Cr+

Users/Month

Contribute to help millions
Get AmbitionBox app

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