TCS iON
10+ Desai Construction Interview Questions and Answers
Q1. What is Encapsulation?
Encapsulation is the process of hiding internal details and providing a public interface for accessing and manipulating data.
Encapsulation is a fundamental concept in object-oriented programming.
It combines data and methods into a single unit called a class.
The class encapsulates the data and provides methods to interact with it.
Access to the data is controlled through the class's public interface.
Encapsulation helps in achieving data abstraction, data hiding, and code reusab...read more
Q2. Give the difference between Interface and Abstraction?
Interface defines the contract between a class and the outside world, while Abstraction provides a generalized view of an object.
Interface is a blueprint of a class that defines the methods and properties that a class must implement.
Abstraction is a concept that hides the implementation details and provides a generalized view of an object.
Interface is used to achieve multiple inheritance in Java.
Abstraction is used to achieve encapsulation in Java.
Interface can be implemented...read more
Q3. Program to check whether the number is Palindrome or not?
Program to check whether the number is Palindrome or not
Convert the number to a string
Reverse the string
Compare the original and reversed string
If they are equal, the number is a palindrome
Q4. Who is the CEO of TCS?
Rajesh Gopinathan is the CEO of TCS.
Rajesh Gopinathan became the CEO of TCS in February 2017.
He joined TCS in 2001 and has held various leadership positions.
Under his leadership, TCS has achieved significant growth and global recognition.
Rajesh Gopinathan has played a key role in driving TCS' digital transformation initiatives.
He has a strong background in finance and has contributed to TCS' financial success.
Q5. What are pointers . Write a short program to explain concept of pointers
Pointers are variables that store memory addresses of other variables.
Pointers are used to access and manipulate memory addresses directly.
They are denoted by an asterisk (*) before the variable name.
Example: int *ptr; // declares a pointer to an integer variable
Q6. Swap the number without using Third variable.
Swapping numbers without using a third variable.
Add the two numbers to be swapped
Assign the sum to the first variable
Subtract the second variable from the sum and assign it to the second variable
Subtract the second variable from the first variable and assign it to the first variable
Q7. What is Polymorphism?
Polymorphism is the ability of an object to take on many forms.
Polymorphism allows objects of different classes to be treated as if they were objects of the same class.
It is achieved through method overriding and method overloading.
Example: A parent class Animal can have child classes like Dog, Cat, and Cow. All these child classes can have their own implementation of the method 'makeSound', which is defined in the parent class.
Polymorphism makes code more flexible and reusab...read more
Q8. What is the difference between a list and tuple
A list is mutable and can be changed, while a tuple is immutable and cannot be changed.
List is defined using square brackets [], while tuple is defined using parentheses ().
Elements in a list can be modified, added, or removed, while elements in a tuple cannot be changed once defined.
Lists are typically used for collections of items that may need to be modified, while tuples are used for fixed collections of items.
Example: list - [1, 2, 3], tuple - (4, 5, 6)
Q9. Program to Reverse the String?
Program to reverse a string
Use a loop to iterate through the characters of the string
Create a new string and append each character in reverse order
Return the reversed string
Q10. Why python is called interpreted language
Python is called an interpreted language because it executes code line by line at runtime.
Python code is not compiled into machine code before execution, instead it is translated into intermediate code which is then interpreted by the Python interpreter.
This allows for easier debugging and dynamic typing, as code can be executed and tested immediately without the need for compilation.
Interpreted languages like Python are generally slower than compiled languages, as the code i...read more
Q11. What is Multiple Inheritence?
Multiple Inheritance is a feature in object-oriented programming where a class can inherit properties and behavior from multiple parent classes.
A class can inherit from more than one class using multiple inheritance.
It can lead to the diamond problem where two parent classes have a common method or attribute.
Languages like C++ support multiple inheritance while Java does not.
It can be useful in creating complex class hierarchies and reusing code.
Example: A class 'Athlete' can...read more
Q12. what is the use of group by in MySQL
GROUP BY in MySQL is used to group rows that have the same values into summary rows.
Used with SELECT statement to group rows based on one or more columns
Can be used with aggregate functions like COUNT, SUM, AVG, etc.
Helps in summarizing data and performing calculations on grouped data
Example: SELECT department, COUNT(*) FROM employees GROUP BY department
Q13. Program to check Prime Number.
Program to check if a number is prime or not.
A prime number is a number greater than 1 that has no positive divisors other than 1 and itself.
To check if a number is prime, iterate from 2 to the square root of the number and check if it divides the number evenly.
If any divisor is found, the number is not prime. Otherwise, it is prime.
Q14. What is data structure ?
Data structure is a way of organizing and storing data in a computer so that it can be accessed and used efficiently.
Data structure is a collection of data values, the relationships among them, and the functions or operations that can be applied to the data.
Examples of data structures include arrays, linked lists, stacks, queues, trees, graphs, and hash tables.
Choosing the right data structure for a particular task is important for efficient and effective programming.
Data str...read more
Q15. How to run python file
To run a Python file, use the command 'python filename.py' in the terminal.
Open the terminal or command prompt
Navigate to the directory where the Python file is located
Run the command 'python filename.py' to execute the file
Q16. Program to print fibanocci series
A program to print the Fibonacci series using a loop or recursion.
Use a loop or recursion to generate the Fibonacci series
Start with 0 and 1 as the first two numbers in the series
Add the previous two numbers to get the next number in the series
Q17. What is osi model
The OSI model is a conceptual framework that standardizes the functions of a telecommunication or computing system into seven different layers.
The OSI model stands for Open Systems Interconnection model.
It helps in understanding how different networking protocols work together.
Each layer has specific functions and communicates with the adjacent layers.
Examples of layers include physical layer, data link layer, network layer, transport layer, etc.
Top HR Questions asked in Desai Construction
Interview Process at Desai Construction
Top Assistant System Engineer Trainee Interview Questions from Similar Companies
Reviews
Interviews
Salaries
Users/Month