Differentiate between interface and abstract class in the context of Java.
The following table lists the differences between an interface and abstract class:
Interface | Abstract class |
---|---|
Only abstract methods are allowed in an interface. It can also contain default and static methods with Java 8. | There are abstract and non-abstract methods in an abstract class. |
We cannot implement the concept of multiple inheritances using interfaces. | We cannot implement the concept of multiple inheritances using abstract classes. |
The implementation of an abstract class cannot be provided by an interface. | An abstract class can provide interface implementation. |
Only static and final variables are used in the interface. | Variables in an abstract class can be final, non-final, static, or non-static. |
To declare an interface, we use the interface keyword. | To declare an abstract class, we use the abstract keyword. |
Only another Java interface can be extended by an interface. | An abstract class can implement numerous Java interfaces by extending another Java class. |
The keyword “implements” can be used to create an interface. | The keyword “extends” can be used to extend an abstract class. |
By default, members of a Java interface are public. | Private, protected, and other class members can be found in a Java abstract class. |
I am writing my interview experience with Mindtree it may be helpful to you guys. Also sharing the Mindtree interview process through Amcat in detail for freshers.
I had applied for this job to the junior engineer profile. There were three rounds including an online test, technical and HR interviews.
Differentiate between SQL and NoSQL databases.
Following are the differences between SQL and NoSQL databases:
SQL Database | NoSQL Database |
---|---|
SQL databases are referred to as Relational Database Management Systems (RDBMS). | NoSQL databases are referred to as non-relational or distributed databases. |
SQL databases have fixed and static predefined schema. | NoSQL databases can have dynamic schema. |
SQL databases are vertically scalable in almost all cases. This means that by boosting RAM, CPU, or SSD, you may increase the demand on a single server. | NoSQL databases, on the other hand, are horizontally scalable. By sharding, or adding multiple servers to your NoSQL database, you can handle greater traffic. Its the difference between adding more storeys to a single building and adding more buildings to a neighbourhood. NoSQL databases can grow in size and power, making them the best solution for huge or constantly changing data sets. |
SQL databases are table-based. As a result, relational SQL databases are a preferable choice for applications that require multi-row transactions, such as accounting systems, or for legacy systems that were designed with a relational structure in mind. | Key-value pairs, document-based, graph databases, and wide-column stores are all types of NoSQL databases. |
The ACID characteristics (Atomicity, Consistency, Isolation, and Durability) are followed by SQL databases. | The Brewers CAP theorem is followed by NoSQL databases (Consistency, Availability and Partition tolerance). |
MindTree Coding Questions Word Count Time Complexity
For such types of questions highlight the core principles of the company and the work culture which motivates you to join the company. Talk about your desire to grow and learn while working in this company as your prime reason. Also, state the reviews of the company which you have heard from your seniors currently working for this company.