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

Saturday, May 27, 2023

Aggregator Design Pattern In Java Microservices with Examples

The Aggregator design pattern in Microservice architecture is a design pattern used to compose a complex service by aggregating the responses of multiple independent microservices. It's also one of the essential Microservices Design patterns along with SAGA, CQRS, and Event Sourcing. This pattern is proper when a client request requires data or functionality distributed across multiple microservices. It can improve the performance and scalability of the system by allowing each microservice to focus on a specific task and reducing the workload of a single microservice. In this article, we will discuss how the Aggregator Microservice Pattern can be implemented in Java using various approaches, such as asynchronous communication, synchronous communication, or a combination of both. We will also provide examples of code to illustrate each approach.

What is Circuit Breaker Design Pattern in Microservices? How to implement it?

Hello guys, Microservices design patterns are very important concepts for Java developers to learn, not just to create a robust, scalable, and high-performance Microservice architecture but also to do well on Java developer interviews. In the past, I have shared several Microservices design patterns like e Event Sourcing, SAGA, Database Per Microservices, CQRSAPI Gateway, and also shared best practices to design Microservices and in this article, I am going to talk about Circuit-Breaker Design Pattern, and how you can implement in Java using Spring Cloud Framework.  This is not just an important Microservice Pattern but also a popular Microservice question which I have also mentioned earlier in my article about 15 Microservices questions for Interviews. If you haven't read that article yet, I suggest read it, especially if you are preparing for Java and Microservice interviews. 

Friday, May 26, 2023

How to find Kth Smallest Element in a Binary Search Tree? [Solved]

Hello guys, I have been sharing binary search tree-based coding interview questions for quite some time. In the last article, we looked at how to find the maximum sum level in a given binary tree, and in this article, we will find the kth smallest number in a given binary tree like the 5th smallest or 3rd smallest number. Before we find the kth smallest in a Binary search tree, We need to understand the binary search tree. A Binary tree is a data structure in which each node can have at most two children. That is, each node in the binary tree will have data, left child and right child. The first node of the tree is called the Root.

How to find the maximum sum level in binary tree in Java? Example Tutorial

Hello guys, if you are preparing for a coding interview and wondering how to find the maximum sum level in a given binary tree in Java then you have come to the right place. I have been sharing binary tree coding problems for the last few months and in the past, we have seen questions like finding kth smallest element and finding the lowest common ancestor of a binary tree in Java in this article, you will learn how to find the maximum sum level in a given binary tree of integers or numbers. But, before finding the maximum sum level of a binary tree in java, we need to have a good understanding of a binary search tree. Both theoretical knowledge and how to implement binary search tree in Java is important to solve tree-based coding problems

Thursday, May 25, 2023

Difference between application.properties vs Application.json vs Application.yml in Spring Boot

Hello guys, if you have worked in any Spring Boot application then you may have noticed that there are multiple ways to declare configuration for Spring Boot application. I am sure you must have noticed application.propties, application.json, and application.yml while working in proprietary or open source Spring Boot application. When I first started, it was application.propties and it was quite familiar because I have used properties file in past for specify configuration of Java application but when I first see applcation.json and application.yml I was bit confused like what they are and does they really work? In the end I found out that they are just different ways to specify configuration for any Spring Boot application. 

Difference between @RequestParam vs @RequestBody in Spring MVC? (with Example)

Hello everyone, in this article, we are going to look at an interesting topic from the Java Spring framework and the topic is, to find the difference between @RequestBody and @RequestParam. If you don't know this is one of the frequently asked Spring MVC interview question and also two of the most used annotation when creating backend of a Java web application in Spring Framework. Earlier, I have explained difference between @RequestBody and @ResponseBody in Spring MVC and REST APIs, and in this article, I am going to tell you the difference between @RequestBody and @RequestParam annotation in Spring Framework. It is worth noting that these two annotations are frequently used in Spring Boot REST API.

Difference between Spring Boot vs Spring Cloud in Java

Hello guys, if you are wondering, what is difference between Spring Boot and Spring Cloud then you re not alone. Many Java developer are not familiar with various spring boot projects like Spring Security, Spring Data JPA, Spring Batch, Spring Boot, Spring Cloud etc and this lack of knowledge prevent them from taking full advantage of Spring Framework.  In last article, I have explained difference between Spring framework and Spring Boot and in this article we are going to discuss the difference between Spring Boot and Spring Cloud. Before we dive into the difference between the two terms. Let us take a look at different terms like Spring, Spring Boot, and Spring Cloud.

Wednesday, May 24, 2023

10 Examples of RestTemplate in Spring Framework

Hello guys, if you are wondering how to send GET and POST request to your API or Web Service from a Java based Spring Framework then you would be glad to know that You can use use RestTemplate class from Spring Framework. It's a fully functional HTTP client which is really really useful in this age of API. I have used RestTemplate to consume JSON from API before as well as sending different kind of request like POST, PUT, DELETE and PATCH to any REST API. For example, in this article, I shared how to send POST request using RestTemplate and how to set header on HTTP request using RestTemplate. Yes, RestTemplate also allow you to send headers like Authorization on Http Request. 

How to Handle REST exception in Spring Boot Application? Example Tutorial

Hello everyone, in this article we are going to take a look at how to handle REST API exceptions in Spring Boot. It is crucial to handle errors correctly in APIs by displaying meaningful messages as it helps API clients to address problems easily. What happens if we don’t handle the errors manually? By default, the spring application throws a stack trace, which is difficult to understand. Stack traces are mainly for developers hence it is useless for API clients. That's why its very important to use proper HTTP code and error messages to convey errors and exception to client and also logging so that support team can better handle them. Ideally you should tell what went wrong and how to fix it? For example, if the error is due to duplicate data then clearly say, already existed, try with a new one. Similarly, if authentication fail then clearly say authentication failed instead of throwing some other exception. 

Tuesday, May 23, 2023

Difference between VARCHAR and CHAR data type in SQL Server? [Explained]

Hello all, today, I am going to share an interesting SQL Server interview question, which will not only help you in your interview but also in your day-to-day work. It explains one of the critical concepts of SQL Server, the difference between VARCHAR and CHAR data type. I am sure, you all have used both of them numerous times but because it's so common many of us ignore the difference between them and when asked to choose between VARCHAR and CHAR on interviews, they fail to give a convincing reason. The difference is not just significant from an interview point of view but also from a robust database design because an incorrect choice of data type not only limit what kind of data you can put on but also waste precious space and makes your query slower, particularly when you have to deal with the massive amount of data.

What is window function in SQL with Examples? How and when to use them?

Hello folks, if you are wondering what is window function and what problem does it solve then you have to the right place. In this article, I would be explaining the windows functions with examples, how it works, and when you need to use it. Firstly what is a Window Function in SQL? A window function performs a calculation across a set of table rows that are similarly related to the current row. The current row is the row in which function evaluation occurs. This is comparable to the type of calculation that can be done with an aggregate function. But unlike regular aggregate functions like sum, avg, max, and min, that perform operations on an entire table.

How Long It Take To Become a DBA (Database Administrator) in 2023? 7 days, 1 month or 1 year?

Hello guys, if you want to become a Database Administrator in 2023 and wondering how long does it take to learn SQL and Database and become a professional Database Administrator or Junior DBA then you are at right place. In the past, I have shared free SQL and Database courses as well roadmap to become a Web Developer and in this article, I am going to share how long it will take you to become a DBA in 2023. Along the way, I will share best way to learn SQL and Database and what is the best way to become a DBA quickly. So continue reading and find out what it takes to become a DBA and get a job in real world. I will also share all the skills you need to become a DBA in 2023.

Monday, May 22, 2023

How to set base URL for REST in Spring Boot? Example Tutorial

Hello guys, if you are wondering how to set base URL for REST API in Spring Boot then you have come to the right place. Earlier, I have shared best REST API Courses for Java developers, REST API Books,  and a complete guide to create RESTful Web service using Spring Boot, in this article, I will show you how to set a base URL in any spring boot application? If you don't know what is a base URL in a REST application or website, let me give you a brief overview first.  A base URL is the continuous element of your REST API or website's address. For example, you'll notice that the address portion http://twitter.com displays in the address bar whenever you log on to your Twitter account or visit a Twitter profile from your computer. This is the primary or base URL.

How to Enable Disable Spring Security in Spring Boot? Example Tutorial

Hello guys, if you are wondering how to enable and disable Spring Security in a Spring Boot based Java application then you have come to the right place. In the past, I have shared best Spring security courses25 Spring Security questions, as well multiple Spring security tutorials like how to use HTTP Basic auth in Spring Security etc.  and in this article, I will share multiple ways to enable and disable Spring Security in a Spring boot application. But, before that, if you are new to Spring Security then find out what is Spring Security and how does it work?  At its core, Spring Security is simply a bunch of servlet filters that assist you with adding authentication and authorization to your web application. 

Sunday, May 21, 2023

Top 5 Features Of Spring Boot 3 To Learn In 2023

Hello guys, if you want to learn Spring Boot 3 and wondering which features to start with then you have come to the right place. Earlier, I have shared 5 worth learning features from Spring Framework 6 and in this article, I am going to share 5 Spring Boot 3 features which are worth knowing and learning for every Java developer But, before we get to the best 5 features that you definitely need to check out in Spring Boot 3, let me tell you a bit about what Spring really is. Spring is basically a framework that can be used for developing various types of applications with the help of Java platforms. It also provides support for the Plain Old Java Objects, also known as POJOs, that developers can use for easily creating the Java SE Programming Model with full and partial Java EE.

How to do Integration Testing in Spring Framework? @SpringBootTest Example Java

Hello guys, if you are wondering how to test your Spring Boot application then you have come to the right place. Earlier, I have shared popular Spring Boot Testing Interview Questions and Spring Security Interview Questions and In this article, I will show you examples to test your Spring Boot application using @SpringBootTest annotation, which allows you to write Integration tests. When I talk about spring boot integration testing, I am talking about launching an application in ApplicationContext and performing tests. For integration testing, Spring Framework has a specific test module. It's referred to as a spring test. If we're going to utilize spring-boot, we'll need to use spring-boot-starter-test, which uses spring-test and other dependencies inside.

5 Essential Spring Boot Annotations with Examples in Java - Tutorial

Hello guys, if you are coding in Java for long then you know that Annotations have completely changed the way you write Java code. It's now impossible to write any Java code without using annotations but that's for good. They provide a lot of value and that's why it's important for a Java developer to get familiar with essential annotations of the framework he or she is using. When I think about Java, some of the essential annotations which come to our mind are @Override, @SuppressWarning, and @Deprecated. Similarly, if you are using the Spring Boot framework, an extension of the Spring framework which aims to simplify the Java development with Spring, you will often end up using a couple of annotations like @SpringBootApplication or @EnableAutoConfiguration.

Saturday, May 20, 2023

How to upload a file and JSON data in Postman? Example Tutorial

How to upload a file and JSON data in Postman is a common question when you are dealing with REST APIs. In order to do this, you need to send through POST request. So in this article, we are going to explain this using different examples where you can upload a single file in different ways. upload a list of files, upload as an object or upload a list of objects containing images from postman. So before moving to the following different aspects of uploading a single file in different ways, let's assume that in your postman, you are using header named "Content-Type" with the value of "multipart/form-data".

Spring Boot Backend + Vuejs Example [Java tutorial] - Part 1

In this tutorial, we will show you the Vue.js HTTP client and Spring Boot Server example that uses Spring JPA to do the CRUD with the H2 database and Vue.js as frontend technology to make requests and receive responses. But before moving to the Spring Boot and VueJs Example, Let's discuss what is Vuejs and its use cases.

Friday, May 19, 2023

Top 5 Spring 6 New Features Java Developer Should Learn In 2023

Hello guys, if you are wondering what is New in Spring Framework 6 release and what new feature it has got or what does it support now then you have come to the right place. In this article, I will share 5 key changes from Spring Framework 6 which are worth knowing for Every Java developer. Before we get to the top 5 features of Spring that you need to definitely learn in 2023, let me tell you a bit more about what Spring Framework really is. Spring is basically a framework that can be used for developing various types of applications with the help of Java platforms. It also provides support for the Plain Old Java Objects, also known as POJOs, that developers can use for easily creating the Java SE Programming Model with full and partial Java EE.

What is API Gateway Design Pattern in Microservices? With Examples

Hello guys, API Gateway Design Pattern is a pattern that has emerged as a popular solution for managing APIs in a microservices architecture. As the number of services in the architecture increases, it becomes challenging to manage the APIs and handle requests from external clients. To address this challenge, API Gateway Design Pattern provides a single entry point for all the APIs in a microservices architecture. In the past, I have shared several Microservices design patterns like e Event Sourcing, SAGA, Database Per Microservices, CQRS, API Gateway, and also shared best practices to design Microservices and in this article, I am going to talk about the API Gateway Design Pattern, and how you can implement in Java using Spring Cloud Framework (Spring Cloud Gateway). 

Thursday, May 18, 2023

Java + Spring Boot + Microservices Example - Step by Step Guide

Hello guys, if you are wondering how to create a Microservice in Java and Spring Boot then you are at the right place. In the past, I have shared best Spring Boot courses for Microservices, Interview Questions as well as essential Microservice design principles and patterns like API Gateway, Circuit breaker, CQRS, Event sourcing etc and In this article, we will cover the fundamentals of microservices with Spring Boot utilizing Spring cloud. We will cover a few fundamental ideas and then we will make a little microservices to give you an outline. I will also share step by step guide to make Microservices in Java and then deploy them using Docker and Kubernetes on Cloud. 

Wednesday, May 17, 2023

Top 15 Microservices Interview Questions with Answers for Java Developers

Hello guys,  if you are preparing for Java interviews then preparing for Microservice architecture is a good decision but there are not many places where you can find Microservice interview questions, so I thought to share some common Microservices questions from Java interviews. If you are a regular reader then you may know that I have been sharing spring interview questions regularly like I shared spring boot questions last year and this year, I have shared spring cloud questions and spring data jpa questions so far. You can use those articles to prepare well for any Java and Spring boot interviews, but I also suggest spending some time learning core spring concepts as those are very important.

Monday, May 15, 2023

Asynchronous Messaging In Java? JMS, Kafka, and RabbitMQ Examples Tutorials

Hello fellow Java developers? Are you tired of those pesky synchronous messages clogging up your code like old grease in a drainpipe? Fear not, because today we're talking about asynchronous messaging in Java – the ultimate solution for decoupling your processes and improving the performance of your applications.  But before we dive into the juicy details, let's start with the basics. What is Asynchronous Messaging? Asynchronous messaging is a method of communication between two or more processes like Microservices, where the sender sends a message and doesn't wait for a response before continuing with its own tasks. This is in contrast to synchronous messaging, where the sender must wait for a response before continuing.

What is CQRS Pattern in Java Microservices? Command Query Responsibility Segregation Example Tutorial

Hello guys, if you are wondering what is CQRS pattern and when and how to use it in your Microservices then you have come to the right place. CQRS is one of the 10 essential Microservice pattern and can be used when your application is either read heavy or write heavy and reading and writing requirement are very different. It aims to separate your app into two parts, command part which writes data and query part which read data and that's how it allows you to develop, scale and optimize them separately. It's also one of the popular Microservices Questions and if you are preparing for interviews, you should prepare this pattern as well. Earlier, I have explained SAGA Pattern and Database Per Microservice pattern and in this article I will explain CQRS pattern, when to use it and what problem does it solve. 

Sunday, May 14, 2023

How To Implement Security in Microservices Architecture

Hello guys, if you are wondering how to secure your Microservices, like put authentication and authorization then you have come to the right place. Security is a critical aspect of any software architecture, and microservices architecture is no exception. With its distributed and decentralized nature, microservices architecture presents unique security challenges that must be addressed to ensure the integrity, confidentiality, and availability of the system.In this article, we will discuss some best practices for implementing security in microservices architecture.

18 Spring Cloud Features for Microservices Architecture in Java?

Hello guys, If you are doing Java development using Spring Boot then you may already know that Spring Cloud is a popular open-source framework for implementing microservices in Java. It provides a wide range of features that simplify the development, deployment, and management of microservices in Java. In this article, we will discuss some of the key features of the Spring Cloud framework that makes it an excellent framework for developing Microservices in Java. Microservices architecture is a modern approach to building complex applications as a collection of loosely coupled, independently deployable services. In this article, you will learn about the features that Spring Cloud framework offers to implement microservices in Java. This includes capabilities such as service discovery and registration, load balancing, circuit breaking, distributed configuration management, centralized logging, API gateway, security, and monitoring.

Saturday, May 13, 2023

SAGA Design Pattern In Java Microservices with Example

Hello guys, if you want to learn about SAGA Microservice design pattern then you have come to the right place. SAGA is one of the 10 essential Microservice Design Patterns I have shared earlier and it solve a critical problem related to distributed transaction. But, before we get to the different examples that will teach you all about SAGA microservice design patterns in Java, let me tell you a bit more about what it really is. A microservice-based application is basically a distributed system. The overall system consists of multiple minor services, which provide the overall application functionality. This architectural style offers numerous benefits as well as several limitations. SAGA Pattern is also one of the popular Microservice interview question and if you are going for interview, it make sense to learn and understand this design pattern in depth. 

Friday, May 12, 2023

What is Event Sourcing Design Pattern in Java Microservices? Example

Hello Java programmers, if you are tired of constantly trying to keep track of your application's current state using a traditional relational database then the Event Sourcing pattern might be just what you need. Event Sourcing is a popular pattern in Microservice architecture that allows services to persist and query the state of an application using a sequence of events instead of storing the current state. This pattern has gained popularity because it helps to build complex systems with a clear audit trail and support for long-term scalability. By storing a sequence of events, rather than just the latest state, developers can reconstruct the application state at any point in time, even after failures or bugs. It's also one of the 10 essential Microservice patterns I have shared earlier and it's one of the top 3 along with Saga and CQRS patterns which we have seen in my earlier articles.  

Wednesday, April 26, 2023

10 Reasons to learn Node.js for Web Developers in 2023

In full-stack development, backend development is often considered more complicated and tougher. It's not easy to be a backend developer. Backend is considered the brain of the application and if anything goes wrong here, the whole application can collapse. So the backend should be solid and people working on it should be skilled. Backend development has advanced a lot in the last two decades. For years, backend development was dominated by PHP. But, when JavaScript was taken out of the browser, it changed everything. The emergence of Node.js in 2008 changed everything for the backend development community. JavaScript was no more a client-side language. Now, it could be used on the server-side too. Thus making it a full-stack programming language.

Angular vs React vs Vue.js ? Which is better to learn web development in 2023?

JavaScript web frameworks are important parts of modern web development. Several JavaScript web framework and libraries are active today. If you plan to become a web developer, you may encounter these web frameworks. A web developer, especially a front-end web developer should be skilled in at least one of these frameworks. Angular and React are the two most popular web frameworks and libraries today. Vue.js is the rising star. In this article, we will compare these three frameworks on different parameters like Community support, Performance, ease of Learning, and jobs to find out which frontend development framework between Angular, React.js and Vue.js you should learn in 2023. 

React Native vs Flutter? Which is better to learn for App Development in 2023?

Hello guys, if you are wondering whether to learn Flutter or React Native for App Development in 2023 then you have come to the right place. Earlier, I have shred best courses to learn Flutter and React Native and in this article, I will share my thoughts on which one is better suited for App development in 2023 and which mobile app development framework beginner should learn in 2023. In the recent decade, the mobile application community has grown tremendously. The total number of applications on the play store surpassed one million in the year 2013 and by mid-2020, it was estimated that there are more than 2.8 million applications on the google play store. 

How to Find Lowest Common Ancestor of a Binary Tree in Java? Example Tutorial

Hello guys, if you are wondering how to find the lowest common ancestor of a binary tree in Java then you are at the right place. Earlier, I have shared 40+ binary tree questions and today I am going to share solution of one of the popular binary tree question here. To find the lowest common ancestor of a binary tree in java requires that we run through a binary search tree and how it operates.  What then is a binary search tree? A Binary tree is a data structure in which each node can have at most two children. That is, each node in the binary tree will have data, left child and right child. The first node of the tree is called the Root.

10 Git Commands Every Programmer Should Learn

Hello guys, Git is one of the most important skill for programmers, developers and data scientist and if you don't know git then you will struggle working in a team. If you want to learn Git in 2023 then you can start with these essential Git commands. I have explained the command and give you example. For examples, I have asked ChatGPT to see how it explains and I was amazed to see the response so I have included here for my own reference. I don't if ChatGPT will remain free forever but I am taking screenshot for the questions which I am asking so that I can keep a record for myself and you in future as ChatGPT is the best instructor I have got today and its helping me to learn and revise several key concepts. 

26 Spring Framework Interview Questions Answers for 2 to 4 years experienced Java Developers

Spring is one of the most popular framework and most widely used to develop Java Web application using MVC framework. Due to its immense popularity its expected from Java guys to know how to use Spring framework and how it works. Most of the Java development position uses Spring, Hibernate along with core Java and JEE web technologies like Servlet, JSP, and JSF. In this article, I will be sharing some frequently asked Spring interview question for Java JEE developers. It will contain questions from different Spring modules like Spring MVC, Spring core, the concept on which Spring is built e.g. IOC and DI and Spring security.

8 Examples of Primitive Data Types In Java (int, long, boolean, float, double, byte, char, and short)

Hello guys, Data types are first few things you should learn when you start learning a programming language and when it comes to learn Java, there are 8 primitive data types which you should know. These are divided into three categories, numeric, text, and boolean values. Numeric data types can be further divided into two like natural numbers and floating pointing numbers. But, Before we get to a list of the 10 examples of primitive data types in Java, let me tell you a little bit more about what the primitive data types are.  There are essentially 8 primitive data types in Java. They are int, byte, short, long, float, double, boolean, and char. The primitive data types are not considered objects and represent raw values. These primitive data types are also stored directly on the stack.

10 points on TCP/IP Protocol, Java Programmers should Know

TCP/IP is one of the most important protocol as its backbone of HTTP, internet and most of the communication happens today. It's also important from technical interview perspective, you might have already seen difference between TCP and UDP multiple time during interviews ( I have seen). I believe every programmer, not just Java developer should know what is TCP/IP protocol? How it works and the below points I am going to mention. These are basic points and most of you already know but during Interview I have found many developers who doesn't really know what TCP/IP offers and how it works and what are the pros and cons of TCP/IP protocol. That's where, I think this article will help you. Anyway, let's jump into technical details now. 

How to write to a File with try-with-resource in Java? Example Tutorial

Hello Java programmers and all people learning Java, if you are familiar with try-wit-resource statement then you know that its a great language functionality and tool to open files, sockets, streams, and network connections or any resource which are require closing. Before try-with-resource was introduce in Java 7, Java developers have to manually write try catch finally block to close the connections for both success and failure cases to prevent resource leak but it was also tricky and many programmer make mistakes which actually resulted in resource leaks. One common example of that is running out of file descriptors which is used for both opening file and socket in Java.  

Monday, April 24, 2023

What is try with resource in Java? Example tutorial

In Java we normally use resources like file, network connection, socket connection, database connection etc ,dealing with resources is not a difficult task but what if after using the resources programmers forget to close the resources. As we know in Java everything is Object so if we forget to close or shut down the resource its responsibility of GC that will recollect it when its no longer used but we can reduce resource exhaustion by explicitly closing the resources as soon we done with our job with the resources. Some resources like database connection are very precious and would surely run out of resources if waited for finalization. Many database servers only accept a certain number of connections so if forget to close properly will create problem.

How to get the first and last item in an array in Java? Example Tutorial

Firstly, before going about finding the first and the last item of an array in java. We need to fully understand what an array is and how it works. What then is an Array? An array is a data structure in java that holds values of the same type with its length specified right from creation time. Think of a container, like a crate of eggs or coke. What I am trying to say is that when you are creating your array, the items coming in must be the same as you have specified as length and you must specify how many items are coming. If you have stated that the items coming are integers, so it is and no other data type (e.g string, char e.t.c) can be there and vice versa. Or you can say an array is a collection of similar type of elements which has contiguous memory location.

How to use Deque Data Structure in Java? Example Tutorial

Hello friends, I am really glad to see you all again here. And I know you are here to learn new and valuable Java concepts and continue your journey on Java. Today we are gonna learn something that is really important logically. yes! you heard right, we are going to learn about Deque data structure in Java and how to use Deque in the Java program. Deque is a special data structure, a double-ended queue that allows you to process elements at both ends, I mean you can add and remove objects from both front and rear end. It's a short form of Double-Ended Queue and pronounced as "Deck".  

Difference between array and Hashtable or HashMap in Java

A couple of days back someone asked me about the difference between an array and a hashtable, though this is a generic data structure and programming question, I'll answer it from both a general programming perspective as well on Java perspective where Hashtable is not just a data structure but also a class from Java Collection API. Even though both array and hashtable data structure are intended for fast search i.e. constant time search operation also known as O(1) search, the fundamental difference between them is that array require an index while hash table requires a key which could be another object. 

Anonymous Class to Lambda Expression in Java 8? Example Tutorial

Hello guys, you may be thinking why I am talking about Anonymous class now when many Java programmers have already switched to Java 8 and many have already moved on from Anonymous class to Lambda expression in? Well, I am doing it because I am seeing many Java programmers who find it difficult to write and read code using lambda expression in new Java 8 way. It's also my own experience that if you know the problem first, you can better understand the solution (lambda expression). Some of you might remember, the opening scene of MI 2 (Mission Impossible 2), when Nekhorovich says to Dimitri that "Every search for a hero must begin with something that every hero requires, a villain. Therefore, in our search for a hero, Belairiform, we created the monster, Chimera"

Top 20 YAML Interview Questions Answer for Developers and DevOps Engineers

Hello guys, if you don't know YAML stands for Yet Another Markup Language and its one of the popular language for defining system rules. YAML is used in Spring Integration and most popularly in Ansible for defining Ansible playbook which you can use to install or uninstall application and do other stuff. Because of that reasons YAML has become quite popular and you may be asked about basic questions in YAML if you are going for a Developer or DevOps Interview where YAML skills are required. At the very minimum you should know how to read YAML and how to write YAML, particular declaring list and key-value pair in YAML. It's not a big topic but knowing basic really help during interview.

Java FileReader + BufferedReader Example

There are multiple ways to read a file in Java e.g. you can use a Scanner as we have seen in the last example, or you can use the BufferedReader class. The advantage of using a BufferedReader to read a text file is speed. It allows faster reading because of internal buffering provided by BufferedReader. Other Reader classes like FileReader access the file or disk every time you call the read() method but BufferedReader keeps 8KB worth of data in its internal buffer which you can read it without accessing the file multiple times. It's loaded when you access the file the first time for a subsequent read.

10 Examples of print(), println() and prinf() methods In Java - PrintStream

Hello guys, if you are working in Java or just started with Java then you have must come across statements like System.out.println("Hello world") to print something on console or command prompt. This is actually the first statement I wrote in Java when I started programming and at that time I didn't realize how it work and what is System and PrintStream class and what is out here but now I know and I am going to explain all this to you in this article, along with PrintStream class and its various print methods like print(), println() and particularly printf() to print various objects in Java. But,   Before we get to the 10 examples of Printstream printf() in Java, let me tell you a little bit more about what exactly Printstream is. 

Top 20 Artificial Intelligence Interview Questions and Answers

Hello guys, if you are preparing for AI developer interview and looking for AI Interview questions and answers then you have come to the right place. Earlier, I have shared Python Interview Questions and Machine Learning Interview Questions and in this article, I am going to share 20 common Artificial Intelligence Interview Questions with answers for 1 to 2 years experienced professionals. If you have worked in the field of AI then you most likely know the answers of all of these questions but if you cannot answer then you can always check these best AI Courses to learn and improve your AI fundamental concepts. 

Top 20 Bootstrap Interview Questions Answers for Web Designers and Developers

Hello guys, if you are preparing for web design and development interview and looking for Bootstrap interview questions then you have come to the right place. Bootstrap is one of the most popular CSS Framework and almost all websites uses Bootstrap for their classy look and feel and bigger buttons and form elements. Earlier, I have shared HTML 5 Interview Questions and best online courses to learn HTML, CSS and Bootstrap courses and today, I am going  to share bootstrap interview questions with answers.  Here is a chance for you to make sure that you go into that Bootstrap interview with your head up high. Being ready for that interview is the major step that you can make as you seek to impress the interview panel on the interview day.

Chain of Responsibility Pattern in Java? Example Tutorial

Hello guys, if you have been doing Java development then you must have come across design pattern, tried and tested solution of common software problem. In the past, we have looked at several popular Object Oriented Design Patterns in Java like Adapter, Decorator, State, Strategy, Template, Composite, Command, Observer, Factory, Builder, Visitor etc, and today I am going to talk about Chain of Responsibility design pattern in Java. The Chained or Chain of Responsibility Pattern is a design pattern that allows a request to be passed along a chain of objects until it is handled by one of the objects in the chain. This pattern is helpful for situations where it is not known in advance which object in the chain should handle the request, or where the request needs to be handled by multiple objects in the chain.

3 ways to convert String to JSON object in Java? Examples

It's very common nowadays to receive JSON String from a Java web service instead of XML, but unfortunately, JDK doesn't yet support conversion between JSON String to JSON object. Keeping JSON as String always is not a good option because you cannot operate on it easily, you need to convert it into a JSON object before you do anything else e.g. retrieve any field or set different values. Fortunately, there are many open-source libraries which allows you to create JSON object from JSON formatted String like Gson from Google, Jackson, and json-simple. In this tutorial, you will learn how to use these 3 main libraries to do this conversion with step-by-step examples.

Sunday, April 23, 2023

Top 10 Projects to Learn Front-End Web Development

Hello guys, If you are looking for ways to learn Front-End Web Development, you have come to the right place because all of what you want is right here. You just have to keenly go through this article till the end and you will get what you need.  Front-end web development is a popular field that involves creating the user interface and experience of websites and web applications. It is an ever-evolving field that requires developers to stay up-to-date with the latest tools, technologies, and trends. One of the best ways to learn front-end web development is through hands-on projects. In this article, we will explore the top 10 projects that can help you learn front-end web development and enhance your skills in HTML, CSS, JavaScript, and other related technologies. 

How to use @JsonCreator and @JsonPropertOrder Jackson JN Annotation in Java? Examples

Hello guys, if you are dealing with JSON in Java then you may have come across Jackson, one of the popular JSON library in Java. Jackson provides many cool annotations to serialize and de-serialize JSON to Java object and vice-versa. Earlier, I have showed you 3 ways to convert JSON to Java object and 10 free Jon Tools for programmers and in this article, we will deep dive into two popular Jackson annotations @JsonCreator, @JsonProperty, and @JsonProperOrder. But, Before I tach you exactly how you can use the @JsonCreator annotation, let me briefly tell you a bit more about what Java really is.

Top 5 Functional Interface Every Java Developer Should Learn

Hello guys, functional interface in Java are an important concept but not many developer pay enough attention to them. They learn lambda and method reference but the functional interface from java.util.function package. While its not really possible to learn all the functional interfaces on that package but you can learn a few more commonly used ones like Predicate, Supplier, Consumer etc and that's what you will learn in this article.  But, before we get to the top 5 functional interfaces that every Java developer should learn, let me tell you a bit about what Java really is. 

Difference between Class and Object in Java? Example

Class and Object are two pillars of Java and any Object oriented programming language. There are multiple ways you can describe Class in Java, I will start with how I remember class from my college Days. That time, I used to remember that "A class is a blueprint to create object" and that's how I answer during viva or exam. While I know what is a blueprint, I didn't really understand what a class can do. Later, when I started coding, I learned about data types like int data type to hold integer values. String data type to hold text values.  

How to convert List Of of Object to Map of Object (key, value) In Java? Example Tutorial

Hello guys, if you have a list of object and you want to conver into Map of object or key value pair then you can use different ways like looping over list and then adding values to map, or you can use Collectors.toMap() by using Stream API, You can even use flatMap() function if you want to convert list of one type of object to Map of another type of object. All this is possible and I will show you code example of how to do that in this article, But, before we get into the process of how you can convert a list of one object to another in Java, let me tell you a bit more about what Java really is. 

What is WeakHashMap in Java? HashMap vs WeakHashMap Example Tutorial

Hello friends, we are here today again on our journey to Java. I hope everyone is fine and ready to board our train of knowledge. Today we are gonna learn something very interesting and very exciting. Today's topic will definitely be very useful in coding and programming. This topic would surely decrease your time complexity, and space requirements for any task very significantly :p So what's the wait? Let's start!

JDBC - Difference between PreparedStatement and Statement in Java? Answer

If you have worked with database interfacing with Java using JDBC API then you may know that the JDBC API provides three types of Statements for wrapping an SQL query and sending it for execution to the database, they are aptly named as Statement, PreparedStatement, and CallableStatement. First, a Statement is used to execute normal SQL queries like select count(*) from Courses. You can also use it to execute DDL, DML, and DCL SQL statements. 

Can you make a class static in Java? Example

This is one of the tricky questions in Java because there is no straightforward. Yes and No answer here. You cannot make a top-level class static in Java, but Yes, you can make a nested class static in Java. In fact, it is even advised (see Effective Java) to prefer a nested static class in Java to normal inner classes. Now, the question comes what is a top-level class, and what is a nested class in Java? Well, you can declare multiple classes in a single Java source file. A class is said to be the top-level if it is not inside any other class, and a class that is inside another class is known as a nested class. You can create a nested class inside another top-level or another nested class in Java. This is the class that can be static in Java.

Difference between Fixed and Cached Thread pool in Java Executor Famework

There are mainly two types of thread pools provided by Javas' Executor framework, one is fixed thread pool, which starts with fixed number of threads and other is cached thread pool which creates more threads if initial number of thread is not able to do the job. The newCachedThreadPool() method is used to create a cached pool, while newFixedThreadPool() is used to construct a thread of fixed size. Cached thread pool executes each task as soon as they are submitted, using an existing thread if its idle or creating new threads otherwise, while in case of fixed thread pool, if more tasks are submitted then idle threads then those task are put into a queue and later executed once any other task has finished.

Difference in Method Overloading, Overriding, Hiding, Shadowing and Obscuring in Java and Object-Oriented Programming?

Hello guys, today, I am going to explain a couple of fundamental object-oriented programming concepts in Java, like Overloading, Overriding, Hiding, Shadowing, and Obscuring. The first two are used in the context of a method in Java while the last three are used in the context of variables in Java. Two methods with the same name and same class but the different signature is known as overloading and the method is known as an overloaded method while a method with the same name and same signature but in parent and child class is known as overriding. On the other hand,  Hiding is related to overriding since the static and private method cannot be overridden, if you declare such methods with the same name and signature in parent and child class then the method in the child class will hide the method in the parent class.

Difference between HashMap vs TreeMap vs LinkedHashMap in Java

Hello guys, if you are wondering what is difference between HashMap, TreeMap and LinkedHashMap in Java and  when to use HashMap, TreeMap and LinkedHashMap in Java then you are at the right place. Earlier, I have shared difference between HashSet, TreeSet, and LinkedHashSet and in this article, I will explain the difference between these three common Map implementation HashMsp, TreeMap, and LinkedHashMap. Though all three classes like HashMap, LinkedHashMap and TreeMap are implementation of java.util.Map interface, there is some functionality difference between them. Perhaps most notable difference between them comes from their iteration order. HashMap makes absolute no guarantee about in which order you can iterate their keys, any application depending upon iteration order of HashMap is fragile, because it can change anytime. In fact, in Java 7, iteration order of HashMap is different than Java 6. 

Difference Between Iterator and Enumeration In Java

What is the difference between Iterator and Enumeration in Java is one of the oldest core Java Interview Questions. While I haven't seen this question for a long time, I still think its an important concept to know and remember for Java developers, especially those who are tasked to work in existing project which may be using Enumeration. The Iterator and Enumeration are two interfaces in Java and used for traversing in java collection we found these two interface in the java.util package .whenever we go for an interview if interviewer goes in collection topic he will often ask the difference between this two .so let's see one by one difference between this two and compare which is used when and which one is better.

Saturday, April 22, 2023

Top 5 Places to learn Cloud Computing Online for FREE in 2023 - Best of lot

Hello guys, if you want to learn Cloud computing online and looking for online resources like books, online courses and tutorials then you have come to the right place. Earlier, I have shared both best free Cloud Computing courses as well as best paid Cloud Computing courses and books and in this article, I am going to share best places and online platforms to learn Cloud Computing in 2023. Cloud computing has been a buzzword all through the IT world for last 10-15 years. Everyday, in different parts of the world, we see new companies and organizations getting into the cloud. All of this has created a huge interest in cloud computing with a host of jobs and career opportunities in the field. In this blog, we are going to take a look at what is Cloud computing, followed by a walk-through of few websites and courses which I have specifically chosen for this blog.

Difference between Proxy and Decorator Pattern in Java

Hello guys, if you have gone through a couple of Java Developer interview then you may seen this question about Proxy and Decorator Pattern in Java. Earlier, I have share 18 Design Pattern questions and today, I am going to answer this tricky design pattern questions from Java interviews. I was first asked about difference between Proxy and Design Pattern in Java a couple of years back when I was interviewing for Senior Java developer interview on a big investment Bank and I wasn't able to impress interviewer with my answer, so I decided to learn more and this article is the result of that research. Though both Proxy and Decorator pattern looks very similar to each other structurally, there are some key differences between them like what problem them solve and how they are used in Java application. 

Top 20 Docker Interview Questions Answers Java Developers and DevOps

Hello guys, if you are preparing for a Java developer interview, a DevOps engineer interview or any software developer interview, one tool which should pay most attention is Docker. It's a container tool which allows you to package and deploy your application in cloud. Docker has many benefits as it not only standardized packaging and deployment but works nicely with Kubernetes which takes the scalability and automatic restart of your application. These are just a couple of benefits but because of all these, Docker has become an essential tool for every programmer and developer and that's why they are also quite important for interviews. 

Top 30 Gradle Interview Questions Answers for Experienced Java Developers

Hello guys, if you are preparing for Java or Kotlin developer interview where Gradle skills are needed then you should prepare for Gradle related questions. I have seen many interviewer asking Maven and Gradle related questions during interviews and many Java developer don't prepare them. But, considering you are looking for Gradle questions I think you are one step ahead of them and If you are looking for Gradle interview questions then you have come to the right place. Earlier, I have shared Maven Interview Questions and in this article, I am going to share Gradle interview questions for Java and Kotlin developers. 

Top 24 Node.js Interview Questions with Answers for 1 to 2 Years Experienced Web Developers

Hello guys, if you are preparing for a JavaScript developer or web developer and looking for common Node.js questions to prepare for interviews then you are at right place. In the past, I have shared JavaScript interview questions, React Questions, Angular Questions and even web development questions and in this article, I am going to share frequently asked Node.js questions with answers for interviews.  Though Node.js is defined as a JavaScript environment, it is widely considered as a backend framework. Since its inception in 2008, Node.js has become a popular term in the server-side development community. More and more companies are using Node.js for backend development.

[Solved] How to find the Longest common prefix in Array of String in Java? Example Tutorial

Hello guys, If you are preparing for technical interviews and wondering how to solve the longest common prefix in a given array of String problems in Java then you have come to the right place. Earlier, I have shared 21 String programming problems and one of them was this one. In this article, I am going to show you how to solve this frequently asked coding problem from Java Interviews. It's one of the difficult coding problems and not every programmer I have interviewed has solved this, only a few can solve this so preparing for this one can definitely improve your chances and give you a competitive edge over other candidates.

How to check if a node exists in a binary tree or not in Java? Example Tutorial

Hello guys, if you are wondering how to check if a given node exists in a given binary tree or not then you have come to the right place. I have been sharing a lot of binary tree-based programming interview questions in the past few articles. Earlier, we have solved how to find the maximum sum level in a given binary tree, how to find the lowest common ancestor, and how to find Kth smallest element, and in his article, we will solve another classical binary tree problem of search nodes.  Bug, before finding if a node exists in a binary tree or not. It is good to understand what is a  binary tree and binary search tree and how to solve a binary tree-based coding problem. 

10 Tools Every Software Engineer Should Learn In 2023

Hello guys, as a software engineer, staying up-to-date with the latest tools and technologies is essential to your success and one way to keep yourself up-to-date is to learn new framework, libraries and tools. Earlier, I have shared 5 Java Frameworks to learn in 2023 and in this article, we will introduce you to 10 tools that every software engineer should learn in 2023. The list includes, both essential and advanced tools from Git and Docker to TypeScript and GraphQL, which you will need in your day to day development, particularly on web development. 

10 examples of crontab commands in Linux

Hello guys, if you are working in Linux or UNIX environment and scheduled any job or script to run at a particular time at everyday like a script to archive log files at midnight or a script to restart your app on Monday morning then you must have come across crontab command in Linux. While there are many solution to schedule jobs in enterprise application like Control M from Bmc Software and AutoSys but the crontab command provides the easiest way to schedule any script in Linux, as you don't need any third party software for scheduling. It's also quite popular, so much so that all the jobs scheduled by crontab is called cron jobs, and that's why I think every developer should know about crontab command and how to use it. 

Top 20 Ethical Hacking Interview Questions and Answers

Hello guys, if you are preparing for Ethical hacker job interview or want to become a Cyber Security expert and looking for common Ethical hacking interview questions then you have come to the right place. Earlier, I have shared Cyber Security Interview Questions and in this article, I am going to share popular Ethical Hacking Interview Questions with answers. If you have worked in the field of Ethical Hacking and Cyber Security then most likely you can answer all of these questions but if you struggle to answer any of these questions then you can always go back and join any of these best Ethical Hacking online courses to learn and revise key concepts, tooling, and techniques. 

Top 15 Machine Learning Interview Questions with Answers for 1 to 2 years Experienced

Hello guys, if you are preparing for Machine Learning interviews and looking for frequently asked Machine Learning interview questions then you have come to the right place. Earlier, I have shared the Data Science Interview Questionsbest Machine learning courses, and  essential ML algorithms and In this article, I am going to share common Machine Learning questions from interviews. To be honest, Machine Learning interview is not easy to crack, there can be different types of questions on Machine Learning interviews from key machine learning concepts like training the model to ask different types of machine learning algorithms. 

Top 10 C++ Interview Questions with Answers for 1 to 2 years Experienced

Today, for a change I am not sharing any Java interview questions, but I am sharing a few C++ interview questions. There is a good demand for developers who know both Java and C++, particularly in the investment banking domain, as a lot of high-performance applications like client connectivity, exchange connectivity, and order management systems (OMS) are written in C++. If you know both Java and C++ then you have a great chance to get a job in big investment banks like Barclays, Nomura, Deutsche Bank, and other Wall Street Firms.

Top 50 Microsoft Software Development Engineer Interview Questions

Hello guys, if you are preparing for Microsoft Software Development Engineer interview or in general preparing for FAANG coding interviews and looking for common interview questions for practice then you have come to the right place. Earlier, I have shared best Coding interview courses and books and in this article, I am going to share you some of the frequently asked questions from Microsoft. Most of the things depending upon for which position you are going like technical analyst, software engineer, Java developer, web developer or internship. If you have a computer science degree and if your job involves coding then you can expect following questions, which are mainly collected from engineers who has appeared on on and off campus interviews.

Friday, April 21, 2023

Difference between child and descendent selectors in jQuery in CSS?

Main difference between descendant and child selector in jQuery or CSS is that descendant selector selects all dom elements whether they are its direct children or not, on the other hand child selector only select direct childrens. Its very easy to understand if you know meaning of descendant and child. For example, my daughter is both my child and descendant but my granddaughter is not my child but descendant. Same definition work in both CSS and jQuery world Since jQUery got his selector from CSS itself, any difference between descendant and child selector which is valid for CSS is also valid for jQuery, unless otherwise stated. Now, lets understand this in terms of DOM elements

Top 12 Java NIO Interview Questions Answers for 5 to 10 Years Experienced Programmers

Hello guys, I have been sharing a lot of Java interview question in this blog and so far I have shared Java interview questions on Core Java, Collections, Java 8, Multithreading, design patterns, Garbage Collections, Spring Framework, Hibernate, SQL and many other topics, but I haven't share many questions on Java NIO, one of the most underrated topic for Java Interviews. Java NIO is very important not just for interviews but also for writing high-performance server side Java application. It is newer and better addition of Java IO and introduced for better performance reason. 

Top 20 Access Modifier Interview Questions Answers for 2 to 3 Years Experienced Java Developers

Access modifiers is one of the essential concept in Java and every programmer should be familiar with, and because of its importance, its also a popular topic in Java interviews. Access modifier can be applied to class, method, fields, and variables and as the name suggests they control the access. Like who can access that particular class, method or variable. For example, public modifier provides universal access which means any public class, method or variable is accessible by everyone and everywhere. In other words, you can access a public class both within the package and outside the package. 

Top 30 Advanced Java Interview Questions for Experienced Developers

Hello guys, I have shared a lot of questions from Java Interviews in this article, so much so that many of my reader search Javarevisited for any Java interview question they come across. While In the past, I have shared Java concurrency questions, Java collections questions, Java questions on design patterns, and many tricky Java questions but a lot of people asked me to share more practical questions for experienced Java developers. Means, more advanced Java questions for 5 to 7 and even 10 years of experienced Java developers. 

Top 20 Apache Spark Interview Questions and Answers

As a Big Data specialist, it's critical that you understand all of the words and technologies associated with the area, including Apache Spark, which is one of the most prominent and in-demand Big Data technologies. With the IT industry’s increasing need to calculate big data at high speeds, it’s no wonder that the Apache Spark mechanism has earned the industry’s trust. Apache Spark is one of the most common, general-purpose, and cluster-computing frameworks. There are many common interview questions which is related to apache sparks. Let's have a look at each of them with explanations. 

Top 20 Oracle Database Interview Questions with Answers for 3 to 5 Years Experienced

Hello guys, if you are a developer or a database administrator and preparing for Oracle database interview and need common Oracle database questions for 1 to 5 years experienced then you have come to the right place. Earlier, I have shared tricky SQL query interview questions as well as popular database interview questions and in this article, I am going to share popular Oracle interview questions with answers. If you have used Oracle database for a couple of years or worked as Oracle database administrator then most likely you will know answers of all these questions but if you struggle to answer them then you can always go back and checkout these best Oracle database online courses to learn and revise key Oracle database concepts. 

Top 21 Python Interview Questions Answers for 1 to 2 Years Experienced Programmers

Hello guys, if you are new to programming world, looking for your first Job in software development, particularly for Python developer, and looking for frequently asked Python interview questions then you have come at the right place. Earlier, I have shared best Python courses, books, Python projects, best place to learn Python and many interview questions on Data Structure, System Design, OOP Programming, and Recursion, which are essential topic for any programming interviews, including Python Developers and Engineers and in this article, I am going to share Python questions. These are the questions about Python programming language, Python tools, and Python eco-system in general.

Top 21 Groovy Interview Questions with Answers for Java developers in 2023

Hello guys, if you are preparing for Groovy Developer interview or a Java Developer interview where Groovy is mentioned as required skill then you should prepare for it. If you are looking for common Groovy Interview questions and their answers then you have come to the right place. Earlier, I have shared best Groovy books and online courses to learn Groovy and in this article article, I am going to share frequently asked Groovy Interview Questions with answers.  These Groovy questions covers essential features of Groovy programming language and suitable for both beginners and programmers with 1 to 3 years of experience. 

Top 20 PL/SQL Interview Questions with Answers in 2023

Hello guys, if you are preparing for Oracle or PL/SQL Job or a Developer job where PL/SQL skills are needed and looking for frequently asked PL/SQL Interview Questions then you have come to the right place. Earlier, I have shared both best PL/SQL courses and best PL/SQL books and in this article, I am going to share popular PL/SQL Interview Questions you can revise before your interview. Preparing for PL/SQL Interview is not a rocket science and you can prepare for it the same way you prepare for other interviews. 

Top 20 DevOps Interview Questions with Answers for Experienced Developers in 2023

Hello guys, if you are preparing for DevOps Engineer job interview or a Developer interview then preparing DevOps questions is quite important. I have seen a couple of DevOps related questions on Java developer interview in last a couple of years. Interviewers are now expecting you to become familiar with Cloud, DevOps and essential DevOps tools like Docker, Kubernetes, Ansible, Terraform tec. If you have been moving around looking for a way which will help you pass your DevOps interview that is around the corner, you have come to the right place at the right time. 

Top 18 CSS Interview Questions and Answers for 1 to 2 years experienced

Hello guys, if you are preparing for web developer interview then you must prepare for CSS Interview questions. CSS is one of the three core technologies of the World Wide Web(WWW). A website is incomplete without CSS. The first feature of a website noted by the visitors is its presentation. It does not matter how excellent the behind-the-scenes of a website are, if the client-side view is not appealing, the website is almost a failure. Thus, CSS is as important as JavaScript

Top 21 Git Interview Questions and Answers for Programmers and DevOps in 2023

Hello guys, if you are preparing for Software developer interview then you should prepare for Git, one of the essential and most popular version control and source control tool in Software industry. Almost every company, both big and small are now using Git to store their source code and conduct code reviews, yes the code review is one of the main reason many organization shifted to Git. Both Github and BitBucket provides in-built code review features which also promote good software development practices. 

Top 20 Golang Interview Questions with Answers

Hello guys, if you are preparing for Golang Developer Job interview and looking for frequently asked Golang Interview questions then you have come to the right place. Golang is one of the modern and in-demand programming language from Google and more and more companies have started using Golang for their flagship project like ByteDance is using Golang for TikTok and their other projects. In the past, I have shared best Golang courses  as well as free Golang courses and in this article, I am going to share 20 common Golang Interview Questions with Answers. These questions covers essential Golang concepts which every Golang developer should be familiar with.

Thursday, April 20, 2023

Top 20 Hadoop Interview Questions and Answers for Java Developers

With the increasing demand for big data processing and analysis, Hadoop has become one of the most sought-after skills in the IT industry. And what better way to showcase your knowledge and skills than by acing a Hadoop interview? But before you jump into the deep end, let's brush up on the basics. In this article, we've compiled a list of the top 20 Hadoop interview questions with answers. This will not only help you prepare for your interview but also give you a good understanding of the Hadoop ecosystem. So, put on your game face, get ready to have some fun, and let's get started!

5 Difference between Iterator and ListIterator in Java?

The Iterator is the standard way to traverse a collection in Java. You can use Iterator to traverse a List, Set, Map, Stack, Queue, or any Collection, but you might not know that there is another way to traverse over List in Java? Yes, it's called the ListIterator. There are many differences between Iterator and ListIterator in Java, but the most significant of them is that Iterator only allows you to traverse in one direction, I mean forward, you have just got a next() method to get the next element, there is no previous() method to get the previous element. 

HelloWorld Program in Java with Example

First of all, welcome to the exciting world of Java programming. If you are ready to write your first Java program i.e. HelloWorld in Java, it means you already crossed major hurdles to start Java programming, in terms of installing JDK and setting PATH for Java. If you haven't done so then you can follow those tutorials to install JDK in Windows 7 and 8 and setting PATH for Java. Before we start writing HelloWorld in Java, few notes about editors. Many Java beginners insist or try to use Eclipse or Netbeans IDE from the very start of the first program, which is not a good idea. 

Difference between GenericServlet vs HttpServlet in Servlet JSP - J2EE question

Difference between GenericServlet and HttpServlet is one of the classic Servlet Interview Question, asked on many Servlet and JSP Interviews on 2 to 4 years experience developers. Since both GenericServlet and HttpServlet form the basis of Servlets its important to know What are they and What is main difference between them. From common sense and there names, its obvious that GenericServlet is a generic and protocol-independent implementation of Servlet interface while HttpServlet implements HTTP protocol specifics. If you are working in Java web application or J2EE projects, you are most likely to deal with HttpServlet all time as HTTP is main communication protocol of web. In this Servlet JSP article we will outline some important difference between HttpServlet and GenericServlet which is worth knowing and remembering.

How to iterate over HashSet in Java - loop or traverse Example

Iterating over HashSet in Java
Java program to Iterate over HashSet in Java with ExampleIn our last Java collection tutorial, we have seen How to iterate over ArrayList in Java and in this tutorial we will see How to iterate over HashSet in Java. There are two ways to iterate, loop or traverse over HashSet in Java, first using advanced for-each loop added on Java 5 and second using Iterator which is a more conventional way of iterating over HashSet in Java. Now questions are When should you use for loop and when Iterator is an appropriate option. Well I usually use for loop If I only read from HashSet and doesn't remove any element, while Iterator is preferred approach. You should not remove elements from HashSet while iterating over it in for loop, Use Iterator to do that.

How to Fix java.lang.VerifyError: Expecting a stack map frame at branch target 14 in method at offset JDK 7 [Solved]

Hello guys, today, we'll take a look at the not-so-common error for Java applications. If you have been working in Java for a couple of years then you might have seen this dreaded "java.lang.VerifyError: Expecting a stack map frame at branch target 14 in method at offset JDK 7" error in your application log or in Eclipse, particularly if you are running your Java application in Java 7. The main cause of this error, "java.lang.VerifyError: Expecting a stack map frame at branch target ... in the method ... at offset 0 error comes when you have some library, JAR file which is only compatible with Java 1.6 or below and you are running your program in JDK 1.7.

When to throw and catch Exception in Java? [Best Practice]

Exceptions are one of the confusing and misunderstood topics in Java, but at the same time, too big to ignore. In fact, good knowledge of Errors and Exception handling practices is one criterion, which differentiates a good Java developer from an average one. So what is confusing about Exception in Java? Well, many things like When to throw Exception or When to catch Exception, When to use checked exception or unchecked exception, should we catch errors like java.lang.OutOfMemoryError? Shall I use an error code instead of an Exception and a lot more? Well, I cannot answer all these questions in one post, so I will pick the first one when to catch or throw any Exception in Java.