Add office photos
Employer?
Claim Account for FREE

Cubedots

1.7
based on 5 Reviews
Filter interviews by

TCS Interview Questions and Answers

Updated 5 Feb 2024

Q1. What is "use strict" in javascript

Ans.

use strict is a directive in JavaScript that enforces stricter parsing and error handling.

  • It enables modern JavaScript features and disallows certain syntax that could lead to errors.

  • It must be placed at the beginning of a script or function.

  • It helps in writing more secure and optimized code.

  • Example: 'use strict'; var x = 010; // SyntaxError: Octal literals are not allowed in strict mode.'

Add your answer

Q2. What is API and hot to use.

Ans.

API stands for Application Programming Interface. It is a set of protocols and tools for building software applications.

  • API allows different software applications to communicate with each other

  • API specifies how software components should interact

  • API can be used to retrieve data from a server or database

  • API can be used to integrate third-party services into an application

  • API can be accessed using HTTP requests

  • API documentation is important for understanding how to use it

Add your answer

Q3. How many types of array in js

Ans.

There is only one type of array in JavaScript.

  • JavaScript has only one type of array, which can hold any type of data.

  • Arrays can be created using the array literal notation or the Array constructor.

  • Arrays have a length property that returns the number of elements in the array.

  • Arrays have various methods like push(), pop(), shift(), unshift(), splice(), etc.

Add your answer

Q4. What is promise in javascript

Ans.

Promise is an object representing the eventual completion or failure of an asynchronous operation.

  • Promises are used to handle asynchronous operations in JavaScript

  • They are a cleaner alternative to callbacks

  • Promises have three states: pending, fulfilled, or rejected

  • They can be chained using .then() and .catch() methods

  • Example: new Promise((resolve, reject) => {...})

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

Q5. What is anonymous function

Ans.

An anonymous function is a function without a name.

  • Declared using function keyword without a name

  • Can be assigned to a variable or passed as an argument

  • Used for one-time use or as a callback function

  • Example: const sum = function(a, b) { return a + b; }

Add your answer

Q6. How define variables in js

Ans.

Variables in JavaScript are defined using the 'var', 'let', or 'const' keywords.

  • Use 'var' to declare a variable with function scope

  • Use 'let' to declare a variable with block scope

  • Use 'const' to declare a constant variable

  • Variables can be assigned a value using the '=' operator

  • Variables can be declared without assigning a value

  • Variables can be declared and assigned in the same statement

Add your answer

Q7. Difference between JS and ECMAScript

Ans.

ECMAScript is a standard, while JavaScript is an implementation of that standard.

  • ECMAScript is a specification for scripting languages, while JavaScript is a programming language that implements ECMAScript.

  • ECMAScript is maintained by ECMA International, while JavaScript is maintained by the Mozilla Foundation.

  • ECMAScript is used as a basis for many other programming languages, while JavaScript is used primarily for web development.

  • ECMAScript is updated regularly, while JavaScr...read more

Add your answer
Contribute & help others!
Write a review
Share interview
Contribute salary
Add office photos
Interview Tips & Stories
Ace your next interview with expert advice and inspiring stories

Top Interview Questions from Similar Companies

3.9
 • 684 Interview Questions
3.6
 • 377 Interview Questions
3.8
 • 266 Interview Questions
3.7
 • 257 Interview Questions
4.7
 • 143 Interview Questions
View all
Top Cubedots Interview Questions And Answers
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