Blog Archives
1 2 3

Queue from scratch Java example

Q. If Java did not have a Queue implementation, how would you go about implementing your own? A. A queue can be implemented in a similar fashion to a stack …



Quick Sort in Java

Q. Is there a more efficient sorting algorithm than bubble sorting? A. Although bubble-sort is one of the simplest sorting algorithms, it’s also one of the slowest. It has the …



Recursion Vs Tail Recursion

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

“AAA rating”

A1.

Iteration



Single Pointer: Partitioning around a pivotal number

Q. How will you partition the following numbers 7 3 6 8 2 9 5 4 around the pivotal number of 5 so that the lower values are in front …



Sorting by reversing the entries in Java

Q. You need to sort an array of integers by repeatedly reversing the order of the first several elements of it. you always have to flip from the beginning element, …



Stack from scratch Java example

Q. If Java did not have a Stack implementation, how would you go about implementing your own? A. Determine the backing data structure (e.g. array, linked list, etc). Determine the …



Swap 2 values & bubble sort in Java

Q1. Can you write an algorithm to swap two values? A1.



Swapping, partitioning, and sorting algorithms in Java

Q1. Can you write an algorithm in Java to swap two variables? A1.



Two Pointers: Partitioning around a pivotal number

Q. How will you partition the following numbers 7 3 6 8 2 9 5 4 around the pivotal number of 5 so that the lower values are in front …



1 2 3

300+ Java Interview Questions - FAQs

Tutorials on Java & Big Data