Posts

Two-Sum

Spring Params

By Path Variables Example:  public void pathVariablesExample(@Pathvariable("name") String name) RequestParams: public void paramVariablesExample(@RequestParams(name="firstname" required=true default="user")String name) Encapsulated Parameters Public class ParameterModel{ private String p1;private String p2; } public void paramVariablesExample2(ParameterModel params){ params.p1+""+params.p2 }

Useful curl commands

Command to connect to host with port number: 1. curl -v telnet://127.0.0.1:8000 To capture only response  curl --location --request GET "http://localhost:8000" To capture response and its  statuscode  curl --location --request GET "http://localhost:8000" -w "%{http_code}" To capture response and its status code in a file curl --location --request GET "http://localhost:8000" -w "%{http_code}"

Use full Links

Java- 1.  Java2Blog - A blog on Java, Python and C++ programming languages 2. 15+ Coding Based Java 8 Coding Interview Question - Quescol 3. Armstrong Number in Java | How to Find Armstrong Number? (Examples) (educba.com)
  Micro-Service Interview Questions   1.        What is a micro-service? 2.        What is cohesion? 3.        What is coupling? 4.        Benefits and drawbacks of Monolithic services? 5.        What are alternative for Monolithic services? 6.        Explain Microservice architecture? 7.        In a micro-service nutshell -What are components? 8.        What are the advantages and disadvantages of Micro-services? 9.        What are different ways of Microservice communication? 10.    What are different design patterns evolving around microservices? a.        Circuit-break pattern b.        saga-pattern c. ...

GIT Commands

git clone <repository-name> git status git add * git commit -m "commit-message" git push origin <branch-name> git reset --<commit-Id>  soft/mixed/hard git config --global user.name  "username" git config --global user.email "shaikjee***@gmail.com" git config --global  http.sslverify  false

Maven Commands

1. mvn -version 2. mvn clean 3. mvn clean install 4. mvn clean install -DskipTests=true 5. mvn -Dmaven.test.skip=true  clean install 6. mvn dependency:tree 7. mvn dependency:tree -Dincludes=<artificate-Name> 8. mvn deploy

Java - Find the sum of two elements equal to target

Image