Blog Archives
1 2 3 4 5 6 7 8 9

Find middle element of a LinkedList in one pass Java example

The SinglyLinkedList was created in the post “LinkedList creating from scratch in Java”. This extends “SinglyLinkedList” post. Q. How to find the middle node of a linked list in a …



Find pair of numbers with a given sum in Java

Q. Write a method which takes the parameters (int[ ] inputNumbers, int sum) and checks input to find the pair of integer values which totals to the sum. If found …



Find the first non repeated character in a given string input

Firstly, understand the problem, and write down any considerations & assumptions. Next write pseudocode if that helps. Considerations 1) Pre-codnition check for null or empty input. 2) Loop through the …



Finding the missing numbers Java example

Q. Can you write code to identify missing numbers in a given array of numbers?

Solution 1: Assuming that the given numbers are in order

Finding the missing number

Finding the missing number



Finding the perfect number

Q. Can you write code to output the perfect number between a given range? Definition: A perfect number is a positive integer that is equal to the sum of its …



Fizz Buzz

Q1. Write a program that prints numbers from 1 to 30, but for multiples of three print “Fizz” instead of the number and for the multiples of five print “Buzz”. …



Generating random numbers in Java

Q1. Can you write Java code to generate random numbers between a given range? A1. E.g. 0 and 9 or 5 to 35, and so on.



Graph from scratch Java example

Q. Java does not have a Graph implementation, how would you go about implementing your own? A. Graphs are data structures that represent arbitrary relationships between members of any data …



Graph from scratch Java example adjacent matrix approach

Q. Java does not have a Graph implementation, how would you go about implementing your own? A. Graphs are data structures that represent arbitrary relationships between members of any data …



HashMap from scratch Java example

Q. If Java did not have a HashMap implementation, how would you go about writing your own one? A. Writing a HashMap is not a trivial task. It is also …



How would you go about designing with UML diagrams

This extends 12 UML Interview Questions & Answers. Q1. How would you go about designing a system as described below? A barn that contains animals such as cows and horses. …



Huffman coding in Java

This is a very decent coding exercise to sharpen your coding skills. Nicely explained with diagrams and complete code. Q1. What is Huffman coding? A1. Huffman coding is a compression …



Iteration Vs Recursion in Java

Q1. Can you write a sample code that will count the number of “A”s in a given text “AAA rating“? Show both iterative and recursive approaches?
A1



1 2 3 4 5 6 7 8 9

300+ Big Data Interview Questions - FAQs

300+ Java Interview Questions - FAQs

Tutorials on Java & Big Data