
TCS


TCS Programmer Analyst Interview Questions and Answers
Q1. What does i indicates in array ?
i indicates the index of an element in an array.
i is a variable used to access elements in an array.
It starts at 0 for the first element and increments by 1 for each subsequent element.
For example, in the array ['apple', 'banana', 'orange'], i=0 would refer to 'apple', i=1 to 'banana', and i=2 to 'orange'.
Q2. What are genetically modified organisms
Genetically modified organisms (GMOs) are organisms whose genetic material has been altered in a way that does not occur naturally.
GMOs are created by inserting genes from one organism into another to give it a desired trait.
They are commonly used in agriculture to create crops that are resistant to pests or herbicides.
GMOs have been a controversial topic due to concerns about their safety and potential impact on the environment.
Examples of GMOs include genetically modified c...read more
Q3. difference between let and const in javascript
let is mutable and can be reassigned, const is immutable and cannot be reassigned
let allows reassignment of values, const does not
const must be initialized with a value at declaration, let can be declared without a value
const is block-scoped, let is function-scoped
Q4. What is a linked list
A linked list is a data structure consisting of nodes where each node contains a data field and a reference to the next node.
Consists of nodes connected by pointers/references
Does not have a fixed size like an array
Can easily insert or delete elements without shifting other elements
Example: Singly linked list, Doubly linked list
Q5. What is polymorphism
Polymorphism is the ability of a single function or method to operate on different types of data.
Polymorphism allows objects of different classes to be treated as objects of a common superclass.
There are two types of polymorphism: compile-time (method overloading) and runtime (method overriding).
Example: Inheritance in object-oriented programming languages like Java allows for polymorphism.
Q6. Write a Bubble Sort program
Bubble Sort is a simple sorting algorithm that repeatedly steps through the list, compares adjacent elements, and swaps them if they are in the wrong order.
Initialize an array of strings to be sorted
Repeat until no swaps are needed: Compare adjacent elements and swap if necessary
Continue until the array is sorted in ascending order
Q7. map() uses
map() is a higher-order function in JavaScript used to transform elements of an array.
map() takes a callback function as an argument and applies it to each element of an array, returning a new array with the results.
It does not mutate the original array, but creates a new one.
Example: const numbers = [1, 2, 3]; const doubled = numbers.map(num => num * 2); // doubled is [2, 4, 6]
More about working at TCS







Top HR Questions asked in TCS Programmer Analyst
Interview Process at TCS Programmer Analyst

Top Programmer Analyst Interview Questions from Similar Companies




Reviews
Interviews
Salaries
Users/Month

