
TCS


10+ TCS System Engineer Hardware Interview Questions and Answers for Freshers
Q1. What is the difference between list and tuple (in python)?
List and tuple are both data structures in Python, but they have some differences.
Lists are mutable, while tuples are immutable.
Lists use square brackets [], while tuples use parentheses ().
Lists are typically used for collections of homogeneous items, while tuples are used for heterogeneous items.
Lists are usually used for sequences that will be modified, while tuples are used for sequences that will not be modified.
Lists have more built-in methods than tuples.
Q2. Can we use a continue statement outside loops?
No, continue statement can only be used inside loops.
The continue statement is used to skip the current iteration of a loop.
It cannot be used outside of a loop as there is no iteration to skip.
Attempting to use continue outside of a loop will result in a syntax error.
Q3. What is Referential integrity Constant in DBMS(foreign key primary key concepts)?
Referential integrity constant ensures that a foreign key value always refers to an existing primary key value.
It maintains consistency between related tables
It prevents orphaned records
It enforces data integrity
Example: A foreign key in the Orders table refers to the primary key in the Customers table
Q4. Why do we use Servlet over JSP even if JSP have added advantage ?
Servlets are used for server-side processing and JSP for presentation. Both have their own advantages.
Servlets are used for handling complex business logic and database operations.
JSP is used for presentation and displaying dynamic content.
Servlets are faster than JSP as they do not involve the overhead of rendering HTML.
Servlets can be used to handle multiple requests simultaneously.
JSP can be used for rapid development of web pages.
Servlets can be used to create RESTful web...read more
Q5. What is Global and local variables?
Global variables are accessible throughout the program, while local variables are only accessible within a specific function.
Global variables can be accessed and modified by any function or module in the program.
Local variables are declared within a specific function and can only be accessed within that function.
Global variables can cause naming conflicts and make debugging difficult.
Local variables are preferred for their encapsulation and reduced risk of naming conflicts.
Q6. What do you mean by static variable?
Static variable is a variable that retains its value even after the function execution is completed.
Static variables are declared inside a function with the keyword 'static'.
They are initialized only once and retain their value throughout the program.
They have a default value of 0 if not initialized explicitly.
They are useful in situations where we need to maintain the state of a variable across function calls.
Q7. Difference between Pass and continue statement.
Pass statement skips the current iteration and continue statement skips the current iteration and moves to the next one.
Pass statement is used to do nothing and move to the next iteration in a loop.
Continue statement is used to skip the current iteration and move to the next one in a loop.
Pass statement is used when a statement is required syntactically but no action is needed.
Continue statement is used when a condition is met and the current iteration needs to be skipped.
Q8. Write code for infinite loop and write code for prime num ...!
Code for infinite loop and prime number check
For infinite loop: while(1) { //code }
For prime number check: bool isPrime(int n) { for(int i=2; i<=sqrt(n); i++) { if(n%i == 0) return false; } return true; }
Infinite loop can be used for continuous monitoring or background tasks
Prime number check is useful in cryptography and number theory
Q9. Types of polymorphism?
Polymorphism refers to the ability of an object to take on many forms. There are two types of polymorphism: compile-time and runtime.
Compile-time polymorphism is achieved through function overloading and operator overloading.
Runtime polymorphism is achieved through virtual functions and function overriding.
Example of compile-time polymorphism: function overloading - multiple functions with the same name but different parameters.
Example of runtime polymorphism: virtual functio...read more
Q10. Explain automation framework that you have worked on.
I have worked on a keyword-driven automation framework using Selenium and TestNG.
Used Excel sheets to store test data and keywords
Implemented reusable functions for common actions
Integrated with Jenkins for continuous integration
Supported parallel execution for faster testing
Q11. What does init() method do ?
init() method initializes an object or a class.
init() method is used to initialize an object or a class.
It is called automatically when an object is created.
It can be used to set default values for object properties.
It can also be used to perform any necessary setup operations.
Example: __init__() method in Python.
Example: init() method in Java.
Example: viewDidLoad() method in iOS development.
Q12. Difference between C++ and Java in inheritance
C++ supports multiple inheritance while Java supports single inheritance.
C++ allows a class to inherit from multiple classes, while Java only allows a class to inherit from one class.
Java uses interfaces to achieve multiple inheritance-like behavior.
C++ inheritance is more flexible but can lead to ambiguity and complexity, while Java's single inheritance simplifies the design.
Example: C++ - class B: public A, public C; Java - class B extends A;
Example: Java - interface C { vo...read more
Q13. Explain Java 8 Features
Java 8 introduced several new features including lambda expressions, functional interfaces, streams, and default methods.
Lambda expressions allow you to write code in a more concise way.
Functional interfaces are interfaces with a single abstract method, used for lambda expressions.
Streams provide a way to work with sequences of elements.
Default methods allow interfaces to have method implementations.
Example: Lambda expression - (a, b) -> a + b
Example: Functional interface - C...read more
More about working at TCS







Top HR Questions asked in TCS System Engineer Hardware for Freshers
Interview Process at TCS System Engineer Hardware for Freshers

Top System Engineer Hardware Interview Questions from Similar Companies



Reviews
Interviews
Salaries
Users/Month

