Sunday, October 29, 2017

SonarQube frequently asked interview questions.

What is SonarQube
A:Sonar is a web based code quality analysis tool for Maven based Java projects. It covers a wide area of code quality check points which include: Architecture & Design, Complexity, Duplications, Coding Rules, Potential Bugs, Unit Test etc.

Q: Why use SonarQube ?
A:
Sonar covers the 7 sections of code quality
  • Architecture and Design
  • Unit tests
  • Duplicated code
  • Potential bugs
  • Complex code
  • Coding standards
  • Comments
Q: What is role of database in SonarQube?
A:
 Sonar uses a Derby or H2 as default database. When running Sonar, it says that these databases may only be used for evaluation. We can change this default database and use our custom DB.

Q: How to create reports in SonarQube?
A:
 To create reports using SonarQube
mvn clean install
mvn sonar:sonar -Dsonar.issuesreport.html.enable=true


ActiveMQ Interview Questions


Q: What is Activemq?
A: 
Apache ActiveMQ is an open source message broker written in Java together with a full Java Message Service (JMS) client. It provides "Enterprise Features" which in this case means fostering the communication from more than one client or server. 

Q: What is use of Activemq instead of other options like database?
A: 
Activemq is used to reliably communicate between two distributed processes. It can store messages in a database to communicate between to processes, but as soon as the message is received you'd have to delete the message. That means a row insert and delete for each message. When you try to scale that up communicating thousands of messages per second, databases tend to fall over.
Message oriented middleware like ActiveMQ on the other hand are build to handle those use cases. They asume that messages in a healthy system will be deleted very quickly and can do optimizations to avoid the overhead. It can also push messages to consumers instead of a consumer having to poll for new message by doing a SQL query. This further reduces the latency involved in processing new messages being sent into the system. 

Q: What is JMS??
A: 
Java Message Service (JMS) is an application program interface (API) from Sun Microsystems that supports the formal communication known as messaging between computers in a network. Sun's JMS provides a common interface to standard messaging protocols and also to special messaging services in support of Java programs. ActiveMQ is based on JMS.

Q: How to get started with JMS?
A: 
Getting Started with JMS Messaging- ActiveMQ Hello World Tutorial 

Q: How to integrate ActiveMQ with Apache Camel?
A: 
Integrate Apache Camel and ActiveMQ

Q: How to integrate ActiveMQ with Spring Boot?
A: 
Spring Boot + ActiveMQ Hello world Example 

NoSQL

NoSQL

A NoSQL (originally referring to "non SQL" or "non relational") database provides a mechanism for storage and retrieval of data that is modeled in means other than the tabular relations used in relational databases. NoSQL refers to databases that do not make use of Relation Databases SQL Query Language. NoSQL stands for Not only SQL. 
Why NoSQL is required?
As the amount of data for an application increased, the Database needs to be scaled to meet this requirement.
Databases can be scaled in two ways- Either vertically or horizontally. 
Vertical scaling involves increasing the processing power of the existing Database server. Thus we have a single powerful Database server 
In case of Horizontal scaling we add additional new database servers to the existing one. Thus data gets divided among these to be stored. This scaling also involves the concept of replication and sharding.
In case of relational databases it is easy to go for vertical scaling. However it is difficult to achieve horizantal scaling involving replication and sharding with relational database. With the ever increasing data, horizontal scaling with replication and sharding is the need of the hour.

Following are the advantages of NoSQL
  • Scales Horizontal - Horizontal scalability can be achieved easily
  • No Schema - It does not have schema.It support semi-structured data and volatile data.
  • Improved Performance - Read/Write throughput is very high.