Blog Archives
1 2 3 4 5 6 7 8 9

5b – Writing a simple SQL where clause parser in Java – Part 2

This extends Writing a simple SQL where clause parser in Java – Part 1. In the next post, let’s look at the parsing to an Abstract Syntax Tree (i.e. AST …



9 Java Data structures best practices

#1: Choose the right type of Java data structure based on usage patterns

like fixed size or required to grow, duplicates allowed or not, ordering is required to be maintained …



Beginner array coding problems in Java

More Data Structure and Algorithms Coding Questions and answers in Java.

Q1. Write a program that allows you to create an integer array of 5 elements with the following …



Big O notation questions and answers with Java examples

The Big O notation and Java data structures go hand-in-hand in coding tests & job interviews Q1. What do you know about the big-O notation and can you give some …



Class invariant & designing by contract in Java

Q1. What is a class invariant? A1. Class invariant is — what must be true about each instance of a class? If an invariant fails then there could be a …



Convert Arrays to Lists and lists to array with real life example(s)

1. Why do you want to convert arrays to lists? 1. Arrays don’t play well with generics. 2. Arrays are of fixed size, and if you want to add or …



Convert Java Date/Time to String & String back to Date/Time

#1. Why convert a Date to String & a String back to Date

(a) Convert a String input from say a file date, so that you can perform operations like …



Converting a BST Tree to a List in Java

This is the reverse of Converting an Array/List to BST in Java. It is a very common task to convert a collection type A to B as a developer. More …



Converting an Array/List to BST in Java

Q. What is a BST? A. BST stands for Binary Search Tree, sometimes called ordered or sorted binary trees. This is a type of data structures that store “items” such …



Converting String to Amount and Amount to String

#1. Does Java have a “Money” class? No. This will change in Java 9 with the “Money API”. JSR 354 defines a new Java API for working with Money and …



Fibonacci number

Q1. Can you write a function to determine the nth Fibonacci number? The Fibonacci numbers under 2000 are : 0, 1, 1, 2, 3, 5, 8, 13, 21, 34, 55, …



Fibonacci number with caching and Java 8 FP

Complimenting Fibonacci number coding – iterative and recursive approach, we can improve performance by caching. If you run this



Find 2 numbers from an array that add up to the target

Q1. Given an array of integers, find two numbers such that they add up to a specific target number? For example, Given numbers: {2, 3, 8, 7, 5} Target number: …



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