Posts

Showing posts from March, 2017

EIP Interview Questions

EIP Name EIP Description Use Case Pipes and Filter Use the Pipes and Filters architectural style to divide a larger processing task into a sequence of smaller, independent processing steps (Filters) that are connected by channels (Pipes). Pipes and Filter Router Consume the message from one channel and forward to another message channel based on the condition  Content Based Router Consume the message from one channel and examine the message content , based on the data/type  need to route to different channel .Basically routing based on the content  We received the Customer data which inclues the Post Paid /PrePaid based on the data it will redirect to either Postpaid channel or Prepaid Channel  Message Filter Its specical kind of router to eliminate the undesired messages based on the certain creteria  We need to publish the Promotion for certain customer like we h...

SOA - Interview Questions

What is SOA? SOA is Architecture Principle for building the reusable/loosely coupled and interoperable services which maps to business functionalities and business requirements in Enterprise level. What are the Benefits in EA Level ? Benefits categorized into two 1) Business     SOA helps greater alignment between Business and IT while generating more flexibility ,  it will helps in Business ie business can change the process dynamically and faster .    It helps to easy integration with Partners/customer's services into Enterprise level , it will generate the Reveniew and reduced the cost.   SOA is not necessary to start from scratch instead we reuse the existing asset to wrap/expose into services . It will reduced the cost 2) Technical    SOA helps to standardize the Interface contract and guidelines    Loosely coupled principle used to hide the implementation from consumers . We can change the implementat...

RESTful VS SOAP

RESTful Web Service : It Does not maintains the state ie stateless webservice Its having in built cache mechanism to improve the performance while doing retrieve operation Its supports only HTTP/HTTPS Protocols Its supports Json and XML data formats , most prefer data transformation is Json  Its does not have any in built security mechanism  It does not supports the distributed transaction  It does not have any interface contract between provider and consumers instead only mutual understanding  Implementation is bit easy compared to SOAP Based on the JAX-RS Specification  Does not supports any Async calls  We can add/remove the consumer on fly since there is no contract between them Fast time to market compared to SOAP Its supports all the browser Its supports Http basic authenticaion for security  It perform the CRUD Operation only not for business logic Build in error handling with Http Status code  SOAP Web Service  ...

Pessimistic VS Optimistic Lock

Use case as follows 1)       User A and User B try to update the same rows at same time  then one will get update and second will get overwrite .. if more than one user access the same row its called concurrency Following Scenario for locking 1)       Pessimistic locking : We could prevent the User B to edit 2)       Optimistic locking : Throw the exception when user B tries to edit the same row at same time   Solution for Optimistic locking in Hibernate: Approach 1:  You can create the version column in the DB level ,so entity has the field either its integer/date/timestamp. Advisable approach is should be integer. How it works: User A read the row from DB then the value of version is 1 and when user tries to update the row , while doing update it will retrieve the version no from DB and check with version no from current row , its same then it allows to update otherwise ...

Code Review Check List

Code Review Check List , I can categorize the code Review Check list in Java and DB side Java Side : Comments and Format should be in all the places Single Responsibility Function level and class level Operation and Class should small  Avoid the Duplication  Acceptability and modifier should be in all the places Release Resource should be mandatory  Try to use static block for common stuff like create the current date and loading the property Try to minimize the Synchronized statement/block  Avoid to use the printstacktrace and System .out. in the program  Avoid to use constant inside the loop  Avoid to create the unneccessary object Use Checked Exception in recoverable condition and Runtime exception in Program/logic errors Dont ignore the exception Dont return null instead return empty object  Use Enum instead of Constant Unit Test must be exists in all the classes /method level Try to use composition over inheritance  ...

Design Patterns Interview Question and Answers

What is Design Pattern? DP is nothing but solution for the particular problem in specific context. 2) What are major types of DP ? Creation Pattern Structured Pattern Behavior Pattern 3) What are pattern under the Creation Pattern Umberlla? 1) Builder Pattern 2) ProtoType Pattern 3) Singleton Pattern 4) Factory Pattern 4) What are patterns under the Structural Pattern 1) Proxy Pattern  2) Facade  3) Decorator  4) Adapator  5) FlyWeight Pattern  5)  What are the patterns are under the Behavior Patterns 1) Chain of Responsiblity 2) State 3) Command 4) Strategy 5) Observer 6) Visitor 7) Command 8) Template 9) Iterator 10) Momentum Builder Pattern : Its mainly used to separate the Object construction from Object representation Ex: In our world customer sign in the Mobile phone (Post Paid/Pre Paid) with different Combo Plan /packages Construction is Mobile Plan signin and representation o...

Load Balancing and Clustering Question

1) What is difference between Clustering and load Balancing (With out cluster) Main Object of both are used to achieve the High Availability. Cluster :  1) Mainly used to connect the group of server which used share the resource between the server 2) Maintains the state between the server ie servers are dependent to each other Load Balancing  1) Group of servers are connected to LB in Independent manner ie each server acting independently. 2) Since its independent it will not share the resource User Preference (Cluster / LB): Let me explain the simple scenario , User try to do the online shopping .Due to some reason one of the server is down. Cluster Behavior   In the cluster environment user will continue the shopping with out any breaking session ie cluster will redirect to another server with same session . LB Behavior : In LB , user needs to starts from scratch since one of the server is down . LB will start the new request and redirect ...

Architect Interview Questions & Answers

I am Paramesh , Currently working as Architect in Singapore. I just collect below information from my circles who recently attended the Architect Interview. I just draft the questions here. I will post the answer for those questions soon. Hope it will useful to refresh your mind before interview . 1) What is difference between SOA VS Micro Service Architecture ? SOA Micro Service Exposing the Business Functionality into Services in enterprise level , it will serve more thanon functionlity Small business functionality decomposed into small services . Services runing /sharing the resources It will not sharing the resources instead it will deployed and execute independently Scaling is not easy since its enterprise level Easily scaled in service level Its seems heavy and infra level its expensive Its not heavy and infra wise its very s...