Blog Archives

♦ Is it a valid binary search tree (BST) ?

Q. Write code test if a given tree is a binary search tree (i.e. BST)? A. A binary search tree (BST) is a binary tree where each node satisfies the following conditions: 1) key in any node is larger than the keys in all nodes in that node’s left subtree…...

Members Only Content

This content is for the members with any one of the following paid subscriptions:

30-Day-Java-JEE-Career-Training, 90-Day-Java-JEE-Career-Training, 180-Day-Java-JEE-Career-Training, 365-Day-Java-JEE-Career-Training, 60-Day-Java-JEE-Career-Training, 2-Year-Java-JEE-Career-Training and 10-Day-Java-Interview-Refresher

Want to evaluate the quality of the contents to see if they will add value to you?

Click Here and check the contents with Try.

Log In | Register
Posted in Coding, member-paid, Tree structure

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 technique used to reduce the number of bits needed to send or store a message. For example, if you have…...

Members Only Content

This content is for the members with any one of the following paid subscriptions:

30-Day-Java-JEE-Career-Training, 90-Day-Java-JEE-Career-Training, 180-Day-Java-JEE-Career-Training, 365-Day-Java-JEE-Career-Training, 60-Day-Java-JEE-Career-Training, 2-Year-Java-JEE-Career-Training and 10-Day-Java-Interview-Refresher

Want to evaluate the quality of the contents to see if they will add value to you?

Click Here and check the contents with Try.

Log In | Register
Posted in Can you write code?, Coding, member-paid

♦ 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 proper divisors. The smallest perfect number is 6, which is the sum of 1, 2, and 3. Other perfect numbers…...

Members Only Content

This content is for the members with any one of the following paid subscriptions:

30-Day-Java-JEE-Career-Training, 90-Day-Java-JEE-Career-Training, 180-Day-Java-JEE-Career-Training, 365-Day-Java-JEE-Career-Training, 60-Day-Java-JEE-Career-Training, 2-Year-Java-JEE-Career-Training and 10-Day-Java-Interview-Refresher

Want to evaluate the quality of the contents to see if they will add value to you?

Click Here and check the contents with Try.

Log In | Register
Posted in Can you write code?, Coding, member-paid

05: ♦ Finding the 2nd highest number in an array

Requirements gathering Does the array allow duplicates? If duplicates are allowed, then do you need to report duplicates? For example, in {2,4, 6, 3, 6, 5}, is 6 or 5 the second highest? Analysis If duplicates are not allowed, sort the array (Arrays.sort(…)) and get the second last element, which…...

Members Only Content

This content is for the members with any one of the following paid subscriptions:

30-Day-Java-JEE-Career-Training, 90-Day-Java-JEE-Career-Training, 180-Day-Java-JEE-Career-Training, 365-Day-Java-JEE-Career-Training, 60-Day-Java-JEE-Career-Training, 2-Year-Java-JEE-Career-Training and 10-Day-Java-Interview-Refresher

Want to evaluate the quality of the contents to see if they will add value to you?

Click Here and check the contents with Try.

Log In | Register
Posted in Can you write code?, Coding, Java 8, member-paid

08: ♦ Write code to add, subtract, multiply, and divide given numbers?

A trivial coding example (i.e. a Calculator) tackled using the following programming paradigms in Java not only to perform well in coding interviews, but also to learn these programming paradigms. Approach 1: Procedural Programming Approaches 2 – 4: Object Oriented Programming Approach 5: Functional Programming (Java 8) Approach 1: Procedural

Read more ›

Posted in Can you write code?, Coding, Java 8, OOP

♥ 30+ Java Code Review Checklist Items

This Java code review checklist is not only useful during code reviews, but also to answer an important Java job interview question, Q. How would you go about evaluating code quality of others’ work? You also learn a lot from peer code reviews. What has been written well? Why was

Read more ›

Posted in Code Quality, Coding

Part 4: Java Tree structure interview and coding questions

This is an extension to Java Tree structure interview questions and coding questions — Part 3 where recursion was used for FlattenTree interface. Let’s use iteration here. Step 1: The FlattenTree  interface.

Step 2: The iterative implementation IterativeFlattenTree. This uses a LIFO stack to push and pop Tree elements.

Step 3: Finally,…...

Members Only Content

This content is for the members with any one of the following paid subscriptions:

30-Day-Java-JEE-Career-Training, 90-Day-Java-JEE-Career-Training, 180-Day-Java-JEE-Career-Training, 365-Day-Java-JEE-Career-Training, 60-Day-Java-JEE-Career-Training, 2-Year-Java-JEE-Career-Training and 10-Day-Java-Interview-Refresher

Want to evaluate the quality of the contents to see if they will add value to you?

Click Here and check the contents with Try.

Log In | Register
Posted in Coding, member-paid, Tree structure

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

Output

and you can see “fibonacci(3)” is repeated 2 times, “fibonacci(2)” is repeated 3 times, and so on. If you pick a larger number like 21, there will be…...

Members Only Content

This content is for the members with any one of the following paid subscriptions:

30-Day-Java-JEE-Career-Training, 90-Day-Java-JEE-Career-Training, 180-Day-Java-JEE-Career-Training, 365-Day-Java-JEE-Career-Training, 60-Day-Java-JEE-Career-Training, 2-Year-Java-JEE-Career-Training and 10-Day-Java-Interview-Refresher

Want to evaluate the quality of the contents to see if they will add value to you?

Click Here and check the contents with Try.

Log In | Register
Posted in Can you write code?, Coding, FP, Java 8, member-paid
Page 1 of 41234
1050+ subscribers. Reviews | Free Contents. 220K+ page views/month. Certified or not, you will be challenged with industrial strength problems to solve at work & job interviews.

600+ Interview Q&As – ♥ Free, ♦ FAQs

open all | close all

200+ FAQs for Quick Interview Prep

open all | close all

16 Technical Key Areas to standout

open all | close all

80+ Tutorials for self-taught projects

open all | close all

100+ pre-interview coding tests

open all | close all

How good are your …..?

open all | close all