Disclosure: This article may contain affiliate links. When you purchase, we may earn a small commission.

How to create RESTful Web Services in Java using Spring Boot? Example Tutorial

Hello guys, if you are looking for a complete tutorial to create REST API on Spring Boot then you have come to the right place. In the past, I have shared the best RESTful Web Services courses and best Spring Boot courses and in this article, I am going to show you how to create RESTful web services using Spring Boot step by step. After going through this tutorial you will be able to create your own REST endpoints and RESTful application using Spring Boot and Spring Framework and Java programming language. How to make Spring boot REST API? is a common question that everyone has who is new to Spring boot application development. 

How to use Lombok in Java? Lombok @Data and @NonNull Annotations Examples

Hello Java programmers, if you have been doing professional Java development, you may have heard about Lombok library, one of the most popular Java libraries among professional Java developers, making coding in Java much more fun and rewarding. Java has always been criticized for its verbosity, and many programming languages like Scala and Groovy are invented to solve that problem, but Lombok solves that problem in Java itself. This means you don't need to learn a new programming language, but you can use the Lombok library and its annotations to write clear and concise code in Java. 

How to use NamedQuery in Spring Framework JDBC? Example Tutorial

Hello guys, many people don't know that Spring Framework provides support for NamedQuery where you can pass parameters in a much readable way by using named placeholders than the default placeholder of ? (question mark) which is used with PreparedStatement in Java. If you want to learn Spring JDBC then you have come to the right place. In the past, I have shared the best Spring Framework courses, books, and tutorials to learn Spring Framework and its different features, and in this example, I will show you how to use NamedQuery in Spring Framework. You can then use this technique to write much more readable queries on the Java layer for your application. 

10 Data Structures Every Programmer Should Learn

Data Structure and Algorithms are two pillars of Programming. They are also the most important ingredient of a good program and right choice of Data Structure and Algorithms can improve performance drastically, whereas a wrong choice can spoil the party, but do you know what exactly they are? Well, Data Structure are nothing but a way to store data, while Algorithms are ways to operate on that Data. There is a reason why Data Structure and Algorithms are taught in every single Computer Science classes, it doesn't matter whether you are learning Java, C++, Python, JavaScript, Golang, or any other programing language, those data structure and algorithm will be same everywhere. 

How to upload/download file in Spring MVC and Spring Boot Java application? Example Tutorial

Hello guys, if you are wondering how to upload file and download files from a Spring MVC application then you have come to the right place. This is an important functionality for any real-world application and knowing how to upload a file in a Spring application is important for professional Java developers and that's what you will learn in this Spring MVC tutorial. Earlier, I have shared several Spring Boot tutorial like Spring Boot + Microservices, and Spring Boot + REST and even  how to upload files using Servlet and JSP using Apache Commons FileUpload library and In this tutorial, we are going to discuss how to upload and download files using Spring MVC. 

How to use Mockito to Unit test Java Program with JUnit? Example Tutorial

Hello guys, if you are writing unit test your Java application then you would have definitely come across JUnit and Mockito, two of the essential unit testing framework  for Java developers. While JUnit offers support to run your test, setup and teardown and also assertion to check the expected and actual output. Mockito complements JUnit by offering you a mock based testing approach. Mock is nothing but a test double which can return a configured value when a certain method is called. It also provides ability to check if a particular method is called or not. By using Mock object or test double you can check if your code is behaving properly or not in different scenarios. This is also the key difference between JUnit and Mockito, JUnit provides infrastructure to run your test while Mockito provide infrastructure to created Mock objects. 

How to Enable log SQL statements in Spring Boot? Example Tutorial

Hello guys, if you are a Java developer developing Spring Boot applications, you may need to have proper knowledge of various kinds of errors and also how to overcome those. For example, most of Java developers use JPA in spring boot to make our work easy when managing databases. If you get an error like an internal server error (504 error), you need to go through your backend system and find the error. In many cases, these errors are caused by running invalid SQL or due to error on database. At that time, you often need to know which SQL statements are executed by Hibernate or JPA, or any other database library you are using.  

How to choose Collection in Java? List, Set, Map, and Queue Example

The Java collection framework offers implementation of different data structure like an array, list, set, map, queue, tree, etc and the choice really depends upon the situation and properties of the different data structure. For example, if your requirement is fast search with index then you can use ArrayList and if you want to store key-value pairs then you would consider using hash table data structure and there are a couple of implementation of hash table data structure in Java, like HashMap, Hashtable, LinkedHashMap, TreeMap, and ConcurrentHashMap. Now, which one will you choose? If you don't know or confused don't worry, I will give you a set of rules and use cases which will help you choose the right Collection type in Java depending upon scenario. 

Top 10 Matrix Coding Exercises for Programming interviews and Homework

Hello guys, if you are preparing for Coding interviews and solved 100+ data structure problems then you may know that Matrix is one of the under-rated topic for coding interviews but Matrix coding problems are not that easy to solve and  In this article, we'll see some of the popular Matrix coding problems for coding interviews. I actually learned a lot by solving Matrix related problems. I still remember the first Matrix based problem I solve was about how to multiply two matrices in Java and I learned a lot about multi-dimensional array and nested loop in Java by solving that problem. The second problem I solved was about transposing Matrix and that was also quite challenging for me at that time but helped me to further solidify my knowledge about loops and array in Java. 

How to find first recurring or duplicate character in given String? [Solved]

Hello guys, while surfing the Internet for a couple of weeks back, I come to know that this problem was asked on Google interviews, find the first recurring character in a given String. I don't know if that's true but this looks like a very simple coding problem from Google's Interview standard. If it was indeed asked, then that guy must have been very lucky. Anyway, I liked this coding problem and thought to write about it, because it's a good coding problem to check candidates' data structure and algorithms skills because it's tricky. It's tricky because it's very easy to make a mistake assuming just one recurring character in String, which you should avoid. Even if it was not asked on Google, you will potentially find this problem on various startups, and other IT companies like Infosys, TCS, Cognizant, Microsoft, and maybe Amazon

Difference between CAST, CONVERT, and PARSE SQL Server? Example Tutorial

Though all three, CAST, CONVERT, and PARSE are used to convert one data type into another in SQL Server, there are some subtle differences between them. The  CAST method accepts just two parameters, expression, and target type, but CONVERT() also takes a third parameter representing the format of conversion, which is supported for some conversions, like between character strings and date-time values. For example, CONVERT(DATE, '2/7/2015', 101) converts the character string '2/7/2015' to DATE using DATE format 101, representing United States standard.

Top 5 Spring MVC Annotations for Developing RESTful Web Services

Hello guys, Spring framework is one of the most popular Java framework and Spring MVC is probably the most common way to develop web applications in Java, but things just doesn't end there. In the past a couple of years, Spring has become the best way to develop RESTful Web services in Java. Despite numerous RESTful Web Service frameworks in Java world e.g. Restlet, Jersey, RESTEasy, and Apache CFX, Spring MVC has maintained its position as the leading framework for creating RESTful APIs in Java, and there are multiple reason why Spring is the best framework for Java developers for creating RESTful solutions and we will look one of them in this article. 

Difference between SQL, T-SQL and PL/SQL?

Hello guys, if you are preparing for SQL and Database Interviews or any Software engineering interview and looking for difference between T-SQL, SQL, and PL/SQL then you have come to the right place. Earlier, I have shared 50 SQL Interview questions and 12 SQL query Examples from interviews and today, we are going to see another common and interesting SQL interview question, what is the difference between SQL, T-SQL, and PL/SQL? It is also one of the most common doubts among SQL beginners. It's common for programmers to think that why there are many types of SQL languages, why not just single SQL across DB? etc. Well, let's first understand the difference between SQL, T-SQL, and PL/SQL, and then we will understand the need for these dialects. 

How to check Perfect number in Java? Example Tutorial

Hello guys, if you are wondering how to check if a given number is a perfect number or not in Java then you have come to the right place. This is one of the interesting coding problem to solve and learn and improve your coding and programming skill. In face, I learned most of my programming by solving these kind of questions. I started with simple ones like factorial, prime number, palindrome, anagram, string permutations before I started solving tree based problems and Dynamic programming problems. These kind of exercise not only give you a chance to get familiar with the programming language constructs like data type, operators, functions, class etc, but also help to build coding sense, which is nothing but your skill to convert your logic into code. 

12 SQL Queries Example and Practice Questions for Tech Interviews

Hello guys, if you are looking for SQL query examples from interviews or SQL Query Practice questions to improve your SQL skill then you have come to the right place. Earlier, I have shared best websites to learn SQL and Practice Query online and in this article, I am going to share 12 popular SQL query examples from interviews. You can also practice them to test your SQL skills before your technical Interview. If you don't know SQL, a short form of Structured Query Language is one of the essential skills in today's programming world. No matter whether you are a Java developer, C++ developer or Python developer, you must know how to write SQL queries. Every programming job interview has at least one or two questions that require you to write SQL queries for a given requirement and many developers struggle there. 

Why Singleton is Anti Pattern in Java Now and Why you should avoid it? Example

There was a time when the Singleton pattern was the darling pattern of many developers. It's a unique feature to keep certain services available globally, makes it very useful in all kinds of applications. It was also one of the most used design patterns among Java developers. I think the main reason for the Singleton pattern's popularity of designing the application is that there is always one instance of the most important service like Manager and Data Access classes. Still, with the adoption of Dependency injection, Singleton slowly faded away, and now it's considered an anti-pattern in Java applications. 

Java Stream + map + flatMap + Collectors.toSet() Example Tutorial

Hello guys, I was searching for a good example of flatMap online but didn't found a good one, so created my own. As name suggest flatMap is used to flatten stream like unwinding multiple list of values. For example you have a Stream of List of Integer and you want to create Stream of Integer by unwinding those list, you can do that using FlatMap function from java.util.Stream class. Coming back to flatMap, its actually a general concept which is available in other functional programming language like Scala. Just like map() function works by applying a function to each element in the Stream, flatMap works by applying a function that returns a sequence for each element in the list, and flattening the results into Stream or another list. 

Top 16 Lambda Expression and Stream Interview Questions Answers for Java Programmers

For a long time my readers were asking about some Java 8 interview questions, particularly on lambda expression, streams and around language changes e.g. default methods, method reference and functional interface. Finally, I am able to put some common Java 8 interview questions on lambda expression and Stream API and essential functional programming concepts like map, flatmap, and reduce together, which I going to share with you in this article, but before that, let's talk a little bit about impact of Java 8 in Java Developers interviews and why it's imperative for Java programmers to learn Java 8, particularly Lambda and Stream API in 2022. 

How to Join Two or More Tables in a SQL query? Left Join Example Leetcode Solution

Hello guys, when it comes to combining two tables in SQL, many programmers don't know that they can use the JOIN clause. In fact, JOIN is there to fetch data from multiple tables together. There are mainly two types of joins, INNER Join and OUTER join. On Inner join, only those records have matching values in both tables, while in Outer join, all records from one table are selected in addition to matching records from other tables. There are two kinds of Outer join in SQL, LEFT OUTER JOIN and RIGHT OUTER JOIN. Both are actually the same thing, which means you can get the same result by using either of the outer joins by changing the table's position from left to right.

Top 21 GraphQL Interview Questions and Answers for Beginners and Experienced Developers

Hello guys, if you are preparing for web developer interviews where GraphQL skills are needed and you are looking for frequently asked GraphQL Interview questions then you have come to the right place. Earlier, I have shared both Web development interview questions as well as REST Interview Questions and in this article, I am going to share 20 common GraphQL Questions from Interviews with answers. These questions covers essential GraphQL concepts like difference between REST And GraphQL and pros and cons of using GraphQL to consume APIs. If you have used GraphQL in past then you can easily answer these questions but if you forgot then you can always join of these best GraphQL online courses to learn and revise key GraphQL concepts.

Top 20 CSS Interview Questions and Answers for 1 to 2 Years Experienced Web Developers

Hello guys, if you are preparing for web developer job interview and looking for common CSS Interview Questions then you have come to the right place. Earlier, I have shared HTML Interview questions and CSS Interview Questions and in this article, I am going to share 20 common CSS Interview Questions with answers. If  you have used CSS for a couple of months then most likely you know the answer of these CSS questions but if you struggle with any of them then you can always go back to these best CSS online courses to revise key concepts. I have tried to include as many questions as possible covering different CSS concepts but you can also contribute, feel free to ask questions on comments. 

Is CodeGym Good Place to Learn Java? Is CodeGym Premium Worth it?

>Hello guys, if you are learning Java or want to learn Java but not sure if CodeGym is the right place for you or not then you have come to the right place. Earlier, I have shared best places to learn Java coding for FREE and in this article, I will review CodeGym, one of the interactive platform to learn Java. But, Before we see whether CodeGym is worth it for learning and mastering Java, let me tell you a little bit about what CodeGy really is.   CodeGym is an excellent and innovative alternative to traditional learning platforms like Udemy and Coursera. It is basically a platform that is designed for young and passionate people who want to learn Java. The CodeGym platform aims to deliver practical learning with the help of games that can make learning fun and interesting.

Top 30 Gradle Interview Questions with Answers for Java Developers

Hello guys, if you are preparing for Java developer interview then you must have come across Gradle, a Groovy based build tool which is gaining popular with Java community. While its not mandatory to learn Gradle for Java Interview if the job description mention Gradle or Groovy then you should prepare Gradle is one of the essential tool for Java developers. It's similar to  Maven and ANT, two other popular build tool for Java project but offers several advantages which I have explained in Maven vs Gradle post earlier.  These Gradle questions are good for both beginners and Java developer with 1 to 3 years of experience which are using Gradle in their project or expecting Gradle question on Java Interview.

How to use Composite Design Pattern in Java? Example Tutorial

Hello Java Programmers, if you want to learn about Composite Design patterns in Java, like how to implement Composite design pattern and when to use it then you have come to the right place. Earlier, I have shared the best Java design pattern courses and in this article, I am going to talk about Composite design Patterns, one of the 24 GOF patterns described in the classic Object Oriented design pattern book.  Composite Design Pattern is a behavioral design pattern from GOF, first described in their classic book design pattern. The composite pattern allows you to build a structure as a tree, which contains both leaf and composites

How to use State Design Pattern in Java? Vending Machine Example

The state design pattern is a behavioral pattern, first introduced by GOF in their class is book design patterns. State pattern looks similar to Strategy pattern but it helps in managing object state and thus enabling them to behave differently in a different state. In this example, we will take a famous object-oriented design interview question, implementing Vending Machine in Java. In the past, we have solved this problem without using any design pattern, but here we will use state design patterns to create a vending machine with different states.  This example will not just help you to understand how to implement State Design Pattern in Java but also gives you experience about when to use State Pattern on your application. 

Top 12 Locking, Synchronization and Multithreading Interview Questions for 5 to 7 Years Experienced Java Programmers

Hello guys, if you are an experienced Java developer say 3 to 5 years or 5 to 7 years experience and  preparing for Java Interviews then you very well know that Locking, Synchronization, ConcurrentHashMap, volatile and atomic, compare and swap (CAS), Executor Service, Stream API, and Multithreading in general are quite important and as an experienced Java developer you should be ready for them. In the past, I have shared 50+ Java Multithreading questions, 12 concurrency questions, 21 HashMap questions, and 10 ConcurrentHashMap questions and in this article, I am going to share 10 of my favorite question on Locking, Synchronization and Inter thread communication in Java. If you have been doing Java Interviews then its highly likely that you have already seen this problem but if you haven't you should definitely prepare them.

Top 20 Mockito Interview Questions with Answers for Java Programmers

Hello guys, if you are preparing for Java developer interview then you must prepare for Mockito, one of the most popular mocking and unit testing library for Java developers. Mockito is used across all kind of companies, both big and small like startups for unit testing Java applications and that's why good knowledge of Mockito is required to crack the Java Interview. Along with JUnit, Mockito is quite important and if you are looking for Mockito Interview questions and answers then you have come to the right place. Earlier, I have shared best JUnit and Mockito courses and unit testing books, and even popular JUnit interview questions and in this article, I am going to share 20 common Mockito questions for your interviews.

Top 35 Python Interview Questions with Answers 1 to 3 Years Experienced Programmers

Hello guys, if you are preparing for a Python developer job and looking for some frequently asked Python interview questions then you have come to the right place. Earlier, I have shared the Complete Python Developer RoadMap,  best books and best courses to learn Python and in this article, I am going to share 35 Python questions, covering different concepts for Python developer interviews. Sitting in any interviews, especially in tech interviews, is a tough job itself. You can't go in without proper preparation. Even if you have taken or given dozens of interviews, it is always recommended to go through the quick preparation notes or concepts.

10 Reasons to learn JavaScript Programming Language in 2022

Hello guys, if you want to become a web developer but not sure whether JavaScript is the right programming language or not, or want to learn JavaScript but not sure whether its worth the effort then you are the right place. Earlier, I have shared best JavaScript courses, books, and best places to learn JavaScript and in this article, I am going to share 10 key reasons to learn JavaScript in 2022. In the last five decades, hundreds of programming languages have been made. Most of these programming languages never even caught public attention. Only a handful of them actually became popular. Though, these handfuls of programming languages also make a long list. 

3 best ways to learn Web Development in 2022

Web development has changed a lot in the recent decade. More and more frameworks and libraries have come out while the older ones are either updated or left out. For example, React and Vue has debuted in the mid-2010s and quickly became popular while AngularJS was completely re-written to survive modern web development. Today, Web development is one of the most popular domains in the IT community. Every company or product wants a website because the web is easily accessible today. Even when mobile applications are gaining popularity, the web remains at the top. 

Top 20 System Design Interview Questions with Answer for 1 to 3 Years Experienced

Hello guys, if you are preparing for FAANG or any Software developer Job Interview on Startup or a Tech company like Spotify, Flipkart, or Zoom but worried about System design questions then you are not alone. System design is an intimidating topic and requires a lot of study and experience to design a real world system. While it's not a rocket science the knowledge of different system design components and concepts are hard to acquire. In the past, I have shared best System Design Courses and best Software architecture courses as both are related to each other and in this article, I am going to share 20 System Design Interview Questions with answers for programmers with zero to 3 years of experience. 

Top 20 Spring Cloud Interview Questions with Answers for 3 to 5 Years Experienced

Hello guys, if you are preparing for Spring and Microservice developer job and need Spring cloud interview questions then you have come to the right place. Earlier, I have shared interview questions on Spring Boot, Spring MVC, Spring Security, Spring Testing and Spring Core and in this article I am going to share common Spring Cloud questions for Java and Microservice developers. If you have used Spring Cloud in your project then you can answer all of these questions easily but if you struggle to answer any of these questions then you can always go back and join one of these best Spring Cloud courses and best Microservice courses to learn and revise essential Spring Cloud concepts. 

Top 35 React.js Interview Questions with Answers for Fullstack Java Developers

Hello guys, if you are preparing for React developer interviews and looking for frequently asked React.js interview questions then you have come to the right place. Earlier, I have shared the best courses, books, and websites to learn React.js and in this article, I am going to share 35 frequently asked React.js interview questions, suitable for 1 to 2 years experience developers. ReactJS is one of the most recently built open-source front-end programming languages. It came directly from Facebook's headquarter back in 2011. Earlier Recat.js was only limited to Facebook but now, it is one of the most extensively used programming languages all across the world.

Difference between Proxy and State design Pattern in Java

Hello guys, if you are preparing for Java interviews and looking for difference between Proxy and State design pattern then you have come at the right place. In the past, I have explained several important object oriented design patterns like State patttern, Strategy, Adapter, Facade, Factory, Observer, Decorator, Command, and Composite Pattern and also shared frequently asked questions on design patterns (See here) and in this article, I am going to share the key difference between Proxy and State Design Pattern in Java and OOP. The difference between Proxy and State pattern comes in both intent and structure, here are the key difference between both Proxy and State Design Pattern in Object oriented programming.

Top 20 Apache Kafka Interview Questions Answers for Java Developers

Hello, guys if you are preparing for the  Java Developer or Apache Kafka interview and looking for frequently asked Apache Kafka interview questions and answers then you have come to the right place. Earlier, I have shared the best Kafka courses and popular interview questions on JavaJMSSpring Boot, and Hibernate and in this article, I Am going to share 20 frequently asked Apache Kafka interview questions with answers. Over the years, Kafka which is developed by Apache Software Foundation has gained popularity because of its immense capability of data processing. Apache Kafka provides a unified, high-throughput, low-latency platform for handling real-time data feeds and because of that it has become a go to choice for high-speed message for many fortune 500 companies.