Friday, December 13, 2024

[Solved] 3 Examples to reverse an Array in Java - Example Tutorial

Hello guys, today we are going to see another common coding question from interviews - how do you reverse an array in Java? This is a popular array-based coding problem and often asked programmers during the first few rounds of interviews to check if they can code or not. Well, there are multiple ways to solve this problem and we will see three common ways to ever an array in Java. This method applies to all kinds of arrays like string array or integer array or even with arrays of objects because it's not focused on data types. The first way to reverse an array is by reversing it in a brute force way, without using any additional data structure or library method. 

How to Find Even and Odd Number in Java - Program Tutorial Example

Even and Odd number check Java Example
There are many ways to find if a number is even or odd in Java but before moving into technical details on finding even and odd numbers in Java let's what is even and odd numbers in terms of Mathematics. Any number which is completely divisible by 2 is called an even number while a number that is not completely divisible by 2 is called an odd number. If you think in terms of remainder then in the case of even number, the remainder is zero while in the case of odd number remainder will be 1. zero is considered as an even number in maths. 

Wednesday, December 11, 2024

How to Find Missing Number in a Sorted Array in Java [Solved]

Today's coding problem is not very new, it's an age-old classic Programming interview Question. You have a sorted array containing n - 1 unique number starting from 0 to n - 1. There is only one number missing in this range and you need to find that out. I mean you need to write a Java method to find the missing number and print its value in the console. Some of you might have seen this question before, but if you have not been asked this question before, what is the first approach comes into your mind to solve this question? Since only one number is missing, many programmers come up with the approach of iterating over the array, and comparing each element with the expected one like the first element should be 0, the second element should be 1, and so on.

How to Count number of 1s (Set Bits) in a binary number in Java [Solved]

Good morning folks, In today's article, we are going to discuss one of the frequently asked bit manipulation-based interview questions, how do you count the number of set bits in a given bit sequence?  Bit Manipulation is an important topic in programming interviews and a good programmer should have sufficient knowledge and skill to work with binary numbers. This kind of question tests the skill of the programmer. Sometimes, it is also asked as to how to count the number of 1s (ones) in a given number? Both are the same question because 1 is also known as set bit.  For example, if the given input is 1000110010 then your program should return 4, as three are only four set bits in this bit sequence.

How to Print Pyramid Pattern in Java? Program Example

Pattern based exercises are a good way to learn nested loops in Java. There are many pattern based exercises and one of them is printing Pyramid structure as shown below:


* * 
* * * 
* * * * 
* * * * * 

You need to write a Java program to print the above pyramid pattern. How many levels the pyramid triangle would have will be decided by the user input. You can print this kind of pattern by using print() and println() method from System.out object. System.out.print() just prints the String or character you passed to it, without adding a new line, useful to print stars in the same line. 

Monday, December 9, 2024

Top 20 Machine Learning Libraries for AI Engineers in 2025 - Best of Lot

 Artificial Intelligence (AI) has emerged as a transformative technology, revolutionizing various industries and driving innovation. With the increasing accessibility of AI, numerous free tools have become available, enabling individuals and businesses to explore and leverage AI capabilities. In this article, we present the top 20 free Machine Learning libraries to try in 2025. These tools cover a wide range of AI applications, including machine learning, natural language processing, computer vision, and more. Let's dive into the exciting world of AI tools and discover how they can empower innovation and automation.

Sunday, December 8, 2024

How to call REST API an send HTTP GET and POST Request using cURL command in Linux? Example Tutorial

The curl or cURL command of Linux is a compelling and versatile command which allows you to send sophisticated HTTP requests right from your Linux command line window. You can use the cURL command to test your RESTful Web Services by sending GET and POST requests, doing authentication, saving a cookie in the file, etc. The curl command is, in fact, the go-to tool for many Java and Spring developers working in web applications and consuming data from the secured RESTful Web Services. Still, you can also use it to test your simple REST Web APIs without security. I have used it many times to check if our Web service is up or not, or is there any error while accessing those services.

Thursday, October 31, 2024

How to Create Config Server in Microservices Architecture with Spring Cloud Config Server

The ability of microservices architecture to deconstruct big monolithic programmes into smaller, independent, and controllable services has led to its enormous growth in popularity in recent years. It can be difficult to manage configuration across numerous microservices, though, as each service may call for a separate set of configurations. To solve this problem, configurations for microservices are centralised and managed by a separate Config Server. In this post, we'll examine what a Config Server is, why it's crucial for microservices, and how to use Spring Cloud Config Server to construct it.

Tuesday, October 29, 2024

Top 10 AI Tools for Bloggers and Writers in 2025

 Artificial Intelligence (AI) has revolutionized various industries, and the field of writing and blogging is no exception. AI-powered tools for bloggers and writers have emerged, offering innovative solutions to enhance creativity, streamline workflows, and improve content quality. In this article, we present the top 10 AI tools specifically designed for bloggers and writers. These tools leverage AI technologies such as natural language processing, machine learning, and data analytics to help writers generate ideas, improve grammar, enhance productivity, and optimize content for better engagement. Let's explore these cutting-edge AI tools and discover how they can empower bloggers and writers.

Monday, October 28, 2024

What is Payload in REST API? How to send Payload using HTTP Post Request and HttpClient

Hello and welcome to the blog post. In this comprehensive article we are going to take a look at an interesting topic. I’m sure you all are familiar with client-server architecture. If not let me recap it quickly for you. 

A Client is a machine (or a web-browser) that request for desired results from the  server. In other words, clients initiate requests for services or resources, while servers provide those services or resources upon request. The client-server model forms the foundation of many networked applications and systems, where clients and servers communicate and collaborate to fulfill various tasks and deliver services.

What is a Payload?

When a client sends a request to a server, the payload typically contains the data or parameters required by the server to process the request. For example, in a client-server architecture for a web application, the payload of an HTTP request sent by the client may include parameters for a form submission, JSON data for an API request, or a file to be uploaded.

On the server side, when the server sends a response back to the client, the payload contains the data or information requested by the client. This can include HTML content, JSON responses, file attachments, or any other data relevant to the specific request made by the client.

Payload in REST API

The information supplied in the body of an HTTP request is referred to as a payload in the RESTful API architecture. It represents the data that is being sent from the client to the server or the other way around. Depending on the content type supplied in the request headers, the payload may be in one of several forms, including JSON, XML, or plain text.

The payload carries the necessary data required to perform operations on the server or to retrieve specific resources. For example, when creating a new resource, the payload would typically contain the data that needs to be stored on the server. When updating an existing resource, the payload would include the modified data.

What is an HttpClient? 

HttpClient is a powerful Java package that offers quick and efficient way for submitting HTTP requests and receiving server responses. Starting with Java 11, it is a part of the Java SE standard library and offers a comprehensive API for interacting with HTTP-based services.

HttpClient's main objective is to make it easier for client applications to communicate with RESTful APIs, web services, and other HTTP-based endpoints. The low-level aspects of creating and managing connections, dealing with request and response bodies, modifying headers, controlling timeouts, and dealing with redirection are abstracted away.

You can perform various HTTP operations like GET, POST, PUT, DELETE by using HttpClient. It supports both synchronous and asynchronous request processing and offers a number of configuration options for customization.

Let’s take an example on how to send a POST request to REST API using HttpClient

import com.fasterxml.jackson.databind.ObjectMapper;

import java.net.URI;

import java.net.http.HttpClient;

import java.net.http.HttpRequest;

import java.net.http.HttpResponse;

import java.net.http.HttpHeaders;

import java.net.http.HttpResponse.BodyHandlers;


public class HttpClientExample {

    public static void main(String[] args) throws Exception {

        // Create an instance of HttpClient

        HttpClient httpClient = HttpClient.newHttpClient();


        // Define the URL of the REST API endpoint

        String url = "http://api.example.com/users";


        // Create a User object

        User user = new User("John Doe", 30);


        // Serialize the User object to JSON

        ObjectMapper objectMapper = new ObjectMapper();

        String requestBody = objectMapper.writeValueAsString(user);


        // Build the HTTP request

        HttpRequest request = HttpRequest.newBuilder()

                .uri(URI.create(url))

                .header("Content-Type", "application/json")

                .POST(HttpRequest.BodyPublishers.ofString(requestBody))

                .build();


        // Send the request and receive the response

        HttpResponse<String> response = httpClient.send(request, BodyHandlers.ofString());


        // Extract the User object from the response

        String responseBody = response.body();

        User responseUser = objectMapper.readValue(responseBody, User.class);


        // Print the response User object

        System.out.println("Response User: " + responseUser);

    }

}


class User {

    private String name;

    private int age;


    // Constructors, getters, and setters


    @Override

    public String toString() {

        return "User{" +

                "name='" + name + '\'' +

                ", age=" + age +

                '}';

    }

}


In this example, we have a User class representing the user object. We use the ObjectMapper from the Jackson library to serialize the User object to JSON format. 

We then create an HttpRequest object with the necessary details, including the URI, headers (in this case, "Content-Type" is set to "application/json"), and the request body containing the serialized User object. 

After sending the request using httpClient.send(), we receive the response as an HttpResponse object. We extract the response body as a JSON string. 

Finally, we deserialize the response JSON string back into a User object using objectMapper.readValue(). The resulting User object represents the response payload, which we can use as needed.


Sending Payload to REST API using HTTP POST Request and HttpClient in Java

import java.net.URI;

import java.net.http.HttpClient;

import java.net.http.HttpRequest;

import java.net.http.HttpResponse;

import java.net.http.HttpHeaders;

import java.net.http.HttpEntity;

import java.net.http.HttpHeaders;

import java.net.http.HttpRequest.BodyPublishers;

import java.net.http.HttpResponse.BodyHandlers;


public class HttpClientExample {

    public static void main(String[] args) throws Exception {

        HttpClient httpClient = HttpClient.newHttpClient();


        String jsonPayload = "{\"name\": \"Someone \", \"email\": \"someone@example.com\"}";


        HttpRequest request = HttpRequest.newBuilder()

                .uri(URI.create("http://example.com/api/resource"))

                .header("Content-Type", "application/json")

                .POST(BodyPublishers.ofString(jsonPayload))

                .build();


        HttpResponse<String> response = httpClient.send(request, BodyHandlers.ofString());


        int statusCode = response.statusCode();

        String responseBody = response.body();


        System.out.println("Status Code: " + statusCode);

        System.out.println("Response Body: " + responseBody);

    }

}


In the example above, we create a JSON payload using a sample data object. We set the HTTP method to POST, the request URL to "http://example.com/api/resource", and the content type to "application/json". The payload is then sent in the body of the request using the BodyPublishers.ofString() method. 

Finally, we retrieve and handle the response from the server.

Remember to replace "http://example.com/api/resource" with the actual endpoint URL of the REST API you want to send the payload to, and modify the payload data according to your requirements and the API's expected format.

Let me show you how to send other types of payloads from the following example.


1) Sending a Form-UrlEncoded Payload


import java.net.URI;

import java.net.http.HttpClient;

import java.net.http.HttpRequest;

import java.net.http.HttpResponse;

import java.net.http.HttpHeaders;

import java.net.http.HttpEntity;

import java.net.http.HttpHeaders;

import java.net.http.HttpRequest.BodyPublishers;

import java.net.http.HttpResponse.BodyHandlers;

import java.net.URLEncoder;

import java.nio.charset.StandardCharsets;


public class HttpClientExample {

    public static void main(String[] args) throws Exception {

        HttpClient httpClient = HttpClient.newHttpClient();


        String payload = "name=" + URLEncoder.encode("John Doe", StandardCharsets.UTF_8)

                + "&email=" + URLEncoder.encode("johndoe@example.com", StandardCharsets.UTF_8);


        HttpRequest request = HttpRequest.newBuilder()

                .uri(URI.create("http://example.com/api/resource"))

                .header("Content-Type", "application/x-www-form-urlencoded")

                .POST(BodyPublishers.ofString(payload))

                .build();


        HttpResponse<String> response = httpClient.send(request, BodyHandlers.ofString());


        int statusCode = response.statusCode();

        String responseBody = response.body();


        System.out.println("Status Code: " + statusCode);

        System.out.println("Response Body: " + responseBody);

    }

}


In this example, we are sending a form-urlencoded payload to the REST API endpoint "http://example.com/api/resource". The payload contains two fields, name and email, which are URL-encoded using the URLEncoder.encode() method. The Content-Type header is set to "application/x-www-form-urlencoded".



2) Sending a Plain Text Payload


import java.net.URI;

import java.net.http.HttpClient;

import java.net.http.HttpRequest;

import java.net.http.HttpResponse;

import java.net.http.HttpHeaders;

import java.net.http.HttpEntity;

import java.net.http.HttpHeaders;

import java.net.http.HttpRequest.BodyPublishers;

import java.net.http.HttpResponse.BodyHandlers;


public class HttpClientExample {

    public static void main(String[] args) throws Exception {

        HttpClient httpClient = HttpClient.newHttpClient();


        String textPayload = "This is a plain text payload.";


        HttpRequest request = HttpRequest.newBuilder()

                .uri(URI.create("http://example.com/api/resource"))

                .header("Content-Type", "text/plain")

                .POST(BodyPublishers.ofString(textPayload))

                .build();


        HttpResponse<String> response = httpClient.send(request, BodyHandlers.ofString());


        int statusCode = response.statusCode();

        String responseBody = response.body();


        System.out.println("Status Code: " + statusCode);

        System.out.println("Response Body: " + responseBody);

    }

}


In this example, we are sending a plain text payload to the REST API endpoint "http://example.com/api/resource". The payload simply contains the text "This is a plain text payload." The Content-Type header is set to "text/plain" to indicate that the payload is in plain text format.



Summary 

In summary, sending a payload to a REST API using an HTTP POST request and HttpClient in Java involves creating an HTTP request with the desired payload, specifying the necessary headers, and sending the request using the HttpClient instance. The server will process the payload and provide a response, which can be accessed and utilized accordingly.


Sunday, October 27, 2024

20 Examples of Git Commands in Linux and Windows

Version control is crucial in software development, and Git stands out as a powerful tool for managing source code. Whether you're working in a Linux or Windows environment, understanding Git commands is essential. This article explores 20 fundamental Git commands, demonstrating their application and significance. From initializing a repository to handling branches and commits, each command plays a pivotal role in maintaining a well-organized and collaborative development workflow. Whether you're a seasoned developer or a newcomer, mastering these Git commands will enhance your ability to track changes, collaborate seamlessly, and contribute effectively to software projects.

Friday, October 25, 2024

Is Frontend Master Worth It?

Frontend development has been growing rapidly in the last few years, as web applications have become more complex and interactive. Frontend Master is an online platform that provides courses and tutorials to learn front-end development. However, with so many resources available on the internet, it's difficult to know whether Frontend Master is worth investing your time and money. In this article, we'll take a closer look at what Frontend Master has to offer and whether it's worth the investment.

Saturday, October 19, 2024

Top 10 Programming Languages to Learn in 2025 [UPDATED]

Hello guys, we're just one week away from 2025. This is when most of us start making our goals like physical goals, educational goals, and financial goals. As a programmer, one of our goals is to learn new technologies and programming languages, but which languages should you learn? Since acquiring a programming language requires both time and patience, you should learn a language worth the effort; I mean., it can reward you with a better job and career growth. In this article, I will share with you the top 10 programming languages you can learn in 2025 to get a job in your favorite companies like Google, Microsoft, and Facebook.

Monday, October 14, 2024

5 Best DP-900 Certification Courses and Practice Test for Azure Data Fundamentals Exam in 2025

The DP-900 certification, also known as the Microsoft Azure Data Fundamentals Certification, is perfect for people who are just starting to work with data on the cloud. This certification will help you build foundational knowledge in cloud data services with Microsoft Azure. Taking the DP-900 certification exam will have many benefits. It will give you a broad overview of how data works in the cloud. It will also help you test your knowledge of cloud data within the ambit of Microsoft Azure services.

Wednesday, October 9, 2024

10 Tools Java Developers Should Learn in 2024 - (UPDATED)

Hello folks, we are in the first week of 2024, and many programmers have already started making a good process to their goals for 2024, which is very good, but if you are someone, who is still not sure what to learn in 2024, then you have come to the right place. In the past, I have shared 10 things Java developers to learn in 2024, and last week, I published the top 5 Java Frameworks to learn, but there is one topic that kept coming from my readers.  The question which I have received this week a couple of times from my fellow Java developers and readers is which tools Java programmers should learn in 2024? Or what are some excellent Java tools used in application development? And finally, what should I learn in 2024?

Wednesday, October 2, 2024

7 Free 1Z0-803 and 1Z0-804 Sample Questions - OCAJP 7 and OCPJP 7 Mock Exams (Oracle Certified Associate Java SE 7 Programmer 1 and 2 )

In this article, I am going to share some OCAJP 7 or 1Z0-803 exam and OCPJP 7 or 1Z0-804 certification sample questions and mock exam for practice which are completely free and available online. The sample questions are not good enough for thorough practice but you can use these mock tests to get an idea of what to expect in the actual exam. Many of the free mock questions are actually the samples questions provided by professional certification exam simulator provided e.g. Whizlabs, Enthuware, MyExamCloud etc, which are samples of their full-length exam simulators. 

Top 5 OCPJP7 books for 1Z0-804 and 1Z0-805 Exam - Java SE 7 II Certification

You may know that from Java SE 7 onwards, you need to pass two exams to become a certified Java developer e.g. OCAJP and OCPJP. The first one is an associate-level exam and it's rather easy to pass, but the second one OCPJP is a professional level exam and it's much harder than OCAJP. If you are giving the Oracle Java certification then you should know that you need to pass OCAJP before taking the OCPJP exam. This is also the second part of an article about books to prepare Java SE 7 certifications. In the first part, I have shared the best books for OCAJP7 and in this part, I am going to share the best books for the OCPJP7 exam.

Monday, September 30, 2024

When to use PUT or POST in a RESTful API and Web Service? Answer

Hello guys, if you are confused about whether to use PUT or POST for updating a resource using RESTful web service then you have come to the right place. In the past, I have shared the best RESTful web service books and courses and today, I am going to share some tips to choose between PUT and POST while designing your RESTful web services. Btw, you are not alone, one of the most common confusion among web developers is the choice of PUT or POST HTTP method for creating and updating a resource while developing RESTful Web Services. Since both can be used to submit data, you can use either POST or PUT to create or update a resource.
 

Thursday, September 19, 2024

Review - Is IT Fundamentals for Cybersecurity Specialization on Coursera Worth it?

Learning the information technology (IT) fundamentals in general and cyber security is a good investment in yourself since there is a massive demand for these skills. Companies need people to secure their infrastructure, such as their servers where they host the website and user's data, monitor their network for unauthorized access, and scan the employee computers for any trojan and viruses that could give hackers control over your system.

Tuesday, September 17, 2024

What is Backend for front-end Pattern? How to use it?

  In the realm of microservices architecture, designing efficient communication between front-end applications and the back-end services is crucial. The Backend for Front-End (BFF) pattern has emerged as a useful architectural pattern to streamline this communication. In this article, we will delve into what the Backend for Front-End pattern is, its benefits, and how to effectively implement and utilize it in your microservices ecosystem.

What is Backend for front-end Pattern? How to use it?

The Backend for Front-End pattern, also known as BFF, is an architectural pattern that involves creating a specialized backend service for a specific front-end application or client. The purpose of this pattern is to decouple the front-end from the complexities and intricacies of the backend services, providing tailored APIs that align with the needs of the front-end.

By employing the BFF pattern, you create an intermediary layer that acts as a bridge between the front-end and the various backend services. This allows for improved flexibility, enhanced user experience, and optimized performance.

How to Use the Backend for Front-End Pattern


Identify the Front-End Application

Start by identifying the front-end application or client that will benefit from the BFF pattern. It can be a web application, mobile application, or any other consumer of the backend services.




Understand the Front-End Requirements

Work closely with the front-end development team to understand the specific requirements of the application. This includes the data and functionality needed, performance considerations, and any other factors that may impact the user experience.


Design the Backend for Front-End Service

Based on the front-end requirements, design a specialized backend service that acts as the BFF for the front-end application. This service will serve as an intermediary between the front-end and the backend services, encapsulating the necessary logic and communication.

Define Tailored APIs

The BFF service should expose a set of tailored APIs that are optimized for the front-end application's needs. These APIs should provide the required data in an efficient and convenient format, minimizing unnecessary round trips and reducing data transfer.

Aggregate Data and Handle Complexity

The BFF service should handle the complexity of interacting with multiple backend services. It can aggregate data from different services, orchestrate workflows, and transform or filter the data to meet the front-end's specific requirements. This helps in reducing the complexity and network overhead on the front-end side.

Optimize Performance

One of the key benefits of the BFF pattern is the ability to optimize performance. The BFF service can leverage caching mechanisms, pre-fetching of data, or implementing tailored data retrieval strategies to enhance response times and improve the overall user experience.



Maintain Separation of Concerns

While the BFF service acts as an intermediary between the front-end and the backend services, it's important to maintain separation of concerns. The BFF should not contain business logic or data manipulation that belongs to the backend services. Instead, it should focus on providing the necessary data and functionality required by the front-end.

Handle Security and Authorization

Ensure that the BFF service implements proper security measures to protect sensitive data and enforce appropriate authorization rules. This may involve authentication mechanisms, token-based access control, or integration with a central authentication service.

Evolve and Scale

As the front-end application evolves, the BFF service should also adapt accordingly. Monitor the usage patterns, performance metrics, and user feedback to continuously enhance and optimize the BFF service. Additionally, ensure that the BFF service is designed to be scalable and can handle increased traffic and load as the application grows.



Benefits of the Backend for Front-End Pattern


Improved Front-End Development Experience: The BFF pattern allows front-end developers to work with a specialized backend service that caters specifically to their needs. This results in a more streamlined development process, as the front-end team can focus on building the user interface without being hindered by backend complexities.

Enhanced Performance: By tailoring APIs and optimizing data retrieval and caching strategies, the BFF service can significantly improve the performance of the front-end application. This reduces latency, minimizes unnecessary data transfer, and provides a more responsive user experience.

Flexibility and Adaptability: The BFF pattern promotes flexibility by enabling the front-end application to evolve independently from the backend services. As requirements change or new features are introduced, the BFF service can be updated accordingly without impacting the existing backend services.

Simplified Backend Integration: The BFF service acts as a single point of integration for the front-end application, abstracting away the complexities of multiple backend services. This simplifies the integration process and reduces the coordination efforts required between the front-end and backend teams.

Security and Authorization Control: The BFF service can handle security concerns and enforce authorization rules specific to the front-end application. This allows for a centralized approach to security, ensuring that the appropriate authentication and authorization mechanisms are applied consistently.

Considerations for Using the Backend for Front-End Pattern


Increased Complexity: Implementing the BFF pattern introduces an additional layer of complexity to the overall architecture. It requires careful design and coordination between the front-end and backend teams to ensure smooth communication and maintain separation of concerns.

Potential Performance Bottlenecks: While the BFF pattern can improve performance, improper implementation or inadequate scalability measures can introduce performance bottlenecks. It is important to monitor and optimize the BFF service to ensure it can handle the expected load and traffic.

Maintenance and Versioning: As the front-end application evolves, the BFF service may require updates and maintenance. It is crucial to manage versioning and compatibility between the front-end and BFF service to prevent disruptions and ensure seamless upgrades.




Overlapping Functionality: Care must be taken to avoid duplicating functionality between the BFF service and backend services. It is essential to clearly define the responsibilities and boundaries of each component to avoid unnecessary redundancy or inconsistency.

Conclusion


The Backend for Front-End pattern provides a powerful approach to improving the interaction between front-end applications and backend services in a microservices architecture. By creating a specialized backend service tailored to the needs of the front-end, the BFF pattern enhances performance, simplifies integration, and promotes flexibility.

When implementing the BFF pattern, it is important to consider the specific requirements of the front-end application, design tailored APIs, optimize performance, and handle security and authorization effectively. By maintaining separation of concerns and continuously monitoring and optimizing the BFF service, you can create a robust and scalable architecture that enhances the development experience and delivers a seamless user experience.

Utilize the Backend for Front-End pattern as a valuable tool in your microservices ecosystem to bridge the gap between front-end applications and backend services, providing a streamlined and optimized communication channel.

Review - Is IBM Data Analytics with Excel and R Professional Certificate Worth it?

Companies are always collecting data about their customer’s behavior on their platform or maybe their products review and many other standards to make better decisions to improve their services and the user experience. Still, this data needs someone who can leverage the power of the data to make decisions, which is the role of data analysts. This career is one of the hottest in this century. Analyzing the data to get insight and better understand your users and customer will help you make your business successful or maybe have a good position in a company. 

Monday, September 16, 2024

Review - Is Data Science Fundamentals with Python and SQL Specialization on Coursera Worth It?

The demand for people who can analyze big data and extract meaningful information to drive decisions for companies is increasing every day. They need them to improve the quality of their services and deliver the best user experience for their customers. These actions are the responsibility and the role of the data scientists. Data scientists need to know many skills to perform the data analysis and make decisions such as the skills to collect data from different sources like the web and also extract and filter the data from the databases and clean them before performing analysis and even learn machine learning and deep learning to perform much more complex actions and make predictions but not all the data scientists know the artificial intelligence and not a mandatory skills. Still, it will be good if you have that in your belt.

Saturday, September 7, 2024

How to Print Prime Numbers from 1 to 100 in Java [Solved]

Hello guys, today, I'll share with you a simple problem of writing a Java program to print prime numbers up to a given number like saying prime numbers from 1 to 100. It's one of the most common coding exercises for programmers learning in Java, as it gives you an opportunity to learn more about the essential operators in Java Programming. The key here is that you cannot use a library function which can simplify your job, you need to devise the algorithm for checking prime number by yourself. One of the most popular algorithms for generating prime is Sieve of Eratosthenes,  which we have discussed earlier, but in this post, we will take a simpler approach.

Friday, September 6, 2024

How to count a number of words in given String in Java? [Solved]

Can you write a method in Java that accepts a String argument and returns a number of words in it? A word is a sequence of one or more non-space characters i.e. any character other than '' (empty String). This should be your method signature:

public int count(String word);

This method should return 1 if the input is "Java" and return 3 if the input is "Java, C++, Python". Similarly a call to wordCount("    ") should return 0. 

Wednesday, September 4, 2024

3 ways to Find Duplicate Elements in a given Array in Java [Solved]

Hello guys, if you are wondering how to find duplicates from a given array in Java then you have come to the right place. This is one of the most popular coding problems from interviews and there are multiple ways to solve this problem. In this article, I will show you three ways to solve this problem. First, you will learn how to solve the problem using brute force way and then you will see how you can optimize and simplify the solution by using additional memory and using an appropriate data structure like a HashSet or Hash table. In the real interview, you may need to solve this problem in some constraints like you cannot use additional memory or additional data structure that's where knowing multiple ways to find duplicate in Java array really help.

How to Perform Union of Two Linked Lists Using Priority Queue in Java? Example Tutorial

Firstly, The Linked list shall be introduced, then how priority queue in java is been used, Then after that, we shall carry on on the main task.  What is LinkedList? A linked list is a data structure in which each node(element) holds the reference to the next node. You don’t need to go through the struggle of searching the exact node in the link list, all you have to do is go through the previous node because it holds the reference to the next node, then you can easily access it.

3 ways to Count words in Java String - Google Interview Questions with Solution

Today, I am going to share with you Java interview questions from Google, which were asked to one of my readers during the telephonic round. How do you count the number of words in a given String in Java? You can count words in Java String by using the split() method of String. A word is nothing but a non-space character in String, which is separated by one or multiple spaces. By using a regular expression to find spaces and split on them will give you an array of all words in a given String. This was the easy way to solve this problem as shown here, but if you have been asked to write a program to count a number of words in a given String in Java without using any of String utility methods like String.split() or StringTokenizer then it's a little bit challenging for a beginner programmer.

Tuesday, September 3, 2024

Review - Is Google Data Analytics Professional Certificate Really Worth it in 2024?

Hello friends, if you want to become a Data Analyst in 2024 and looking for best online courses, guides, and tutorials to learn Data Analysis then you have come to the right place. In the past, I have shared best Data Analysis coursesBooks, and 2024 Data Analyst RoadMap, and in this article, I will share one of the most popular Coursera course to learn Data Analytic, Google Data Analytics Professional Certificate. With more than 800,000 enrollments on Coursera this is one of the most popular Data Analytics course on Coursera and why not? Its created from Google itself. It's also well structured, up-to-date and you will learn all essential Data Analytics skills from Google experts. 

3 ways to check if a String contains SubString in Java? IndexOf, contains, and lastIndexOf Example

You have given a String and a subString or a character and you need to find out whether given String contains the given character or substring, how would you do that? Well, there are three main ways to search String in Java, the contains() method, the indexOf() method and the lastIndexOf() method, all from java.lang.String class. First method, contains() accepts a CharSequence, superclass of String and return true if that CharSequence appear on the String you have called. The indexOf() and lastIndexOf() are similar method and both return the index (zero based) from where the given subString or character appear in the String you have called. Only difference between indexOf() and lastIndexOf() is that if given substring appear multiple time then they will return difference index, otherwise both will return the same index. Similarly if given sub-string is not present in the String, both will return -1 and contains() will return false.

How to make Immutable class in Java? Mutable vs Immutable Objects

How I make immutable objects in Java? I've always thought that all objects are immutable, because if you change the content of an String example, it will always create you an new String object and point to that. However later I found that String is a special class and its specially designed as an Immutable class because its often cached. Obviously you cannot cache anything which is not constant and that make sense why String is Immutable in Java. But this encouraged me to learn more about Mutable and Immutable class in Java and how to create a custom Immutable class in Java.

Difference between StringTokenizer and Split method in Java? Example

There are multiple ways to split a String in Java, but two of the most common ways are by using StringTokenizer and the split method of String class. You can use either one of them, but when to use which one? This short article will give you some details about StringTokenizer and Split method in Java to decide which one to use.

1) The StringTokenizer is legacy, Prefer split() as more chances of its performance getting improved as happens in Java 7.

2) The StringTokenizer doesn't support regular expression, while spilt() does. However, you need to be careful, because every time you call split, it creates a new Pattern object and compiles expression into a pattern. This means if you are using the same pattern with different input, then consider using Pattern.split() method, because compiling a pattern takes more time later to check whether a given string matches a pattern or not.

5 ways to Compare String Objects in Java - Example Tutorial

here are many ways to compare String in Java e.g. you can use equals() and equalsIgnoreCase() for equality check and compare() and compareTo() for ordering comparison. You can even use the equality operator == to perform reference-based comparison e.g. to check both the String reference variable points to the same object. In general, equals() is used to check whether the value of a given String is the same i.e. they contain the same characters in the same sequence or not e.g. "Groovy".equals("Groovy") will be true if you compare them using equals() method. You can also use equalsIgnoreCase() to check if they are equal irrespective of case e.g. "Apple" and "apple" will be the same if you compare them using equalsIgnoreCase() method.

Monday, September 2, 2024

4 ways to read String from File in Java - Example

Just like there are many ways for writing String to text file, there are multiple ways to read String form File in Java. You can use FileReader, BufferedReader, Scanner, and FileInputStream to read text from file. One thing to keep in mind is character encoding. You must use correct character encoding to read text file in Java, failing to do so will result in logically incorrect value, where you don't see any exception but content you have read is completely different than file's original content. Many of the method which is used to read String by default uses platform's default character encoding but they do have overloaded version which accepts character encoding. 

How to download a file using HTTP in Java? Example

Hello guys, if you are looking for tutorial to understand about how to download a  file using http in Java to have deep knowledge of java basics then you will definitely learn from this article. uploading and downloading files are common task but many Java developer are not aware about how to complete that. They don't know about HTTP and how to send and receive data using HTTP. Many of them also doesn't know about HttpClient which was added in JDK 11 as well as third party libraries like Apache HttpClient which you can use before JDK 11. Anyway, don't worry, we are again here with new article that is on download file using http will give all basics about the topic to our viewers or readers.  Let's start with an example first.

How to read CSV file in Java without using a third-party library? FileReader Example Tutorial

Hello guys, as you learn Java, one thing that comes up early and often is reading from/ writing to files, and doing something useful with that data. This is also one thing which you will keep doing and also forgetting very soon, if you are not then you have good memory as I always forget it and then I do google search to find my own articles. If you read this blog then you know that in the past, I have shared how to load CSV file using OpenCSV library as well how to load a CSV file with header using Jackson but a lot of you asked me how to do this without using any third party library like Jackson or OpenCSV. So, I thought to write about this article and I actually written but forgot to publish it for a long time. But I today I found it and publishing it now, it still works well. 

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.  

How to recursive copy directory in Java with sub-directories and files? Example

Hello guys, it's a common requirement in Java to copy a whole directory with sub-directories and files but it's not that straightforward, especially not until Java 7. JDK 7 introduced some new file utility methods as part of Java NIO 2 which we will use in this article to show you how to recursively copy a whole directory with sub-directories and files in Java. I'll also show you how you can use Apache Commons if you are not running on Java 7 or higher versions. Basically, You can copy a file or directory by using the copy(Path, Path, CopyOption...) method. The copy fails if the target file exists unless the REPLACE_EXISTING option is specified.

How to check if a File exists in Java with Example

Hello guys,  if you are working in Java for a couple of years, then you have come across a scenario where you need to check if a file exists or not. This is often required while writing defensive code that writes or reads from a file. While there is a method to check if a file exists in Java or not, it's not straightforward to use because it returns true if a given path represents a file or a directory. Yes, I am talking about the File. Exists () method of the java.io package. This method is the key method to solve this problem, but you need to keep in mind that it returns true if a given path exists and it's either file or directory. 

How to append text to file in Java? Example Tutorial

Hello guys, In this article, I'll teach you how to append text to a file in Java. Earlier, I have taught you guys how to create a file and write text into it, but, append is totally different than creating a new file and writing data into it. In the case of append, the file already exists and you just add text at the end of the file. One popular example of appending text into a file is a log file that is constantly updated because your application continuously appends log details into it. While you don't need to create a logging framework here, just knowing how to append text into an existing file in Java is useful for Java programmers of all kinds of experience.

How to work with Files and Directories in Java? Example Tutorial

The File API is one of the important parts of any programming language or API and even though Java's file API both new and old, is powerful, they are not intuitive enough compared to other languages like Python. Apart from knowing the essential classes and abstractions e.g. File, InputStream, OutputStream, Reader, Writer, Channel, etc, you also need to know and remember some nitty-gritty detail to avoid subtle issues. There are many articles out there on the internet which can teach you how to read and write data from the file but there are very few which will tell you to do it in the right way.

Tuesday, August 27, 2024

How to escape HTML Special characters in JSP and Java? Example

Escaping HTML special characters in JSP or Java is a common task for Java programmers. There are many ways to escape HTML metacharacters in Java, some of which we have already seen in the last article escaping XML metacharacters in Java.  For those who are not familiar with HTML special characters, there are five e.g. <, >, &, ' and '' and if you want to print them literally just like here, Than you need to escape those characters so < becomes &lt;, > becomes &gt; and so on. 

How to lock a File before writing in Java? Example

A file is one of the oldest ways to store data and share data but if you are working in a shared file i.e a file that can be read or write by multiple readers and writers, you need to make sure that the file is locked before you try to write on it. This is needed to ensure that someone doesn't overwrite the data you are writing. Fortunately, Java provides a mechanism to lock a file before writing using the FileLock interface. You can get the handle of FileLock by using FileChannel for writing to a file. The FileChannel class is generally used to write faster in a large file and one of the common ways to write binary data in Java.

Monday, August 26, 2024

Difference between Static and Dynamic binding in Java

Hello guys, if you are wondering what is difference between static and dynamic binding and how it affect your program execution in Java then you are at right place. When you call a method in Java, it is resolved either at compile time or at runtime, depending upon whether it's a virtual method or a static method. When a method call is resolved at compile time, it is known as static binding, while if method invocation is resolved at runtime, it is known as Dynamic binding or Late binding. Since Java is an object-oriented programming language and by virtue of that it supports Polymorphism. Because of polymorphism, a reference variable of type Parent can hold an object of type Child, which extends Parent.

Is Cracking the Coding Interview book still worth it in 2024? Review

Hello guys, if you are preparing for Programming Job interviews and wondering whether the classic Cracking the Coding Interview book by Gayle Laakmann McDowell is still worth it in 2024 then you have come to the right place.  In the past, I have shared best books and courses for coding interviews where I mentioned this book and today, I am going to review this book in depth. This was one of the first book I used to prepare for coding interview and due to its focus on evergreen topic, I am happy to say that it's still relevant, but whether it's good enough now is another question, which we will find in this article.

Friday, August 23, 2024

Java ArrayList Tutorials and Examples for Beginners (with Java ArrayList Cheat Sheet)

Hello guys, if you want to learn ArrayList in-depth and looking for a complete guide on ArrayList then you have come to the right place. Earlier, I have shared the best Java collection courses and in this article, I am going to share tutorials and examples to learn and master ArrayList in Java. In the last 10 years, I have written several ArrayList tutorials, touching different ArrayList concepts and many how-to-do examples with ArrayList. In this tutorial, I am giving a summary of each of them. Why? So that any Java beginner who wants to learn ArrayList in detail, can go through the relevant tutorial and learn.

How to calculate sum and difference of two complex numbers in Java? Example

From the last couple of articles, I am writing about coding exercises for beginners e.g. yesterday you learned how to write a program from matrix multiplication in Java (see here) and a couple of days back, you have learned the recursive binary search algorithm. To continue that tradition today I am going to show you how to write a program for calculating the sum and difference of two complex numbers in Java. If you remember the complex number from you Maths classes, it has two-part real and imaginary and to add a complex number we add their real and imaginary part separately, similar to subtract complex number we minus their real and imaginary part separately. 

Wednesday, August 21, 2024

Is System Design Interview Book Vol 1 and 2 by Alex Xu worth it in 2024? Review

 Hello guys, if you are preparing for System design interviews or Software Design Interviews, then you must have come across System Design Interview - An Insider's Guide by Alex Xu, one of the most popular book on System Design after Designing Data-Intensive Applications by Martin Kleppmann. I first come across Alex Xu on Twitter when one of his image about how HTTPS works went viral. The image was quite detailed and presentable so I start following Alex and then I come across ByteByteGo, his online System design course and his book System Design Interview - An Insider's Guide

Tuesday, August 20, 2024

7 Projects You Can Do to Become a Frontend Master

Learning to code can be challenging, especially if you don't know where to begin. The greatest approach to improve your programming abilities is to use them to create coding projects.

Here are some programming projects to boost your confidence and make you a better developer.




Calculator app Abacus
The program that we all use on a daily basis is the calculator. The calculator is a project that is both simple and practical. Creating a calculator app can help you learn, how to build reusable components, how to use props, and how to handle states.


Blog Website Writing hand
Building your own blog doesn't only improve your coding skill, but your online presence too. If you have a blog and share content regularly, you can get a lot of visitors which can increase your online presence.


Weather App
Having a fully-featured weather app in your portfolio can help you a lot to get clients. And if you deploy this app, not only you but many people may get benefit from it


Spotify 2.0 Multiple musical notes
You can create Spotify 2.0, your own Spotify version. You can add as many features as you can and after completing, you can deploy it online :)

Movies App Film projector
You can create a movies app from scratch where you need to show movie details, posters, trailers, and cast. I believe that you will enjoy building this project.


YouTube UI Clone DVD
If you want to learn about grids, flexbox, and handling states then it would be better if you clone the YouTube UI. You don't need to 100% do the same as YouTube, you have the freedom to redesign and create your own version of YouTube.


Chat App Speech balloon
If you want to learn about Firebase, Firestore, Real-time database and etc. This project is for you, having this project in your portfolio can make your portfolio strong.


Wednesday, July 24, 2024

3 Difference between Web Server vs Application Server vs Servlet Containers - Apache vs JBoss vs Tomcat

In the Java EE, or J2EE or JEE world, there is a lot of confusion between terminology, which is quite evident that now we have three words (J2EE, Java EE, and JEE) to describe the same technology platform. You will see Java developers using the terms like Web Server, Application Server, and Servlet containers interchangeably but they are not exactly the same. The main difference between a Web server and an application server is that a web server is meant to serve static pages like HTML and CSS, while an Application Server is responsible for generating dynamic content by executing server-side code like JSP, Servlet, or EJB.

Sunday, July 21, 2024

10 Examples of Comparator, Comparable, and Sorting in Java 8

Hello guys, the Comparator class is used to provide code or logic for comparing objects in Java, while sorting a list of objects or a collection of objects. It's close cousin of Comparable which provides natural order sorting e.g. ascending and descending orders for numbers like int, short, long or float, and lexicographic order for String i.e. the order on which words are arranged in dictionaries. The Comparators are used while sorting arrays, lists and collections. You pass logic to compare objects and sorting methods like Collections.sort() use that logic to compare elements until they are arranged in sorted order. 

Friday, June 7, 2024

How to Convert String to LocalDate, LocalTime, LocalDateTime and ZonedDateTime in Java? Example Tutorial

The JDK 8 added a new Date and Time API (JSR 310) which introduces new date and time classes like LocalDateLocalTime, LocalDateTime, and ZonedDateTime. Now, if you have a String e.g. "2016-12-14 03:30" then how do parse it to LocalDate, LocalTime, LocalDateTime and ZonedDateTime? Similarly, if you have an instance of those classes how you can format to the String you want e.g. in dd/MM/yyyy format, or USA or UK format? Well, Java 8 provides a utility class called DateTimeFormatter which can be used to parse/format dates in Java 8. It also provides several built-in formatter e.g. ISO date format and other to facilitate formatting of dates to String.

Sunday, June 2, 2024

How to convert JSON to Map in Java 8 without using third party libraries like Jackson or Gson

Hello guys, If you are working with JSON data then you may know that JSON is collection of key value pairs and that's why many times, you also need to convert them into a Map in Java. While there are many Java libraries like Jackson and Gson which provides support of parsing JSON to Java objects, there is not much support for JSON parsing or manipulation on standard JDK. While JSON parsing is still a long overdue, starting with JDK 8u60+ the built-in Nashorn engine is capable to convert JSON content into java.util.Map. No external dependencies are required for parsing JSON in to Map as you will learn in this article. 

Tuesday, May 28, 2024

Can You Override static method in Java? Method Hiding Example

Can we override the static method in Java?
This is one of the most popular Java interview questions. The answer to this question is No, you cannot override the static method in Java because the method overriding is based upon dynamic binding at runtime and static methods are bonded using static binding at compile time. This means static methods are resolved even before objects are created, that's why it's not possible to override static methods in Java. Though you can declare a method with the same name and method signature in the subclass which does look like you can override static methods in Java but in reality that is method hiding. 

Top 95 Programming Interview Questions Answers to Crack Any Coding Job Interview

Hello guys, if you are preparing for your next Programming Job interview and looking for frequently asked Coding or Programming questions to practice then you have come to the right place. In this article, I am going to share some of the most commonly asked Coding questions from Programming Job interviews. In order to do well on the Coding interview you need practice, you just can't go there and try to solve the coding problems in a limited time, that's actually one of the most common reasons to fail your programming Job interviews.  Sometimes, the interviewer also asks a little bit easier coding questions on a telephonic interview like revering array in place or reversing a string in place.

Wednesday, May 22, 2024

Top 10 Online Courses to Learn Data Structure and Algorithms in 2024 - Best of Lot

Hello guys, In the past, I have shared a lot of useful resources like books and tutorials to learn Data Structure and Algorithms for both beginners and experienced programmers. I have also shared a lot of Data Structure and Algorithmic interview questions like this and their solutions in Java. Still, I have got continuously queries about excellent online courses to learn Data Structure and Algorithms in Java. Even though the topics are completely independent with the programming language, Java developer definitely likes the online courses which teach Data Structure and Algorithms in Java, and that's why my recent post about best algorithms courses, which includes algorithms courses from JavaScript and Python didn't impress my readers.

Tuesday, May 21, 2024

Top 10 Free Core Spring, Spring MVC, and Spring Boot Courses for Beginners in 2024 - Best of Lot

Hello guys, if you want to learn Spring Framework, Spring MVC and Spring Boot then you are at the right place. In this post you will find the best free courses to learn Spring Framework, Spring MVC and Spring Boot in 2024. I have been sharing a lot of resources like books and courses recently and when I published my list of Top 5 courses to learn Spring and Hibernate, many of my readers asked about a similar list of free courses to learn Spring Framework like Core Spring, Spring MVC, Spring Security, and Spring Boot. That request was always back in my mind but I couldn't get time to put together a list, which I can share with you guys, but today is the day. In this list, I have compiled some of the best online free courses to learn Spring Framework from scratch, online at your own pace. 

Monday, May 20, 2024

8 Free Linux Courses for Programmers and IT Professionals to Learn Online [2024]

Linux is one of the most popular operating systems to run server-side applications. I have seen almost all Java applications running on Linux, barring a couple of them, which run on Windows as a service. If you take out standalone apps like IDEs or tools, most of the real-world Java applications run on Linux, like payment gateways, trading systems, and other financial applications. That's why it's essential for any programmer, IT professional, or developer to learn and understand Linux, both the operating system, as well as the command line.

Sunday, May 19, 2024

Top 8 Online Courses to Learn Power BI in 2024 - Best of Lot

If you want to become a Data Analyst or Data Scientist or you are doing Data Analytics and Data visualization and want to learn Microsoft Power BI then you have come to the right place. In the past, I have shared the best courses to learn Tableau, QlikView, D3.js, and Excel, and today and I going to share the best online courses to learn Microsoft Power BI, another top-class Data Visualization tool. If you have been interested in Data Visualization and Analysis then you might have come across Microsoft Power BI, a cloud-based powerful data visualization tool that is quickly getting very popular among Business Analysts and other technical people who work with Data.

Saturday, May 18, 2024

Top 6 Free Database and SQL Query Courses for Beginners to Learn Online in 2024 - Best of Lot

Hello guys, I have been sharing some free programming resources e.g. books and courses in this blog for quite some time. Earlier I have shared free courses on Java, Maven, Spring, and Data Structure and Algorithms and today I'll share some of the free online training courses to learn SQL and Database. Why you should learn SQL? Well, it's one of the must-have skills for programmers, application developers, and IT professionals. Like Linux, this is one skill that is going to serve you longer than any other programming language, framework, or library. 

Friday, May 17, 2024

Top 7 Free Online Courses to learn JavaScript in 2024 - Best of Lot

Hello guys, If you want to learn JavaScript in 2024 by yourself and looking for some free resources like books, sites, and tutorials, then you have come to the right place. Earlier, I have shared the best JavaScript online courses to learn JavaScript in depth and In this article, I am going to share some of the best free JavaScript online courses you can join to learn JavaScript by yourself, on your own schedule, and at your own place. A lot of people are learning JavaScript, and the number is only increasing with each passing day, and why not? It's the #1 web development language. It got tons of useful frameworks and libraries like Angular, React Node.js, and jQuery, which makes web development really easy.

Top 6 Online Courses to Learn Linux and UNIX in 2024 - Best of Lot [UPDATED]

Hello guys, if you want to learn Linux operating systems and command lines and look for the best Linux courses, you have chosen the right place. In the past, I have shared some free Linux courses and bash scripting courses for programmers and developers, and many of you asked for more comprehensive online Linux courses to learn Linux in-depth, which motivates me to write this article. In this article, you will find the best Linux online training classes, online paths, and tutorials from Udemy, Pluralsight, Coursera, and edX, my favorite online learning platforms.  

7 Free Blockchain Developer Courses and Certifications to Learn in 2024 - Best of Lot

Hello guys, if you want to learn Blockchain development and are looking for some free Blockchain courses, you have come to the right place. Earlier, I shared my favorite and best blockchain courses for programmers, and a lot of you asked for free online courses to learn Blockchain, so today, I am going to share the best free Blockchain development courses you can join in 2024. Blockchain is one of the most in-demand technologies and one skill that you should learn in 2024. It will not only help in your career but also raise your profile. This is one thing I have highly recommended programmers to learn this year. 

Saturday, May 11, 2024

3 ways to check if checkbox is selected in jQuery - Example Tutorial

 So, you have a checkbox and you want to check if its selected or not at runtime using jQuery. If that's what you want then continue reading. A checkbox is an HTML element with type="checkbox" and checked property is used to find out whether a checkbox is selected or not. There are several ways to find if your checkbox has this property or not in jQuery e.g. by using :checked, a pseudo selector or by using is() jQuery function or by using prop() function which is available from jQuery 1.6 onward. In this article, we will see examples of these approaches to check if a check box is checked or not. 

Thursday, May 9, 2024

Top 10 Frequently asked SQL Query Interview Questions Answers

In this article, I am giving some examples of SQL queries which is frequently asked when you go for a programming interview, having one or two year experience in this field. Whether you go for a Java developer position, QA, BA, support professional, project manager, or any other technical position, may interviewer expects you to answer basic questions from Database and SQL. It's also obvious that if you are working for one or two years on any project there is a good chance that you come across to handle databases, writing SQL queries to insert, update, delete and select records. 

Wednesday, May 8, 2024

Top 15 Courses to Learn System Design and Software Architecture in 2024 - Best of Lot

Software design or System design is one of the tricky concepts to master. You can quickly learn a programming language like Java or Python, but creating software using that programming language is a totally different thing. That's where software design and coding skills come to the rescue. It's actually an art to structure your program, design your modules, specify boundaries and interactions with other parts of the system so that they are easier to read, maintain, and flexible to change. It's one of the most essential skills for a software developer but often gets ignored. If you look for an online course to learn Software design and architecture, you won't find many, forget about good ones.

Tuesday, May 7, 2024

Top 100 Data Structure and Algorithm Interview Questions for Java Programmers

Data structure and algorithms are a core part of any Programming job interview. It doesn't matter whether you are a C++ developer, a Java developer, or a Web developer working in JavaScript, Angular, React, or Query. As a computer science graduate, it's expected from a program to have strong knowledge of both basic data structures, like the array, linked list, binary tree, hash table, Stack, Queue, and advanced data structures like the binary heap, trie, self-balanced tree, circular buffer, etc.

Monday, May 6, 2024

Top 10 Books Java Developers Must Read

Hello guys, If you are a Java developer and wondering what to read, then you have come to the right place. In this article, I will share 10 books on Java, Spring, and related technology a Java developer can read. I have included books for both experienced Java developer who is more inclined to learn about architecture stuff,  developing for Cloud, Microservice, Java 9 to Java 21 features, and Spring 6 features and thinking of learning Kotlin to improve their productivity. Still, I have not forgotten junior and less experienced Java developers or some thinking of starting their journey into the Java world

How to Reverse words in String Java? [Solution]

Hello guys, if you are wondering how to reverse words in a given String in Java then you have come to the right place. Earlier, I have shared 75 Programming interview questions and In this Java Coding tutorial, you will learn how to reverse words in String. It's also one of the popular coding questions, so you will also learn how to take a requirement, how to fill gaps in the requirement by asking the right question. A String is nothing but a sentence, which may contain multiple works, or just contain a single word or it may be empty. Your program must produce a String that contains the word in reverse order, for example, if the given input is "Java is Great" then your program should return "Great is Java".  

Sunday, May 5, 2024

Top 5 Cloud Computing Books for Beginners to Read in 2024 - Best of Lot

Hello guys, if you want to learn Cloud Computing in 2024 and looking for the best online resources like books, online courses, tutorials, and websites then you have come to the right place. Earlier, I have shared the free cloud computing courses and best websites for cloud computing, today, I am going to share the best book to learn about Cloud computing in 2024. These books are written by Cloud Computing experts and trusted by thousands of people who want to learn Cloud Computing and public cloud platforms like AWS, GCP, and Microsoft Azure. You can read one or more of these book to get started with Cloud Computing and benefits it offer in terms of cost saving, scalability, and high-avaibility. 

Saturday, May 4, 2024

How to remove duplicates from Collections or Stream in Java? Stream distinct() Example

Hello guys, if you wonder how to remove duplicates from Stream in Java, don't worry. You can use the Stream.distinct() method to remove duplicates from a Stream in Java 8 and beyond. The distinct() method behaves like the distinct clause of SQL, which eliminates duplicate rows from the result set. The distinct() is also a standard method, which means it will return a new Stream without duplicates, which can be used for further processing. Like other methods of Stream class, I mean, map(), flatmap(), or filter(), distinct() is also lazy, and it will not remove duplicate elements until you call a terminal method on Streams like collect or forEach().  

Top 10 Algorithms books Every Programmer Should Read

Algorithms are language agnostic, and any programmer worth their salt should be able to convert them to code in their programming language of choice. Unfortunately, I have come across several programmers who are REALLY good at programming languages like Java or Python, like know minor details of API and language intricacies but have very poor knowledge of the fundamentals of Algorithms and Data Structures. Just ask them to implement any popular sorting algorithms like quicksort or merge sort, and they will fall apart. If you expect them to know more advanced and sophisticated algorithms like String processing algorithms, graph algorithms, tree traversal, or greedy algorithms, be ready to check on Interviews; otherwise, you might end up with some surprises.

Friday, May 3, 2024

10 Books and Courses to Prepare Technical Programming/Coding Job Interviews in 2024

If you are preparing for a technical interview in the software development sector and looking for some great books to boost your preparation, then you have come to the right place. In the past, I have hared some of the best online courses to prepare coding interviews. In this article, I am going to share some of the best programming/coding interview books to prepare well for any software development jobs. These books are enough to crack even the toughest of the job interviews at GoogleAmazon, or Microsoft. They provide excellent coverage of all essential topics for programming job interviews like data structure and algorithms, system design, algorithm design, computer science fundamentals, SQL, Linux, Java, Networking, etc.

Thursday, May 2, 2024

5 Examples of map() and flatMap() in Java 8 Stream

The map() and flatMap() are prince and princess of functional programming in Java. They are two powerful methods of Stream API which I believe every Java developer should be aware of and should also master it. You can use map() and flatMap() for data transformation, dealing with database operations where you need to convert one object to another while saving or reading from database. You can also use them for parsing and formatting as well as when you want to remove boiler plate code and make your data pipeline concise. The map() function is used in functional programming to transform each element of Stream into another element.