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

How to Swap Two Numbers Without Temp or Third Variable in Java - Interview Question Example

How to swap two numbers without using temp or third variable is a common interview question not just on Java interviews but also on C and C++ interviews. It is also a good programming question for freshers. This question was asked to me long back and didn't have any idea about how to approach this question without using temp or third variable, maybe lack of knowledge on bitwise operators in Java or maybe it didn't click at that time. Given some time and trial error, I eventually come out with a solution with just an arithmetic operator but the interviewer kept asking about other approaches of swapping two variables without using temp or third variable.

How to Print a left triangle star pattern in Java? Example Tutorial

Pattern based exercises are very common on Interviews as they are tricky for beginners and also offers coding practice. In the past, I have shared article on how to print pyramid pattern of stars in Java and Pyramid pattern of albhabets, and in this article, I will show you how to print left triangle star pattern in Java. There are different ways of printing different patterns, but most of them involves using loops and print methods like print() and println() to print characters like star, alphabets or numbers. If you know how to use loops and when to break from loop then you can easily solve pattern based coding problems. In this section, we shall be writing a program to print a left triangle star pattern. We would first implement that before I explain other things that you need to know in getting this task done.

Difference between Direct, Non Direct and Mapped ByteBuffer in Java?

ByteBuffer is one of the important classes of Java NIO API. It was introduced in java.nio package on JDK 1.4, it not only allows you to operate on heap byte arrays but also with direct memory, which resides outside the JVM. There are mainly three types of ByteBuffer in Java - Direct Byte Buffer, Non-Direct ByteBuffer, and mapped byte buffers. You can create both direct and non-direct buffers using java.nio.ByteBuffer class, while MappedByteBuffer is a subclass of ByteBuffer, which is created by FileChannel.map() method, to operate on memory-mapped file

How to Find Largest and Smallest of N numbers without using Array in Java? Example

One of the common programming questions is, how do you find the largest and smallest number in N numbers without using arrays in Java? Can you write a program to solve this problem? Well, it's very similar to the problem we have seen before, find the largest and smallest of 3 integers. You can use the same approach and generalize it for N numbers. All you need to do is start with largest as Integer.MIN_VALUE and smallest number as Integer.MAX_VALUE and loop through N numbers. At each iteration, compare the number with the largest and smallest number, if the current number is larger than the largest then it's a new largest, and if the current number is smaller than the smallest then it's a new smallest number.

How to Remove Duplicate Characters from String in Java? Example

This week's coding exercise is to remove duplicate characters from String in Java. For example, if the given String is "aaaaaa" then the output should be "a", because the rest of the "a" are duplicates. Similarly, if the input is "abcd" then the output should also be "abcd" because there is no duplicate character in this String.  By the way, you can not use any third-party library or Java API method to solve this problem, you need to develop your own logic or algorithm and then write code to implement that algorithm. This is one of the interesting problems from Java coding interviews and you can use this program to weed out Java programmers who cannot write code.

Difference between ByteBuffer vs byte array in Java

There are several differences between a byte array and ByteBuffer class in Java, but the most important of them is that bytes from byte array always reside in Java heap space, but bytes in a ByteBuffer may potentially reside outside of the Java heap in case of direct byte buffer and memory mapped files. Buffer is a byte array like abstraction which was introduced in Java NIO release to read and write data from FileChannel. It is extensively used in Java NIO for transferring data from one place to another and its also an essential Java concepts to know for any backend developer, particularly those who wants to create non-blocking server application using NIO in Java

The 2022 Laravel Developer RoadMap

Hello folks, if you want to learn Laravel for Web Development but no idea from where to start it then you have come to the right place. Laravel is one of the top PHP Framework for web development and also quite popular one. In the past, I have shared best Laravel Courses and best PHP courses and in this article, I am going to share the full 2022 Laravel RoadMap. I love these roadmap and in the past have shared many of them which you can find at the end of these article. They are often the most comprehensive guide to learn a new technology. 

How to Reverse a String in place in Java - Example

It's possible to reverse a String in place by using a StringBuilder. Since String is Immutable in Java, it's not possible to reverse the same String, but you can minimize the number of intermediate String objects by using StringBuilder or StringBuffer, which are mutable. The algorithm to reverse the String in place is similar to the algorithm we have used earlier to reverse an array in place. You need to traverse the String from one end, swapping characters at another end until you reach the middle of the String. At the point characters in your String are reversed. This algorithm only requires one extra character of memory to facilitate the swapping of characters. The time complexity of this algorithm is O(n/2)I mean O(n) where n is the length of String.

How to create an Array of Prime numbers in Java [ Sieve of Eratosthenes Algorithm Example]

Hello guys, I have said many times that a good knowledge of Data Structure and Algorithms is the first step towards becoming a better programmer and that's why I share a lot of Data structure and Algorithm stuff in this blog. To continue the tradition, I am going to share an interesting algorithm today, The Sieve of Eratosthenes algorithm, which can be used to generate prime numbers up to a given number. There are many occasions when you need to generate all prime numbers up to a specified integer and one algorithm which is most often used to generate prime numbers is the Sieve of Eratosthenes Algorithm. Surprisingly, not many developers know about this algorithm, particularly Java programmers, which is mainly because of not doing enough competitive programming.

Top 20 Kubernetes Interview Questions with Answers

Hello guys, if you are preparing for DevOps Engineer interview or a Developer interview, knowledge of Kubernetes is very important given the rise of Cloud computing and cloud native development. If you are looking for frequently asked Kubernetes interview questions to quickly revise key Kubernetes concepts then you have come to the right place. Earlier, I have shared 20 Docker Interview Questions and in this article, I am going to share frequently asked Kubernetes Interview questions with Answers. But, before we get to the 20 most important Kubernetes interview questions, let me tell you more about Kubernetes. In the most simple terms, Kubernetes is actually a bundle of software solutions that allow developers and engineers to scale and service server setups.

The 2022 Data Analyst Roadmap

Hello guys, if you are want to become a Data Analyst but not sure which skills you need and how to acquire those skills then you have come to the right place. Earlier, I have shared Java Developer RoadMap, Python Developer RoadMap, Web Developer RoadMapiOS Developer RoadMap, and  DevOps Engineer RoadMap, and in this article, I will share Data Analyst RoadMap which will help you to become a Data Analyst in 2022. All companies have data about their customers to improve their service and get valuable insight and a much better understanding of the customer's behavior. This can be done by hiring data analysts in your company to leverage the benefits of this hug customers' data.

[Solved] Fibonacci Series in Java using Recursion and Iteration - Example Tutorial

Printing Fibonacci Series In Java or writing a program to generate Fibonacci number is one of the interesting coding problems, used to teach college kids recursion, an important concept where function calls itself. It is also used a lot as coding problems while interviewing graduate programmers, as it presents lots of interesting follow-up questions as well. In the Fibonacci series, the next number is equal to the sum of the previous two numbers. First two numbers of series are always 1 and 1, third number becomes 1 + 1 = 2, subsequently fourth number becomes 2 + 1 = 3. So a Fibonacci series looks like 1, 1, 2, 3, 5, 8, 11, 19, and so on, as shown in the image as well.

Top 20 Docker Container Interview Questions Answers for Programmers and DevOps

Hello guys, if you are preparing for Software developer job interviews like Java developer then preparing Docker is a good idea. Docker has become an essential tool and you can expect a couple of questions about Docker during Interview to check your knowledge. Having absolutely no idea of Docker before going into interview can be detrimental to your prospect considering the importance of container on deploying apps and services on Cloud. That's why I always suggest my students to prepare Docker interview questions and revise key Docker concepts before interview. If you are wondering where you can find Docker interview questions then don't worry, in this article, I have shared common Docker related questions you can prepare for interviews. They are also great to revise key Docker concepts and they cover essential areas. 

Top 12 SQL Query Questions from Interviews for Practice with Solutions

SQL, a short form of Structured Query Language is one of the essential skills in today's programming world. No matter whether you are a Java developer, C++ developer or Python developer, you must know how to write SQL queries. Every programming job interview has at least one or two questions that require you to write SQL queries for a given requirement and many developers struggle there. It's easy to answer theoretical questions like what is the difference between clustered and non-clustered index (see) or what is the difference between correlated and non-correlated subqueries (see), but when it comes time to actually write SQL queries to solve problems, it's not that easy, especially if you haven't done your homework and practice.

Quicksort Sorting Algorithm in Java - Example and Explanation

Quicksort algorithm is one of the most used sorting algorithms, especially to sort the large lists, and most of the programming languages, libraries have implemented it in one or another way. In Java, Arrays.sort() method sorts primitive data types using a double-pivot Quicksort algorithm, authored by Joshua Bloch and others. This implementation provides better performance for a lot of data sets, where traditional quicksort algorithms reduced into quadratic performance. This method also uses MergeSort, another good sorting algorithm, to sort objects. Quicksort implementations are also available in the C++ STL library.

10 Essential Skills For Cyber Security Professionals to Learn in 2022

Hello guys, if you want to become a Cyber Security Professional but not sure which skills you should learn to start your Cyber Security career then you have come to the right place. Earlier, I have shared essentials skills for Java Developers, Python Developers, app developers, and Data Analyst and in this article, I will share important skills for Cyber Security Professionals. Cyber Security is one of the most lucrative career in today's age where every company and service is going online. Most companies infrastructure are connected to the internet, such as the employee's computers and the servers where the company has their valuable and confidential data, which means it can be hacked by people outside their network and cause significant damage to their system and even reputation so they need to hire cyber security professionals to help them secure their network. 

[Solved] How to Implement Binary Search in Java without Recursion? Iterative Algorithm Example Tutorial

Hey Java programmers, if you want to implement a binary search in Java, and looking for both iterative and recursive binary search algorithms then you have come to the right place. Earlier, I have shared the free courses to learn Data Structure and algorithms in Java, and today, I am going to teach you an important algorithm.  In computer science, a binary search or half-interval search is a divide and conquer algorithm which locates the position of an item in a sorted array. Binary search works by comparing an input value to the middle element of the array. The comparison determines whether the element equals the input, less than the input or greater. 

The 2022 Python Developer Roadmap

Hello guys, if you want to become a Python developer and looking for a complete 2022 Python Developer RoadMap then you have come to the right place. In the past, I have shared Java Developer RoadMapWeb Developer RoadMapiOS Developer RoadMapData Analyst RoadMap, and even a DevOps Engineer RoadMap and in this article, I am going to share with you the Python Developer RoadMap. Before writing this article, I looked for various roadmaps available online which list a lot of things you need to learn to become a Python Developer, which is really not needed. You may need them if you want to become a Python expert which can take years but just to start your career with Python, you don't need them at all.

[Solved] How to find the 3rd (kth) Node from end or tail in linked list in Java? Fast and Slow Pointer Pattern Example

Hello guys, the problem to find the 3rd element from the end in a singly linked list or Kth node from the tail is one of the tricky but frequently asked linked list problems in Programming job interviews. I know you can easily solve this problem by moving from tail to head or in the reverse direction but the main challenge here is to solve the problem in just one pass. That means, you can not traverse the linked list again and you cannot traverse backward because it's a singly linked list. So what do you think? Isn't this problem challenging? Well, I did struggle when I saw this problem very first time but once you understand the logic and some tricks to solve a linked list based problem like Recursion then it would be easy for you, and that's what you will learn in this article.

10 Essential Skills For Data Analyst in 2022

Hello guys, if you want to become a Data Analyst in 2022 but not sure which skills you need to succeed in this field or become a successful Data Analyst then you have come to the right place. In the past, I have shared essentials skills for Java developers and Python developers in 2022 and today I will share with you which skills you need to become a Data Analyst in 2022. Data analysis is a job in demand by most companies in the world who want to leverage the benefits of their data and make better decisions but analyzing data is not just knowing how to use a simple analysis software such as the Excel spreadsheet or visualize the data. It has many other skills you need to call yourself a data analyst.

[Solved] How to reverse an ArrayList in place in Java? Example

You can reverse an ArrayList in place in Java by using the same algorithm we have used to reverse an array in place in Java. If you have already solved that problem then It's a no-brainer because ArrayList is nothing but a dynamic array, which can resize itself. All elements of an array are stored in the internal array itself. By the way, if you need to reverse an ArrayList then you should be using the Collections.reverse() method provided by the Java Collection framework. It's a generic method, so you can not only reverse an ArrayList but also Vector, LinkedList, CopyOnWriteArrayList, or any other List implementation.

2 Ways to Check if a String is Rotation of Other in Java? Example

Write a program to check if one String is a rotation of another String is a common coding problem you will find on programming job interviews.  A String is said to be a rotation of another String, if it has the same length, contains the same characters, and they were rotated around one of the characters. For example,  String"bcda" is a rotation of "abcd" but "bdca" is not a rotation of String "abcd". One of the simplest solutions to this interesting problem is first to check if two String has the same length, if not then one String cannot be the rotation of another. If they are of the same length then just create another String by concatenating first String with itself, now check if second String is a substring of this concatenated String or not, if yes, the second String is a rotation of first.

How to Find Multiple Missing Integers in Given Array of Numbers with Duplicates in Java?

Hello guys, It's been a long time since I have discussed any coding or algorithm interview questions, so I thought to revisit one of the most popular array-based coding problems of finding missing numbers in a given array of integers. You might have heard or seen this problem before on your programming job interviews and you might already know how to solve this problem. But, there are a lot of different versions of this problem with increasing difficulty levels which interviewers normally use to confuse candidates and further test their ability to adapt to frequent changes, which is key to surviving in the ever-changing software development world.

50 Free Spring Professional Certification Practice Questions with Answers [VMWARE EDU-1202 Exam]

Hello guys, preparing for IT certification like Oracle's Java certification or Vmware's Spring Certification required a lot of hard-work. I have seen many experienced Java developers failing these certifications and losing money and time due to over-confidence and lack of preparation. A structured preparation involves reading books, joining course and doing practice questions. When it comes to Spring certification, practice questions are quite hard to find and that's why I created my Udemy course with 250+ Spring Certification questions. This course has helped more than 9000 students in their Spring certification preparation journey. 

The 2022 iOS App Developer RoadMap

Hello guys, if you want to become an iOS App developer and looking for a solid roadmap then you are not alone. I was also looking for iOS app developer roadmap when I stumbled upon this awesome looking iOS developer RoadMap on Reddit. This is one of the comprehensive roadmap to take your from zero to master in iOS App Development but its also too much comprehensive and hard to follow. To be honest, I cannot learn all the skills mentioned in this RoadMap unless I spend all of my time on learning them for another 5 to 10 years. So, I created a simplified version of my own iOS developer RoadMap where you only need to learn essential skills to start doing iOS Development and start your career as iOS App developer.

Top 30 Linked List Algorithm Questions from Programming/Coding Interviews

The linked list is one of the most common and essential data structure and that's why you would frequently find linked list based coding questions on interviews. The range of questions can be from simple questions like finding the length of a linked list to very difficult like merging two sorted linked lists. Nevertheless, the point is that you should be familiar with linked list data structure and must know how to perform basics task in the linked list e.g. adding or removing nodes from a linked list, traversing order linked list and implementing linked list in your choice of programming language like Java, C++, C, or Python.

How to Print Fibonacci Series in Java without Recursion - Coding Problem for Beginners

Fibonacci series is a great example of Dynamic Programming, Recursion, and how the use of Recursion can result in a clear and concise solution. That's why whenever asked about writing a Java program to get Fibonacci numbers or print the Fibonacci series of certain numbers, it's quite natural for programmers to resort to recursion. The interviewer often challenged this practice by asking candidates to implement the Fibonacci series without using recursion. Yes, you read it right, you can't use recursion and this is what you will learn in this article. If you have attended your programming classes regularly then you may know that many recursive algorithms also have their iterative counterpart which uses loops instead of recursion or calling itself. We will take advantage of that concept to devise a solution to this problem.

How to set an "Accept:" header on Spring RestTemplate request? Example Tutorial

RestTemplate is one of the most commonly used tools for REST service invocations. So one of the major problems you might have in this RestTemplate is that how to set an "Accept" header on Spring RestTemplate request.  In the last article, I have shown you how to POST and Consume JSON using RestTemplate in a Spring Based Java application and In this tutorial, we will go through some important points on how to add headers to RestTemplate and fix the errors related to them. 

Difference between Statement vs PreparedStatement vs CallableStatement in Java JDBC

Hello Java programmers, if you are looking to find out the difference between Statement, PreparedStatement, and CallableStatement in Java then you have come to the right place. Earlier, I have shared common JDBC Interview Questions and in this article, I am going to explain what is the real difference between these Statement types in Java and when to use Statement, PreparedStatement, and CallableStatement in Java programs. JDBC API provides several classes and interfaces for various things, but three of the most important types of Statement classes are Statement, PreparedStatment, and CallableStatement. They are designed to execute different types of SQL queries

What is Bean scope in Spring MVC Framework with Example

Java classes or POJO which are managed by Spring Framework are called Bean or Spring Bean and Bean scope in Spring framework or Spring MVC is scope for a bean managed by Spring IOC container. You may know that Spring is a framework that is based on Dependency Injection and Inversion of Control and provides bean management facilities to Java application. In Spring-managed environment bean (Java Classes) are created and wired by the Spring framework. Spring allows you to define how those beans will be created and the scope of the bean is one of those details. Scope are similar to access modifiers in Java which specifies visibility of a particular class. 

Top 10 Udemy Instructors to Learn Software Development in 2022 - Best of Lot

Hello guys, if you are thinking to learn Software development on Udemy but not sure which Udemy instructor has best Software development courses or which is the best software development instructor then you have come to the right place. Earlier, I have shared best Software development courses from Coursera and best coding courses from Educative and in this article I will share the best Udemy instructor to learn Software development But, before we get to the 10 best Udemy instructors that will teach you everything you need to know about software development, let me tell you more about Udemy.

String vs StringBuffer vs StringBuilder in Java? Example

Difference between String, StringBuffer, and StringBuilder
The String is one of the most important classes in Java and anyone who starts with Java programming uses String to print something on the console by using famous System.out.println() statements. Many Java beginners are not aware that String is immutable and final in Java and every modification in String creates a new String object. For example, when you get the substring, you get a new String, when you convert uppercase String to lowercase, a new String is created. Even when you remove space by calling the trim() method, a new String is returned. 

[Solved] How to find first recurring character in given String? [Google Interview Question]

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

5 Ways to find length of String in Java - Example Tutorial

On another day, someone asked me, is there a way to find the length of String without using the length() method from java.lang.String class? I didn't ask why, because I know it might have been asked to him on Interviews. Before I explore ways to find the length of String, let's recap what does the length of String means in Java? Well, it's no different than C here, a number of characters in a String including whitespace, newlines are known as length of String. By knowing this, you can think of many approaches to calculating length e.g. getting a char array from String and counting a number of characters or many are by applying some clever tricks.

5 Projects You can do to learn Flutter in 2022

Learning Flutter to build mobile apps for android and iOS does not make you a professional developer that people can rely on you to build their app. In fact, you need to train as much as possible to create mobile apps so you can consider yourself a mobile apps developer. If you are now in the stage of learning Flutter for creating mobile apps and you want to enhance your skills by building as much as possible mobile apps for both platforms android and iOS you’ve come to the right place.

10 Examples of Joining String in Java - String.join vs StringJoiner

It's quite common in day to day programming to join Strings e.g. if you have an array or List of String let's say {Sony, Apple, Google} and you want to join them by a comma to produce another String "Sony, Apple, Google", there is not an easy way to do it in Java. You need to iterate through an array or list and then use a StringBuilder to append a comma after each element and finally to remove the last comma because you don't want a comma after the last element. A JavaScript-like Array.join() method or join() method of Android's TextUtils class is what you need in this situation. Still, you won't find any such method on String, StringBuffer, StringBuilder, Arrays, or Collections class until Java 8.

Difference between Period and Duration class in Java 8? [Example]

What is the difference between Period and Duration class in Java is one of the popular Java 8 interview questions and has been asked too many of my readers recently. If you were also wondering the difference between Period vs Duration and when to use Period over Duration and vice-versa then you have come to the right place. Java 8 has two classes to represent differences in time like Duration and Period. The main difference between Period and Duration is that they represent the difference in different units, A Duration is used to calculate time difference using time-based values (seconds, millisecond, or hours) but Period is used to measure the amount of time in date-based values like days, months and year.

3 Ways to Remove Duplicates from a table in SQL - Query Example

There are a couple of ways to remove duplicate rows from a table in SQL e.g. you can use temp tables or a window function like row_number() to generate artificial ranking and remove the duplicates. By using a temp table, you can first copy all unique records into a temp table and then delete all data from the original table and then copy unique records again to the original table. This way, all duplicate rows will be removed, but with large tables, this solution will require additional space of the same magnitude as the original table. The second approach doesn't require extra space as it removes duplicate rows directly from the table. It uses a ranking function like row_number() to assign a row number to each row.

How to use EXISTS and NOT Exists in SQL? Example Query and Tutorial

Hello Guys, you might have heard about how useful the EXISTS clause is helpful in writing sophisticated queries. Still, at the same time, I have also seen that many programmers struggle to understand and use EXISTS and NOT EXISTS clauses while writing SQL queries.  If you are one of them, then you have come to the right place. Today you will learn how to use the EXISTS clause in SQL by picking up a real-world example and an excellent SQL exercise from the LeetCode. Suppose that a website contains two tables, the Customers table, and the Orders table. Can you write an SQL query to find all customers who have never ordered anything?

10 Best Courses Of Brad Traversy on Udemy to Learn Web Development

Hello guys, if you are looking for best web development courses then learning from Brad Traversy is a great idea. He is one of the most engaging instructor on Udemy and having attended his web development courses on Udemy and watching his crash courses on Youtube, I really liked his crystal clear teaching style. A lot of you asked me about the best web development courses so I decided to compile all of his best courses into one article and here we are. But, before we get to the 10 best courses of Brad Traversy, let me tell you who he really is and why he is one of the most popular instructors on Udemy.

5 Examples of GROUP BY Clause in SQL with Aggregate Functions

There is no doubt that SQL is an essential skill and every programmer, developer, DevOps, and Business analyst should know SQL. If you want to learn SQL from scratch then you have come to the right place. Earlier, I have shared many SQL interview questions and the best SQL courses for beginners, and today, I am going to share some GROPU By examples in SQL to write aggregation queries. THE GROUP BY clause in SQL is another important command to master for any programmer. We often use the GROUP BY command along with a select clause for reporting purposes, since the GROUP BY clause is mainly used to group related data together it's one of the most important SQL commands for reporting purposes. 

What is difference between SQL, T-SQL and PL/SQL? [Answered]

Today, we are going to see another common and interesting SQL interview question, what is the difference between SQL, T-SQL, and PL/SQL? It is also one of the most common doubts among SQL beginners. It's common for programmers to think that why there are many types of SQL languages, why not just single SQL across DB? etc. Well, let's first understand the difference between SQL, T-SQL, and PL/SQL, and then we will understand the need for these dialects. SQL is standard for querying, inserting, and modifying data in a relational database. It is categorized into DDL and DML and is powerful enough to create database objects e.g. table, view, stored procedure, and can perform CRUD operation (SELECT, INSERT, UPDATE, and DELETE) query.

3 ways to learn MERN stack in depth in 2022

Hello guys, if you want to learn MERN Stack in 2022 but not sure where to start then you have come to the right place. Earlier, I have shared best courses to learn MERN Stack and in this article, I will share 3 ways to learn MERN stack from scratch. If you don't know MERN stack is one of the most popular and widely used web development stacks in the world. MERN stack uses React on the client-side while Node.js with Express.js on the server-side and MongoDB is used as the database. All the four technologies used in the MERN stack are widely used and because of this, their combination is also very popular.

How to check for Null in SQL Query? IS NULL Example Tutorial

One of the most common SQL Interview questions on Programming interviews is to select some rows from a table that also contains null values. Since many SQL developers are used to using = and != operator on WHERE clause, they often tend to forget the fact that column allows NULL or not. Using = or != is perfectly fine if your column has NOT NULL constraint and you know for sure that there are no NULL values in that column, but it does contain NULLs then your SQL query will return the incorrect result at times. This is one of the most common mistakes but at the same time hard to find SQL bugs if it managed to get into the real environment. In this article, you will learn the right way to check NULL values in SQL queries using IS NULL and IS NOT NULL predicates.

How to Find Duplicate values in a Table? SQL GROUP BY and Having Example| Leetcode Solution

Hello guys, if you are wondering how to find duplicate values in a table then don't worry, there are many ways to find duplicate rows or values from a given table. For example, you can use the GROUP BY and HAVING clause in SQL with count function to find all the rows which has same values for a particular column and then filter out rows where count is just one, I mean unique values. This way you can find all the duplicate from a given table. Using group by you can create groups and if your group has more than 1 element it means it's kind of duplicate. For example, you need to write a SQL query to find all duplicate emails in a table named Person. This is a popular SQL Query interview question as well as a Leetcode problem. You can see that email a@b.com is a duplicate email as it appears twice in the table. 

Java 8 forEach() Loop Example

Java 8 has introduced a new way to loop over a List or Collection, by using the forEach() method of the new Stream class. You can iterate over any Collection like List, Set, or Map by converting them into a java.util.sttream.Stream instance and then calling the forEach() method. This method performs given operation on every element of Stream, which can be either simply printing it or doing something else. Since stream can be sequential or parallel, the behavior of if this method is not deterministic if used with a parallel stream

Top 10 Google Interview Questions for Software Engineer - Books, Resources

Hello guys, if you are preparing for Google's Software Development Engineer roles and looking or Google Software Interview questions then you have come to the right place. Earlier, I have shred Amazon and Microsoft Interview questions and in this article, I am going to share popular questions from Google Interviews. These Google interview questions are some of my favorites collected from different sources. Every Programmer knows that Google is one of the best technology companies and its dream for many software developers to work for Google, but at the same time interview process at Google is very tough and only a few genuine intelligent programmers get through their interview process

Difference between Transient, Persistent, and Detached Objects in Hibernate

In the Hibernate framework, an entity can be in three states, transient, persistent, and detached. When an object is in a transient state, it is commonly referred to as a transient object, similarly, if it is in persistence and detached state, it is known as a persistent and detached object. When an entity is first created using the new operator like new User() and not associated with Hibernate session like you haven't called session.save(user) method then it is known as a transient object. At this stage, Hibernate doesn't know anything about this object and the object doesn't have any representation in the database like a corresponding row in the User table.

Top 5 programming languages for Artificial Intelligence or AI Development

Hello guys, if you want to do AI Development or want to create Artificial Intelligence based apps and looking for best programming language then you have come to the right place. Earlier, I have shared best programming language for web developmentapp development, and data science development and today, I am going to share best programming language for AI Development. All programming languages are not created equal. Only a handful of programming languages remain and serve the community out of countless. The programming languages we'll be discussing presently have stood the test of time. For decades, they've been used for a variety of undertakings.

10 Reasons to Learn SQL for Programmers and Software Developers in 2022

Hello guys, if you are on the fence whether to learn SQL or not, or want to learn SQL but not sure whether learning SQL is worth your time and effort then you have come to the right place. Earlier, I have shared best SQL books and courses to learn SQL for Beginners and in this article, I am going to share 10 Reasons to learn SQL. From my 18 years of experience as Software developer and 12 years as a blogger I can safely say that you should learn SQL. In all of these times, I have constantly worked with SQL in my projects and job. While database changes form Oracle to MySQL, to SQL Server, and now PostgreSQL but the knowledge of SQL still pays off. 

How Long does It take To Learn Linux?

Hello guys, if you want to learn Linux but not sure how to start then you have come to the right place. Earlier, I have shared best places to learn Linux and best Linux books for beginners and Linux interview questions with answers and in this article, I Am going to share the best way to learn Linux and answer frequently asked question, how long does it take to Learn Linux. In general, you can learn Linux in one weekend but it can take weeks before you become a Linux master as there are a lot of Linux commands and concepts to master. In this article, I will answer this question objectively depending upon your goal, for example, for a developer it can take a  week to Learn Linux but for System Admin it could be months because they need more in-depth knowledge. 

Top 20 PostgreSQL Interview Questions With Answers

Hello guys, if you are preparing for Postgres Interview or a Java development role where PostgreSQL skills are needed but not sure how to prepare, what to prepare etc and looking for PostgreSQL Interview questions with answers then you have come to the right place. Earlier, I have shared 50 SQL Phone interview questions and 6 SQL Query questions and in this article, I am going to share frequently asked PostgreSQL questions with answers. You can use these questions and answers to prepare well for your Job interview and you can also learn essential PostgreSQL concepts by going through these questions.

How to return JSON, XML or Thymeleaf Views from Spring MVC Controller?

Hello guys, if you are working in Spring based web application and you wan to return JSON, XML, or Thymeleaf View from your application but don't know how to do that then you have come to the right place. Earlier, I have shared how to create REST API in Spring and In this tutorial we are going to discuss, how to return to JSON, XML, or Thymeleaf view from the Spring MVC controller. To ensure that your payload from the MVC endpoint, ensure your project is using the Spring Boot starter web. You can use the following dependency to include spring boot starter web in your project. 

How to validate incoming payload on Spring MVC controller? Example Tutorial

Hello guys, if you are wondering how to validate incoming request payload in Spring MVC based Java web application then you have come to the right place. Earlier, I have sharebest Spring MVC courses for Java developers and In this tutorial, we are going to discuss how to validate incoming payloads on the Spring MVC controller which is also can be defined as validating the request body in the RESTful web services. So first let's have a look at validating the request body in the RESTful web services. Think you have a JSON post request and you are going to consume it. There should be a validation to this post request as the requested input will be zero or in a not accepted format.

10 Best Udemy Courses of Stephane Maarek to Learn AWS and Kafka in 2022

Hello guys, if you are learning AWS and Apache Kafaka and looking or best online courses or you have heard about Stephane Maarek and his popular Udemy courses on AWS certification, Apache Kafka, and Google gRPC but not sure whether to join or not then you have come to the right place. Earlier, I have shared best AWS courses and best Kafka courses where I have featured Stephane's Udemy courses but in this article, I am going to share all of the best Udemy courses by Stephane Maarek on Udemy which you can join in 2022. But, before we get to the 10 best Udemy courses of Stephane Maarek, let me tell you who Stephane really is and why his courses are really popular on the platform.

[2022 Udemy Course Review] - The Web Developer Bootcamp by Colt Steele

Hello guys, if you want to learn Web Development and looking for a beginner friendly course or you have heard about Colt Steele's Web Development 2022 Bootcamp course on Udemy and wondering whether its wroth to join this course in 2022 or not then you have come to the right place. In the past, I have shared best web development online courses and in this article, I will share my 2 cents on Colt Steel's popular Web Developer bootcamp course on Udemy. Learning web development nowadays is such a huge work to do because you are going to learn not only to design the front-end or the web interface but you are also going to learn the back-end as well as design and build the database system for that website or online service and that’s what’s known as Full-stack web developer

Top 5 Online Courses to Learn C# in 2022 - Best of Lot

If there is one programming language that deserves more credit, than it currently receives from developers, then it would be Microsoft's C# or C-Sharp. When we talk about popular programming languages, we mostly talk about how Java is ruling the programming world for the last three decades, how JavaScript changed the web world, or how Python has taken over all programming languages in the last couple of years, but we seldom mention C#, which is silently providing jobs and making a career with .NET, Unity, and became a preferred choice for creating desktop GUI applications. If you follow the StackOverflow survey, then you know that C# is always one of the top 5 Programming languages rated by programmers, and this year also close to 31.0% has said that they use C#, which is significant.

Top 5 Online Courses to Learn Maven in 2022 - Best of Lot

The Apache Maven or commonly known as just "Maven," is an essential tool for Java Programmers. It allows you to build your project, manage dependencies, generate documentation, and a lot more. I can vouch for Maven's usefulness because I have come from the pre-Maven world of Software development, where you need to manage all the JAR files required by your project. It may seem easy to you that just download the JAR file but it's not so easy in practice.  For example, you added a new library in your project say Spring framework which also needs log4j but you thought log4j is already there so you didn't do anything, only to realize that your application is not starting anymore and throwing long and convoluted errors. This can happen because a version mismatch like Spring needed a higher version of log4j than available in your project.

10 Best Udemy Courses of Neal Davis to Learn AWS and Cloud Computing in 2022

Before getting to the 10 best Udemy courses of Neal Davis, let me tell you who Neal Davis really is. Neal Davis is one of the most popular instructors on the Udemy platform. He has taught more than 350,000 students on Udemy and more than 77,000 of those students have given him a 5-star rating. Neal Davis is a highly experienced AWS Cloud Solutions Architect, a successful IT instructor, and the founder of Digital Cloud Training. He has been working in IT for more than 20 years in a number of different roles like support and architecture. 

Top 10 Coursera Certifications and Courses to Learn Python in 2022 - Best of Lot

While there are many online platforms out there to learn Python Programming from scratch, Coursera is one of the most popular and reputed websites to learn Python for beginners. The best thing about Coursera is that it provides access to courses taught at the World's top universities like the University of Michigan and Rice University, one of the top 20 universities in the USA. It has also got the best Python certifications offered by the world's most reputed companies like IBM and Google and the world's top universities like the University of Michigan and Johns Hopkins University. That's why many people flock to Coursera to learn Python and other Computer Science and Software Engineering skills.

Top 5 Project-Based Courses to learn Coding with Java, Python, and JavaScript in 2022 - Best of Lot

Hello guys, if you are aiming to learn programming and code in 2022 with Java, Python, or JavaScript, the top 3 programming languages of the world then I suggest you join a project-based course. These are the courses where you will learn things by doing and I think that's the best way to learn programming and coding. Reading a book is Ok, watching videos are also Ok but they will not make you a Programmer or Coder, you must code to become a coder and these project-based courses give you that opportunity.