Interview
- 28 September
Number guessing game in java
In this article, we will implement Number guessing game in java. The number guessing game is based on a concept where player guesses a number between a range. If player guesses the exact number then player wins else player looses the game. Since this game provides limited attempts, so, player must guess the number with […]
- 17 March
PriorityQueue in Java 8
In this post, we will see about Java 8 PriorityQueue. When the objects are supposed to be processed on the basis of their priority, in that scenario we use PriorityQueue. It’s a special type of queue (also, unbound queues) where the elements can be ordered either as per their natural ordering or based on a […]
- 06 October
Convert decimal to binary in java
In this post, we will see how to convert decimal to binary in java. There are lot of ways to convert decimal to binary in java.Let’s explore them one by one. Using Integer.toBinaryString() method You can simply use inbuilt Integer.toBinaryString() method to convert a decimal [crayon-676771947ee97869013249/] Output: Binary representation of 12 : 1100 Binary representation […]
- 05 October
Print prime numbers from 1 to 100 in java
In this program, we will print prime numbers from 1 to 100 in java. A prime number is a number which has only two divisors 1 and itself. To check if the number is prime or not, we need to see if it has any other factors other than 1 or itself. If it has, […]
- 29 May
How to print even and odd numbers using threads in java
In this post, we will see how to print even and odd numbers using threads in java. see also: How to print sequence using 3 threads in java Problem You are given two threads. You need to print odd numbers using one thread and even numbers using another thread.You need to print in natural order […]
- 18 April
Minimum Number of Jumps to reach last Index
If you want to practice data structure and algorithm programs, you can go through Java coding interview questions. In this post, we will see how to find Minimum Number of Jumps to reach last Index. Problem Given an array A of positive integers possibly zeroes, every index indicating the maximum length of a jump that can […]
- 31 March
FizzBuzz program in java
In this post, we will see how to program FizzBuzz in java. Fizzbuzz is a fun game played generally by school children. It is simple game in which when your turn comes, you need to say the next number. So here are rules of the game: If number is divisible by 3, then you need […]
- 10 March
Print pyramid pattern: 1 3*2 4*5*6 pattern in java
In this post, we will see how to print the following pyramid pattern. Problem Input : n = 4 Output : 1 3*2 4*5*6 10*9*8*7Input : n = 5 Output : 1 3*2 4*5*6 10*9*8*7 11*12*13*14*15 Solution If you notice the pattern we need to print odd rows in increasing order and even rows in […]
- 20 February
Inorder Successor in a Binary Search Tree
If you want to practice data structure and algorithm programs, you can go through Java coding interview questions. In this post, we will see how to find Inorder Successor in a Binary Search Tree. Problem Given a Binary Search Tree and a target node value. Find the Inorder successor of the given node value in the […]