Java Coding Challenges

Java coding challenges - find palindrome number, sort 1 million integers in Big O(1) time, check number is prime, anagram buckets, reverse a string, check Armstrong number, check factorial of a number, pangram sentence.

Prime number checker in Java

Upasana | November 20, 2022 | 3 min read | 629 views | Java Coding Challenges

In this article we will learn if a given number is prime or not. The solution presented here may not be best optimized, but it should be sufficient from interview point of view.

Given a collection of 1 million integers, all ranging between 1 to 9, sort them in Big O(n) time

Upasana | November 22, 2020 | 2 min read | 669 views | Java Coding Challenges

This is a typical Integer Sorting problem with a constraint that the number range to sort is very limited in spite 1 million total entries. Integer Sorting with limited range is achieved efficiently with Bucket Sorting.

Reverse a string using recursion in Java

Upasana | November 21, 2020 | 1 min read | 105 views | Java Coding Challenges

In this article, we will write a program to reverse character positions in a given string using recursive approach.

Reverse position of words in a string using recursion

Upasana | November 20, 2020 | | 83 views | Java Coding Challenges

In this article, we will write a program to reverse position of words in a given string using recursive approach.

Java Program to find Factorial of a number

Upasana | October 17, 2020 | 2 min read | 382 views | Java Coding Challenges

Discussion on different approaches to calculate factorial of a given number - recursion, iterative approach and Java 8 stream approach

Pangram checker in java

Upasana | September 12, 2020 | 2 min read | 3,206 views | Java Coding Challenges

A pangram is a sentence containing every letter in the English Alphabet (a-z). Pangram example: The quick brown fox jumps over the lazy dog

Anagrams string checker in Java

Upasana | July 24, 2020 | 2 min read | 1,334 views | Java Coding Challenges

Two strings are called anagrams if they contain same set of characters but in different order. Here we will evaluate anagrams using a Java Program

Armstrong Number in Java

Upasana | July 24, 2020 | 2 min read | 794 views | Java Coding Challenges

In an Armstrong number (also known as _narcissistic number_), is a number that is the sum of its own digits each raised to the power of the number of digits

Palindrome checker in Java

Upasana | July 24, 2020 | 2 min read | 1,394 views | Java Coding Challenges

A palindrome is a word, number, or other sequence of characters which reads the same backward as forward, such as madam, racecar or 454.