Simform
Trantor Interview Questions and Answers
Q1. 1. What is difference between abstract class and interface ?
Abstract class can have implementation while interface cannot. A class can implement multiple interfaces but only extend one abstract class.
Abstract class can have constructors while interface cannot.
Abstract class can have non-abstract methods while interface can only have abstract methods.
A class can implement multiple interfaces but only extend one abstract class.
Abstract class can have instance variables while interface cannot.
Abstract class is used for code reusability w...read more
Q2. 3. What is Difference between primary key and unique key ?
Primary key uniquely identifies a record in a table, while unique key ensures that all values in a column are distinct.
Primary key is used to enforce entity integrity, while unique key enforces domain integrity.
A table can have only one primary key, but multiple unique keys.
Primary key can't have null values, while unique key can have null values.
Primary key is automatically indexed, while unique key may or may not be indexed.
Q3. 2. What is Arrow Function in Javascripts?
Arrow functions are a concise way to write functions in JavaScript.
Arrow functions have a shorter syntax compared to regular functions.
They do not have their own 'this' value, instead, they inherit 'this' from the surrounding context.
Arrow functions are always anonymous and cannot be used as constructors.
They are commonly used in React components for event handlers and callback functions.
Q4. 5. Why we require interface and what is interface in java ?
Interfaces in Java provide a way to achieve abstraction and multiple inheritance.
Interfaces define a set of methods that a class must implement.
They allow for loose coupling between classes.
Interfaces can be used to achieve polymorphism.
Java does not support multiple inheritance, but interfaces provide a way to achieve it.
Interfaces are used extensively in Java frameworks like Spring and Hibernate.
Q5. 4. how you join three different tables in SQL ?
To join three different tables in SQL, you can use the JOIN keyword along with the appropriate join conditions.
Use the JOIN keyword to combine tables based on a common column
Specify the join conditions using the ON keyword
You can join more than two tables by chaining multiple JOIN statements
Different types of joins include INNER JOIN, LEFT JOIN, RIGHT JOIN, and FULL JOIN
Q6. 9. What is difference between overloading and overriding?
Overloading is having multiple methods with the same name but different parameters. Overriding is implementing a method in a subclass that already exists in the parent class.
Overloading is compile-time polymorphism while overriding is runtime polymorphism.
Overloading is used to provide different ways of calling the same method with different parameters.
Overriding is used to provide a specific implementation of a method in a subclass that is already defined in the parent class...read more
Q7. 7. Is exception handling is required in a big project or we don't have to handle exception?
Yes, exception handling is required in a big project.
Exception handling helps in identifying and resolving errors during runtime.
It improves the stability and reliability of the application.
Exceptions can occur due to various reasons like network issues, server errors, or user input errors.
Handling exceptions gracefully prevents the application from crashing and provides a better user experience.
It allows for proper error logging and debugging, making it easier to identify an...read more
Q8. 10. Which are the access specifiers in java ?
Access specifiers in Java are keywords that determine the visibility of a class, method, or variable.
There are four access specifiers in Java: public, private, protected, and default.
Public: accessible from anywhere in the program.
Private: accessible only within the same class.
Protected: accessible within the same class, subclasses, and same package.
Default: accessible within the same package only.
Q9. 6. What is Encapsulation in java with example ?
Encapsulation is a mechanism of wrapping data and code acting on the data together as a single unit.
Encapsulation is used to hide the implementation details of an object from the outside world.
It helps in achieving data abstraction and data hiding.
In Java, encapsulation is achieved by declaring the variables of a class as private and providing public getter and setter methods to access and modify the data.
Example: A bank account class with private variables like account numbe...read more
Top React Js Frontend Developer Interview Questions from Similar Companies
Reviews
Interviews
Salaries
Users/Month