# 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.

#### Given a collection of 1 million integers, All ranging between 1 to 9, how would you sort them in Big O(n) time

###### Carvia Tech | August 03, 2019 | 2 min read | 231 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.

#### How to check if the given number is palindrome in Java

###### Carvia Tech | August 03, 2019 | 2 min read | 65 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.

#### Find two numbers of which the product is maximum in an array

###### Carvia Tech | May 27, 2019 | 1 min read | 26 views | Java Coding Challenges

We can easily find two number in an array whose product is maximum by sorting the input integer array in descending order first and then multiplying the first two numbers.

#### Check a number is Prime: Java Coding Problem

###### Carvia Tech | May 24, 2019 | 3 min read | 41 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.

#### Create anagram buckets from a given input array of words

###### Carvia Tech | May 18, 2019 | 2 min read | 34 views | Java Coding Challenges

Here we get an input array of words that contains anagram string, and we need to create buckets for all the anagrams words.

#### Java program to check if two strings are anagrams

###### Carvia Tech | May 18, 2019 | 2 min read | 49 views | Java Coding Challenges

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

#### Write a program to reverse a string using recursion in Java

###### Carvia Tech | May 18, 2019 | 1 min read | 50 views | Java Coding Challenges

In this article, we will write a program to reverse a string entered by a user.

#### Check if the given number is Armstrong Number in Java

###### Carvia Tech | May 18, 2019 | 2 min read | 42 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

#### Calculate factorial of a number in Java using recursion

###### Carvia Tech | May 18, 2019 | 1 min read | 39 views | Java Coding Challenges

the factorial of a number is calculated by formula `number * (number -1)` till zero and since the value of factorial zero is 1, it acts as a base case in the recursive version of the factorial method.

#### How will you check if a given sentence is a pangram

###### Carvia Tech | May 18, 2019 | 2 min read | 52 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