Blog Archives
1 2 3 4 5 9

00: Tree from a list & flattening it back to a list in Java

Hierarchical data with parent & child relationships are very common, and Java collection does not have a Tree data structure, hence … … Read more ›...

Members Only Content
Log In Register Home


01: Can you design classes & interfaces using OO?

Q1. How would you go about designing a “farm animals” application where animals like cow, pig, horse, etc move from a … … Read more ›...

Members Only Content
Log In Register Home


01: String parsing & date formatting – complete the given code

Q. Complete the method “changeDateFormat(String paragraph)” which takes a string input containing dates in mm/dd/yyyy format and converts them to …

Read more ›



01: Tree flattening example in Java

Q. Traverse the tree in depth and return a list of all passed nodes. It should handle different data types as … … Read more ›...

Members Only Content
Log In Register Home


01: What is wrong with following Java code snippets? Auto-unboxing, switch, short circuit & exception

Auto-unboxing, switch, short circuit logical operators & exception handling are core Java basics that sometimes lead to obscure errors if not …

Read more ›



02: Scenarios based Java OO concepts & GoF design patterns – naive Template Method pattern

Extends Can you design classes & interfaces using OO?. Only experience, and asking the right questions can teach you what …

Read more ›



02: Tree structure – calculate average recursively & iteratively in Java

Q. Complete the following “TreeProcessingImpl” class ….. so that the unit tests shown below pass? Skeleton Code Unit Tests A. Solution …… Read more ›...

Members Only Content
Log In Register Home


02: Working with Java Collections – Complete the given code

Q. Complete the method “canAttendAll(Collection seminars)” which takes a collection of seminar objects with start and end timestamps, and the … … Read more ›...

Members Only Content
Log In Register Home


03: Scenarios based Java OO concepts & GoF design patterns – Strategy Pattern

The following post improves on the design flaws listed in the previous post entitled 02: Scenarios based Java OO design & … … Read more ›...

Members Only Content
Log In Register Home


03: Tree navigation – is a BST Tree?

Q. Complete the method “isValidBST(Node root)” which takes a “Tree node” as an input to evaluate if the input is … … Read more ›...

Members Only Content
Log In Register Home


03: Tree traversal algorithms in Java

Q1. What are the different binary tree traversal mechanisms? A1. Traversing a tree means visiting all the nodes of a tree … … Read more ›...

Members Only Content
Log In Register Home


03: Understanding Big O notations

Q. Have you seen job advertisements requiring Java candidates to work in real-time or high volume transaction processing systems? If you … … Read more ›...

Members Only Content
Log In Register Home


03: What is wrong with this code? Data types & equals( ) Vs, hashCode( ) contract

Q6. What is wring with this code? A6. Infinite loop at due to sum != 1.0. Using floating point variables like … … Read more ›...

Members Only Content
Log In Register Home


1 2 3 4 5 9

Java FAQs to Fast-track & Go places

Java Interview Q&As

Top