Tcs technical interview pyqs with answers updated for 2024. Guaranteed Selection, No doubt.
- Tcs technical interview pyqs with answers:
- What is TCS/Tata Consultancy Services:(Tcs technical interview pyqs with answers)
- Tcs technical interview pyqs with answers:
- Q)What are interrupts? (Tcs technical interview pyqs with answers)
- Q)Explain the functionality of linked list. (Tcs technical interview pyqs with answers)
- Q)What are the four basic principles of OOPS? (Tcs technical interview pyqs with answers)
- Q)What do you mean by SQL Correlated Subqueries? (Tcs technical interview pyqs with answers)
- Q)What is inheritance? (Tcs technical interview pyqs with answers)
- Q)What is Polymorphism? (Tcs technical interview pyqs with answers)
- Q)What is a checkpoint in a database management system, and when does it eventuate? (Tcs technical interview pyqs with answers)
- Q)What exactly are macros? What are the benefits and drawbacks? (Tcs technical interview pyqs with answers)
- Q)What is the way of inheriting variable of one class to any other class? (Tcs technical interview pyqs with answers)
- Q)What are the different types of inheritance? (Tcs technical interview pyqs with answers)
- Q)What is the difference between the Java Development Kit (JDK), Java Runtime Environment (JRE), and Java Virtual Machine (JVM)? (Tcs technical interview pyqs with answers)
- Q)In a database management system, what are the two integrity rules? (Tcs technical interview pyqs with answers)
- Q)Write the code to reverse a given number using Command Line Arguments. (Tcs technical interview pyqs with answers)
- Q)What is software development life-cycle? (Tcs technical interview pyqs with answers)
- Q) How will you swap two numbers without the use of a third variable? (Tcs technical interview pyqs with answers)
- Q)What is the difference between classes and interface? (Tcs technical interview pyqs with answers)
- Classes:
- Interfaces:
- Q)What is meant by Cycle Stealing? (Tcs technical interview pyqs with answers)
- Q)What are the two concepts of swapping in the context of OS? How does swapping help in better memory management? (Tcs technical interview pyqs with answers)
- How Swapping Helps in Better Memory Management:
- Q)What is normalization of databases, joins, and keys? (Tcs technical interview pyqs with answers)
- Normalization:
- Joins:
- Keys:
- Q)What are loops? (Tcs technical interview pyqs with answers)
Tcs technical interview pyqs with answers:
Here are Tcs technical interview pyqs with answers, you can practise them(Tcs technical interview pyqs with answers) for your interview for TCS/Tata Consultation Services(Tcs technical interview pyqs with answers).
What is TCS/Tata Consultancy Services:(Tcs technical interview pyqs with answers)
Tata Consultancy Services is an IT services, consulting and business solutions organization that has been partnering with many of the world’s largest businesses for the past 50 years. We believe innovation and collective knowledge can transform all our futures with greater purpose.
Tcs technical interview pyqs with answers:
Q)What are interrupts? (Tcs technical interview pyqs with answers)
Solution: Interrupts are signals sent to the processor by hardware or software to indicate that an immediate action is needed. They temporarily halt the current execution of a program so that the processor can address the interrupting event, such as input from a keyboard or a hardware failure, before resuming normal operations.
Q)Explain the functionality of linked list. (Tcs technical interview pyqs with answers)
Solution: A linked list is a linear data structure where elements, called nodes, are stored in a sequence. Each node contains two parts: data and a pointer (or reference) to the next node in the sequence. Unlike arrays, linked lists allow for efficient insertion and deletion of elements because elements are not stored in contiguous memory locations. There are various types of linked lists, including singly linked lists, doubly linked lists, and circular linked lists.
Q)What are the four basic principles of OOPS? (Tcs technical interview pyqs with answers)
Solution:
The four basic principles of Object-Oriented Programming (OOP) are:
- Encapsulation: Bundling data and methods that operate on that data within a single unit or class, and restricting access to some of the object’s components.
- Abstraction: Hiding the complex implementation details and showing only the essential features of an object.
- Inheritance: Allowing a new class to inherit properties and behavior (methods) from an existing class.
- Polymorphism: Enabling objects to be treated as instances of their parent class, with the ability to override methods to perform different tasks based on the object type.
Q)What do you mean by SQL Correlated Subqueries? (Tcs technical interview pyqs with answers)
Solution: A SQL Correlated Subquery is a subquery that depends on values from the outer query for its execution. Unlike a regular subquery, it is evaluated once for each row processed by the outer query. The subquery is correlated with the outer query because it references a column from the outer query.
Q)What is inheritance? (Tcs technical interview pyqs with answers)
Solution: Inheritance is an Object-Oriented Programming (OOP) principle where a new class (called a child or subclass) derives properties and behaviors (methods) from an existing class (called a parent or superclass). This allows the child class to inherit and reuse code, while also having the ability to add or override features.
Q)What is Polymorphism? (Tcs technical interview pyqs with answers)
Solution: Polymorphism is an Object-Oriented Programming (OOP) concept that allows objects of different classes to be treated as objects of a common superclass. It enables the same method to behave differently based on the object it is acting upon, allowing for method overriding (runtime polymorphism) and method overloading (compile-time polymorphism).
Q)What is a checkpoint in a database management system, and when does it eventuate? (Tcs technical interview pyqs with answers)
Solution: A checkpoint in a Database Management System (DBMS) is a mechanism that saves the current state of the database to disk, ensuring that all modified data and transaction logs up to that point are stored. This helps in reducing the time needed for recovery after a crash by minimizing the amount of data that needs to be reprocessed. Checkpoints typically occur at regular intervals or when the system’s workload allows.
Q)What exactly are macros? What are the benefits and drawbacks? (Tcs technical interview pyqs with answers)
Solution:
Macros are preprocessor directives in programming, particularly in languages like C and C++, that allow you to define code snippets or constants that can be reused throughout the code. When the code is compiled, the macro is replaced by its corresponding value or code block.
Benefits:
- Code Reusability: Allows you to reuse code easily.
- Performance: Since macros are expanded at compile time, they can make the code run faster by avoiding function calls.
Drawbacks:
- Debugging Difficulty: Errors in macros can be harder to trace because they don’t provide error checking like functions do.
- No Type Safety: Macros don’t perform type checking, which can lead to unexpected behavior.
Q)What is the way of inheriting variable of one class to any other class? (Tcs technical interview pyqs with answers)
Solution:
To inherit variables from one class to another, you create a new class (child class) that extends the existing class (parent class). The child class automatically inherits the variables (and methods) from the parent class. This is done using the extends
keyword in languages like Java or :
in C++.
For example:
- In Java:
class Child extends Parent { }
- In C++:
class Child : public Parent { }
This allows the child class to access and use the variables of the parent class.
Q)What are the different types of inheritance? (Tcs technical interview pyqs with answers)
Solution:
The different types of inheritance are:
- Single Inheritance
- Multiple Inheritance
- Multilevel Inheritance
- Hierarchical Inheritance
- Hybrid Inheritance
Q)What is the difference between the Java Development Kit (JDK), Java Runtime Environment (JRE), and Java Virtual Machine (JVM)? (Tcs technical interview pyqs with answers)
Solution:
- JVM (Java Virtual Machine): Executes Java bytecode and provides a platform-independent execution environment. It translates bytecode into machine code.
- JRE (Java Runtime Environment): Includes the JVM and standard libraries necessary to run Java applications. It does not include development tools.
- JDK (Java Development Kit): Contains the JRE and additional tools for Java development, such as the compiler (javac), debugger, and other utilities required to build Java applications.
Q)In a database management system, what are the two integrity rules? (Tcs technical interview pyqs with answers)
Solution:
The two primary integrity rules in a database management system are:
- Entity Integrity: Ensures that each table has a primary key, and that primary key values are unique and not null.
- Referential Integrity: Ensures that foreign key values in a table correspond to primary key values in another table, maintaining valid relationships between tables.
Q)Write the code to reverse a given number using Command Line Arguments. (Tcs technical interview pyqs with answers)
Solution: Code-
public class ReverseNumber {
public static void main(String[] args) {
if (args.length != 1) {
System.out.println(“Usage: java ReverseNumber <number>”);
return;
}
try {
// Get the number from command line arguments
String number = args[0];
String reversed = new StringBuilder(number).reverse().toString();
// Print the reversed number
System.out.println(“Reversed Number: ” + reversed);
} catch (Exception e) {
System.out.println(“Invalid input. Please enter a valid number.”);
}
}
}
This will output: Reversed Number: 54321
.
Q)What is software development life-cycle? (Tcs technical interview pyqs with answers)
Solution:
The Software Development Life Cycle (SDLC) is a structured process for planning, creating, testing, and deploying software. It typically includes stages such as:
- Requirement Analysis: Gathering and defining what the software should do.
- Design: Planning the software architecture and design.
- Implementation: Writing and coding the software.
- Testing: Identifying and fixing bugs and verifying that the software meets requirements.
- Deployment: Releasing the software for use.
- Maintenance: Updating and fixing the software as needed after deployment.
Q) How will you swap two numbers without the use of a third variable? (Tcs technical interview pyqs with answers)
Solution:
You can swap two numbers without using a third variable by using arithmetic operations or bitwise XOR. Here are two methods:
1. Using Arithmetic Operations:
Code(java):
int a = 5;
int b = 10;
// Swap using arithmetic operations
a = a + b; // a becomes 15
b = a – b; // b becomes 5
a = a – b; // a becomes 10
System.out.println(“a: ” + a); // Outputs 10
System.out.println(“b: ” + b); // Outputs 5
2. Using Bitwise XOR:
code(java):
int a = 5;
int b = 10;
// Swap using XOR bitwise operation
a = a ^ b; // a becomes 15 (binary 1111)
b = a ^ b; // b becomes 5 (binary 0101)
a = a ^ b; // a becomes 10 (binary 1010)
System.out.println(“a: ” + a); // Outputs 10
System.out.println(“b: ” + b); // Outputs 5
Q)What is the difference between classes and interface? (Tcs technical interview pyqs with answers)
Solution:
Classes:
- Definition: A blueprint for creating objects with attributes (fields) and methods (functions).
- Implementation: Can provide concrete implementation of methods.
- Inheritance: Supports single inheritance; a class can inherit from only one superclass.
- Constructors: Can have constructors to initialize objects.
- Access Modifiers: Can use access modifiers (private, protected, public) to control access to members.
Interfaces:
- Definition: A contract that specifies a set of abstract methods that implementing classes must provide.
- Implementation: Cannot provide method implementations (except static and default methods in Java 8+).
- Inheritance: Supports multiple inheritance; a class can implement multiple interfaces.
- Constructors: Cannot have constructors.
- Access Modifiers: Methods in interfaces are implicitly public and abstract (except static and default methods).
Q)What is meant by Cycle Stealing? (Tcs technical interview pyqs with answers)
Solution: Cycle Stealing is a method of Direct Memory Access (DMA) where the DMA controller takes control of the system bus for a short period to transfer data between memory and peripherals. During this time, the CPU is briefly paused, allowing the DMA to “steal” a few bus cycles to perform its operations without completely blocking the CPU. This allows for efficient data transfer while minimizing the impact on CPU performance.
Q)What are the two concepts of swapping in the context of OS? How does swapping help in better memory management? (Tcs technical interview pyqs with answers)
Solution:
In the context of operating systems, swapping involves two main concepts:
- Process Swapping: This refers to moving entire processes between main memory and secondary storage (such as a hard drive) to free up RAM. When the system needs more memory for a process, it may swap out a currently inactive process to disk and bring in the required process from disk to RAM.
- Paging: A specific type of swapping where the process is divided into smaller pages. Pages are swapped in and out of physical memory as needed, allowing for more efficient use of memory compared to swapping entire processes.
How Swapping Helps in Better Memory Management:
- Efficient Utilization: By swapping out inactive processes or pages, the system can keep more processes in memory, making better use of available RAM.
- Reduced Fragmentation: Swapping can help in managing memory more effectively, reducing fragmentation by loading only the necessary parts of a process.
- Improved Multitasking: Enables the system to handle more processes concurrently, as it can dynamically allocate memory based on current needs and priorities.
Q)What is normalization of databases, joins, and keys? (Tcs technical interview pyqs with answers)
Solution:
Normalization:
Normalization is the process of organizing a database to reduce redundancy and improve data integrity. It involves dividing a database into tables and defining relationships between them to minimize duplication. The primary goals are to eliminate redundant data and ensure data dependencies are logical.
Normal Forms (stages of normalization):
- First Normal Form (1NF): Ensures that each column contains atomic (indivisible) values and each record is unique.
- Second Normal Form (2NF): Achieved when the table is in 1NF and all non-key attributes are fully functionally dependent on the primary key.
- Third Normal Form (3NF): Achieved when the table is in 2NF and all the columns are only dependent on the primary key.
Joins:
Joins are operations used to combine rows from two or more tables based on a related column between them.
- Inner Join: Returns only the rows with matching values in both tables.
- Left (Outer) Join: Returns all rows from the left table and matched rows from the right table; unmatched rows from the right table are returned as null.
- Right (Outer) Join: Returns all rows from the right table and matched rows from the left table; unmatched rows from the left table are returned as null.
- Full (Outer) Join: Returns all rows when there is a match in either left or right table; unmatched rows in both tables are returned as null.
Keys:
Keys are attributes or sets of attributes that uniquely identify rows in a table and establish relationships between tables.
- Primary Key: A unique identifier for each record in a table; cannot be null.
- Foreign Key: An attribute in one table that references the primary key of another table, establishing a link between the two tables.
- Unique Key: Ensures that all values in a column or a set of columns are unique across the table.
- Composite Key: A primary key composed of two or more columns to uniquely identify a row in a table.
Q)What are loops? (Tcs technical interview pyqs with answers)
Solution:
Loops are control structures in programming that allow code to be executed repeatedly based on a condition. They enable repetitive tasks to be automated and can improve efficiency and reduce code redundancy. The primary types of loops are:
- For Loop: Repeats a block of code a specific number of times.
- While Loop: Continues executing a block of code as long as a given condition remains true.
- Do-While Loop: Executes a block of code at least once and then continues looping as long as the condition remains true.
Thank You For visiting our website. In our website, you get more such educational content so don’t forget to allow the notification for more such content.
For more visit: https://deepblogs.net/category/educational-courses/