TCS Ninja Questions Answers
TCS Ninja Questions Answers
Programming Basics
1. What is a variable and how is it declared in C/Java?
Answer: A variable is a named storage that holds data which can be changed during program
execution. In C: int x = 5; In Java: int x = 5;
2. Difference between local and global variables.
Answer: Local variables are declared inside a function and accessible only within it. Global variables
are declared outside functions and accessible throughout the program.
3. Explain different data types in C/Java.
Answer: Common data types: int (integers), float (decimal numbers), char (characters), double
(large decimals), boolean (true/false - Java).
4. What are conditional statements? Give examples.
Answer: Conditional statements allow decision making in programs. Examples: if, if-else, switch.
E.g., if (x > 0) { ... }
5. What are loops? Explain for, while, and do-while loops.
Answer: Loops execute a block of code multiple times. 'for' is used when iteration count is known,
'while' checks condition before loop, 'do-while' checks after execution.
OOP Concepts
1. What is Object-Oriented Programming?
Answer: OOP is a programming paradigm based on the concept of objects that contain data and
methods. It promotes code reuse, modularity, and scalability.
2. What is a constructor?
Answer: A constructor is a special method that initializes objects. It is called automatically when an
object is created.
3. What is method overloading and method overriding?
Answer: Overloading: same method name with different parameters (compile-time). Overriding: child
class redefines parent class method (run-time).
4. What is the difference between interface and abstract class?
Answer: Interface: all methods are abstract by default. Abstract class: can have both abstract and
concrete methods. Java allows multiple interfaces, but only one abstract class.
5. What is a static variable and static method?
Answer: Static variable: shared among all instances of a class. Static method: can be called without
creating an object.
HR Questions
1. Tell me about yourself.
Answer: I'm a recent graduate in Computer Science with a strong interest in software development. I
enjoy problem-solving and have completed academic projects using Java and SQL.
2. Why do you want to join TCS?
Answer: TCS is a reputed company with a great learning environment and global exposure. I want to
grow in such an ecosystem.
3. What are your strengths and weaknesses?
Answer: Strengths: Hardworking, quick learner, team player. Weakness: Public speaking, which I'm
actively improving.
4. Are you open to relocation and working in shifts?
Answer: Yes, I'm flexible with relocation and working in shifts as I understand the job demands.
5. Do you have any questions for us?
Answer: Yes, could you please tell me more about the training and learning opportunities at TCS?