How to implement Radix Sort in Java - Algorithm Example

The Radix sort, like counting sort and bucket sort, is an integer-based algorithm (I mean the values of the input array are assumed to be integers). Hence radix sort is among the fastest sorting algorithms around, in theory. It is also one of the few O(n) or linear time sorting algorithms along with the Bucket and Counting sort. The particular distinction for radix sort is that it creates a bucket for each cipher (i.e. digit); as such, similar to bucket sort, each bucket in radix sort must be a growable list that may admit different keys.

5 Free Google Cloud Developer Certification Courses in 2021 - Best of Lot

If you are preparing for Google Cloud Professional Cloud Developer certification and looking for free Google cloud courses to learn online then you have come to the right place. In the past, I have shared the best courses to learn Google Cloud as well as certification courses to pass cloud engineer, data engineer, and cloud architect certifications, and today, I am going to share free Google Cloud Professional Cloud Developer certification exam courses for both beginners and experienced IT  professionals. This is one of the best exams for a Software developer who wants to learn Google Cloud Platform from a developer's point of view. 

How to pause a Thread in Java - Thread.sleep and TimeUnit.sleep Example

There are multiple ways to pause or stop the execution of the currently running thread in Java, but putting the thread into a sleep state using the Thread.sleep() method is the right way to introduce a controlled pause. Some Java programmers would say, why not use the wait and notify? Using those methods just for pausing a thread is not a good coding practice in Java. Those are the tools for a conditional wait and they don't depend on time. A thread blocked using wait() will remain to wait until the condition on which it is waiting is changed. Yes, you can put timeout there but the purpose of the wait() method is different, they are designed for inter-thread communication in Java

Top 5 Free Personal Development and Leadership Courses in 2021 - Best of Lot

If you want to improve yourself and looking for the best personal development courses then you have come to the right place. Earlier, I have shared the best coding courses for people with no programming experience, and today, I am going to share free online courses to improve myself. These personal development course lists include courses on improving your learning ability, negotiation skills, your health, and well-being as well as on value education. These free online personal development courses are great to bring your best version out of you. 

Difference between wait() and join() methods in Java [Answered]

Though both wait() and join() methods are used to pause the current thread and have a lot of similarities they have different purposes. One of the most obvious differences between the wait() and join() method is that the former is declared in java.lang.Object class while join() is declared in java.lang.Thread class. This means that wait() is related to the monitor lock which is held by each instance of an object and the join method is related to the thread itself. The wait() method is used in conjunction with notify() and notifyAll() method for inter-thread communication, but join() is used in Java multi-threading to wait until one thread finishes its execution.

Binary Tree InOrder traversal in Java without Recursion

I have been writing about different binary tree traversal algorithms and so far we have seen both pre-order and post-order algorithms to traverse a binary tree and today you'll learn about the in-order or sorted order algorithms. This is actually the second part of implementing the inorder traversal of a binary tree in Java, in the first part, I have shown you how to solve this problem using recursion and in this part, we'll implement the inorder traversal algorithm without recursion. Now, some of you might argue, why use iteration if the recursive solution is so easy to implement? Well, that's true, but the iterative solution is often regarded better as they are not prone to StackOverFlowError. Another reason why we are discussing the iterative solution here is because of technical interviews.

Top 6 Online Courses to learn AWS S3 and Dynamo DB in 2021 - Best of Lot

If you want to learn AWS S3 and DynamoDB in-depth and looking for the best online courses to start with then you have come to the right place. In the past, I have shared in-depth courses to learn AWS EC2CloudFormation, and Quicksight, and today I'll share the best courses to learn AWS S3 and DyanmoDB online. These are some of the most essential AWS Services and you should learn it if you are working in AWS on a day-to-day basis for preparing for in-demand AWS certifications like Cloud Practitioners, AWS Developer, AWS SysOps, and AWS Solution Architect exam. Good knowledge of AWS S3 and DynamoDB goes a long way in becoming an AWS Hero you always wanted to be. 

How to find Nth Fibonacci Number in Java - Coding Problem with Solution

It's been a long time since I have discussed a coding problem in this blog. So, I am going to start with probably the oldest one of them, how do you find the nth number in a Fibonacci sequence? or how do you find the Fibonacci number in Java? or maybe printing the Fibonacci series. If you are a regular reader of this blog then you might know that I have already discussed both recursive and iterative algorithms for printing the Fibonacci series but never really discussed especially writing a program to return the Nth Fibonacci number in Java. Don't worry the wait is over as in this article, we'll solve this common problem and learn a bit more about problem-solving, recursion, iteration, and some basic algorithm skills.

Top 12 Java Thread, Concurrency, and Multithreading Interview Questions For experienced Programmers

Java concurrency and thread interview questions answers
Multithreading is an important feature of the Java programming language, which means threads are also an important part of any Java interview. It's true and in fact, at beginners and freshers, level Thread interview questions in Java are one of the most difficult to answer. One reason for interview questions related to multithreading and concurrency being difficult is confusion around how multiple threads work together and the second is threads are genuinely a complicated topic to understand and use correctly.

Top 5 Online Courses to Learn Artificial Intelligence (AI) for Beginners in 2021 - Best of Lot

Hello guys, Artificial Intelligence is one of the growing fields in technology and many developers are trying to learn Artificial Intelligence to take their career next level. If you are a Python developer and looking for the best courses to learn Artificial Intelligence with Python then you have come to the right place. In this article, I will share the best courses to learn AI basics as well as some hands-on courses to practice AI with the Python library. I first come across AI when DeepMind beat Garry Kasparov, one of the finest players of Chess. It was way back in the 1990s, and AI has come a long way since then. Now, Google is using the same DeepMind to reduce electric bills of its Data Center by 40%, and Elon Musk is talking about Self driving cars.

Difference between CountDownLatch vs CyclicBarrier in Java Multithreading

Difference between CountDownLatch and CyclicBarrier in Java
Both CyclicBarrier and CountDownLatch are used to implement a scenario where one Thread waits for one or more Thread to complete their job before starts processing but there is one difference between CountDownLatch and CyclicBarrier in Java which separates them apart and that is, you can not reuse the same CountDownLatch instance once count reaches to zero and latch is open, on the other hand, CyclicBarrier can be reused by resetting Barrier, Once the barrier is broken.

Wait, notify, and notifyAll Example in Java for Beginners

When should you use the wait() and notify method in Java is one of the many popular questions about the wait and notify methods from Java multithreading interview questions. One of the reasons for its popularity is that still a lot of Java programmers struggle to explain and write code using wait-notify methods.  Many Java developer only knows some facts about the wait and notify methods like that wait() and notify() are defined in the java.lang.Object class or you cannot call wait() without synchronization, which means without a synchronized block or synchronized method but doesn't really know when and how to use them.

Top 5 Online Courses to learn PyTorch and Keras for Deep Learning in 2021

Hello guys, if you want to learn PyTorch and Kearas from scratch and looking for the best PyTorch and Keras online courses then you have come to the right place. In the past, I have shared the best machine learning courses and best TensorFlow courses and today I am going to share the best Keras and Pytorch courses for beginners and experienced programmers. PyTorch and Keras are two deep learning libraries developed by two big companies Facebook and Google aiming to facilitate the creation of deep learning applications like face recognition and self-driving cars, and so on.

How to remove duplicate characters from String in Java? [Solved]

Hello all, how are you doing? It's been a long since I have shared a coding problem from the interview. The last one I discussed was about finding the Nth Fibonacci number, one of the popular dynamic programming problems. Nevermind,  today, you are going to learn about another popular coding problem.  How do you remove duplicate or repeated characters from String in Java is one of the frequently asked string based coding problems from Interviews. This problem is very similar to removing duplicate elements from an array which we have discussed in the past here after all String is a character array in Java. If you know how to solve that problem, you should be able to solve this one as well.

5 Free Courses for Google Cloud Professional Cloud Architect Certification [2021]

Hello guys, if you are preparing for Google Cloud Professional Architect certification and looking for free online training courses then you have come to the right place. In the past, I have shared the best courses to learn Google Cloud as well as certification courses to pass cloud engineer, data engineer, and cloud architect certifications, and today, I am going to share free GCP Cloud Architect certification courses for beginners and experienced cloud professionals. This is one of the most difficult and prestigious exams, similar ot the AWS Solution Architect and Azure Technology Architect (AZ-300) exam, once you pass this exam, you will have sufficient knowledge and skills to propose a Google cloud-based solution, which is a very in-demand skill. 

How to implement Binary Tree PreOrder Traversal in Java without Recursion [Example]

This is my second article on how to implement binary tree pre-order traversal in Java. In the first part, I have shown how to traverse a binary tree with a pre-order traversal algorithm using Recursion, and in this article, you will learn how to implement pre-order traversal without using Recursion. You might be thinking that why do you need to learn the iterative solution if a recursive solution is possible and easy to write? Well, this type of question is mostly asked in Programming Job interviews and Interviewers like to see how comfortable a candidate is with both Recursion as well as using other data structures and iteration.

Producer Consumer Problem with Wait and Notify - Thread Example

The Producer Consumer Problem is a classical concurrency problem and in fact, it is one of the most powerful concurrency design patterns which is used in most multithreaded Java application. In the last article, I have shown you how to solve  Producer Consumer problem in Java using blocking Queue but one of my readers emailed me and requested a code example and explanation of solving the Producer-Consumer problem in Java with wait and notify method as well Since it's often asked as one of the top coding questions in Java. In this Java tutorial, I have put the code example of the wait notify version of earlier producer consumer concurrency design pattern. 

Top 5 Courses to learn Scrapy with Python in 2021 - Best of Lot

Hello guys, web scraping is one of the useful skills and you can use it for many different projects. For example, you can use web scraping to find the cheapest flight between the two countries, find the cheapest hotels and holiday packages. Python makes it easy to scrape data from the website and store it. There are also many tools built-in there that can do web crawling and scraping and one of the best tools called Scrapy. This tool is a free and open-source tool written in python for web scraping and crawling purposes and you can use it to extract data from any website.

13 Spring Boot Actuator Interview Questions Answers for Java Developers

If you have used Spring Boot then you may know that Spring Boot is all about convenience and the Spring Boot actuator is one of such features that provides a convenient way to interact with your app using HTTP and JMX. It's also important from the Spring Boot interview point of view, while I did include some Spring Boot Actuator questions in my earlier post about Top Spring boot interview questions but many of you asked for more questions, so I decided to write a separate article for this. In this article, we will see some popular Spring boot Actuator interview questions and along the way, learn more about this useful Spring boot Feature

How to Create and Start Multiple Threads in Java? - Example

Hello guys, Multithreading is one of the biggest strengths of Java, which allows you to divide a task and execute faster by using more than one thread. In order to use multiple threads in Java, you need to first define the task which will be executed by those threads. In order to create those tasks, you can either use the Runnable or Callable interface. If you are just learning Java chose the Runnable interface, it's a simpler one, but if you are familiar with Java multithreading and want to leverage additional features offered by Callable like it can throw an exception and it can also return value, then go ahead and use the Callable interface. Once you have the task ready, you need to create an instance of the Thread class.

How to use PreparedStatement in Java - JDBC Example Tutorial

PreparedStatement is used to execute specific queries that are supposed to run repeatedly, for example, SELECT * from Employees WHERE EMP_ID=?. This query can be run multiple times to fetch details of different employees. If you use PreparedStatement like above then the database assists in query preparation, which is faster and more secure. Such kind of queries are compiled, and their query plans are cached at the database side to every time you execute it, you will get a faster response as opposed to using simple queries via Statement object, like SELECT * from Employees WHERE EMP_ID + emp_id.

Java CountDownLatch Example for Beginners - [Multithreading Tutorial]

Hello Java programmers, the CountDownLatch is an important concurrency utility class that was added in JDK 1.5 to facilitate inter-thread communication without using wait and notify methods, but unfortunately, many Java developers still struggle to understand and use this powerful tool. In this article, you will learn what is CountDownLatch and how to use it to write better concurrent applications in Java. You can use the CountDownLatch if you are spawning multiple threads to do different jobs and want to know when exactly all tasks are finished so that you can move to the next stage. In other words, you can block a thread until other threads complete their task

7 Difference between extends Thread vs implements Runnable in Java

Hello guys, the difference between Thread vs Runnable in Java is a common Java multithreading interview questions which are often asked by junior Java developers with 2 to 4 years of experience. If you are doing Java programming then you may know that Java provides multithreading to parallelize the execution of tasks (code) and you need multiple threads to run multiple things in parallel like download a file in the background and show the progress bar at the front-end. There are two ways to create a Thread in Java, first by extending java.lang.Thread class and second by implementing the java.lang.Runnable interface. 

How to convert Date to LocalDateTime in Java 8 - Example Tutorial

The LocalDateTime class has introduced in Java 8 to represents both date and time value. It's local, so date and time are always in your local time zone. Since the java.util.Date has been widely used everywhere in many Java applications, you will often find yourself converting java.util.Date to LocalDate, LocalTime, and LocalDateTime classes of the java.time package. Earlier I have shown you how to convert Date to LocalDate and today, I am going to teach you how to convert Date to LocalDateTime in Java 8. The approach is the same. Since the equivalent class of java.util.Date in new Date and Time API in java.time.Instant, we first convert Date to Instance and then create LocalDateTime instance from that Instant using System's default timezone.

Java 8 Stream + FlatMap Example for Beginners

In order to understand the flatMap() method, you first need to understand the map() function of Java 8. The map() function is declared in  the class and uses to transform one Stream into another, for example, it can convert a stream of integer numbers into another stream of ints where each element is the square of the corresponding element in the source stream. In the map() operation, a function is applied to each element of the source Stream and return values are inserted into a new Stream which is returned to the caller. The key point to note here is that the function used by the map() operation returns a single value.

10 Examples of ALTER Command in SQL

In this SQL tutorial, you will learn how to use ALTER command in the table on the database. ALTER command is mainly used to add, modify and drop columns, indexes, and constraints on the table in relational database e.g. MySQL, Oracle, Sybase and SQL Server.  Though ALTER is not part of classical CRUD operation but it’s one of the important DDL commands. One of the most frequent uses of ALTER command in SQL is adding and removing indexes to improve the performance of SQL SELECT queries.

Difference between Correlated Subquery and Non-Correlated (Self Contained) subquery in SQL

If you are wondering what is correlated and non-correlated subqueries in SQL and looking to understand the difference between them then you have come to the right place. Earlier, I have shared free SQL and Database courses and today, I am going to talk about one of the common SQL concepts of subqueries, a query inside another query. There are two types of subqueries in SQL, correlated subquery and self-contained subquery, also known as nested, non-correlated, uncorrelated, or simply a subquery. The main difference between them is, self-contained (non-correlated) subqueries are independent of the outer query, whereas correlated subquery has a reference to an element from the table in the outer query.

Top 40 Core Java Interview Questions Answers from Telephonic Round [UPDATED]

Here is another post about preparing for Java Interviews, this time we will take a look at 40 core Java questions from the telephonic round of Java Programming interviews. Phone interviews are usually the first step to screen a candidate after selecting his resume. Since it's easy to call a candidate than to schedule a face-to-face interview, book rooms, and arrange for a meeting, a telephonic round of interviews is quite popular nowadays. There were days only one telephonic round of interview was enough but nowadays, it's almost two and three rounds of phone interviews with different team members before you get a chance for face-to-face interviews. 

How to Find Large Files and Directories with Size in Linux? [find + du Example]

One of the common problems while working in Linux is to find large files to free some space. Suppose, your file system is full and you are receiving an alert to remove spaces or if your host is run out of space and your server is not starting up, the first thing you do is find the top 10 largest files and see if you can delete them. Usually, old files, large Java heap dumps are good candidates for removal and freeing up some space. If you are running Java applications like core Java-based programs or web applications running on Tomcat then you can remove those heap dump files and free some space, but the big question is how do you find those? How do you know the size of the biggest file in your file system, especially if you don't know which directory it is? We'll try to find answers to some of those questions in this article.

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.

Top 10 Android Interview Questions Answers for Java Programmers

Hello guys, if you are preparing for an Android app developer interview and looking for some Android interview questions then you have come to the right place. Earlier, I have shared free Android courses for beginners, and in this article, we will explore some of the most frequently asked Android interview questions. Android is very hot nowadays as its one of the top operating systems for mobile and smartphones and a close rival to Apple's iOS. Android application developer job is in demand as well. I have also seen a couple of Java questions in an Android interview as well. It means it's better to prepare some Java questions as well. 

Top 10 Tricky Java interview questions and Answers

What is a tricky question? Well, tricky Java interview questions are those questions that have some surprise element on them. If you try to answer a tricky question with common sense, you will most likely fail because they require some specific knowledge. Most of the tricky Java questions come from confusing concepts like method overloading and overriding, Multi-threading which is really tricky to master character encoding, checked vs unchecked exceptions, and subtle Java programming details like Integer overflow. The most important thing to answer a tricky Java question is the attitude and analytical thinking, which helps even if you don't know the answer. 

11 JDBC Interview questions answers in Java - 2 to 4 years experienced programmer

Hello guys, if you are preparing for Java developer interviews then you may know that the JDBC Interview question forms one of the important sections in Java Interviews. Similar to multithreading, Collection framework and Garbage collection interview question, JDBC question must be prepared by any Java programmer. Most of the questions from JDBC or Java database connectivity comes from API and basic architecture of JDBC which also involves JDBC drivers. A good understanding of JDBC API along with database basics like transactions also, help to do well in JDBC interviews.