Posts

REST vs SOAP vs Microservices

REST vs SOAP vs Microservices SOAP : Simple object access protocol. It has a more rigid set of messaging patterns than REST. Relies exclusive on XML. SOAP need not necessarily be transmitted over HTTP, we can use other protocols such as SMTP etc.  REST : Representational state transfer uses URL and HTTP verbs such as GET, PUT, POST and DELETE to perform actions. Data is in JSON, CSV or RSS format. Soap Vs Rest SOAP is definitely the heavyweight choice for Web service access. It provides the following advantages when compared to REST: Language, platform, and transport independent (REST requires use of HTTP) Works well in distributed enterprise environments (REST assumes direct point-to-point communication) Standardized Provides significant pre-build extensibility in the form of the WS* standards Built-in error handling Automation when used with certain language products REST is easier to use for the most part and is more flexible. It has the following a...

OOPs Concepts

OOPs Concepts  An object is an instance of a class Object is a bundle of data and its methods (often called methods) Example:  class House { String address ; String color ; double are ; void openDoor () { //Write code here } void closeDoor () { //Write code here } ... ... } Abstraction : is the process where you only show "relevant " data and hide the "unnecessary" data from the user accessing the object. When you login to online banking, the only data shown to you is the username and password fields. The process of data transfer is hidden. Encapsulation : means binding object states (fields) and behaviors (methods) together. If you are creating a class, you are encapsulating. (Getters and Setters, making variables private etc.) Inheritance : means inheriting the properties and functionalities of another class. Is used for code re-usability Polymorphism : lets you to define a particular function is...

Java Interview - Algorithm & Data Structures Revision

Valid Parentheses public boolean isValid(String s) {          Stack<Character> st = new Stack<>();          for(char c : s.toCharArray()){              if(c == '(') st.push(')');              else if(c == '{') st.push('}');              else if(c == '[') st.push(']');              else if(st.isEmpty() || st.pop() != c) return false;          }          return st.isEmpty();      } Excel Sheet Column Title public String convertToTitle(int n) {          StringBuilder result = new StringBuilder(); ...