Blog Archives

1. Set up environment for home coding assignments

Step 1: Setup Java, Maven, and SonarQube

1. Java: Latest possible version. Setting up Java, Maven, and eclipse.

2. Maven 3: For building. Setting up Java, Maven, and eclipse.

3. SonarQube: For code quality. SonarQube with Maven Tutorial – Code Quality for Java developers.… Read more ...



2. Implement an in-memory LRU cache in Java with TTL

Q: Implement an in-memory cache in Java without using any frameworks. The basic requirements are – The TTL (Time To Live) for the cache items are ~10 seconds [just for demo]. – The system has plenty of memory. – Each item may or may not be accessed during the TTL….… Read more ...



3. Multi-Threading – Create a simple framework where work items can be submitted

Q: Create a simple framework where work items can be submitted using Java 8 or later. Here are the use cases: #1: A work item is an instance of a class. #2: The definition of “parallelism” controls how many threads are created to execute the work items in parallel (aka…

Read more ...


4a. 10-digit phone number to produce a list of words matching first letters of the phone number

Q: Write a program that takes any 10-digit phone number and produces a list of words matching first letters of the phone number (2 – ABC, 3 – DEF, .. 9 – WXYZ). Use any free word list file from online.… Read more ...



4b. FP approach 10-digit phone number to produce a list of words matching first letters of the phone number

This makes use of the Functional Programming (FP) approach. Q: Write a program that takes any 10-digit phone number and produces a list of words matching first letters of the phone number (2 – ABC, 3 – DEF, .. 9 – WXYZ).… Read more ...



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

Problem Statement: How would you go about writing an SQL WHERE clause parser to evaluate a given condition against the given data in a Hashmap. For example:

Read more ...


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 logic). Step 5: Firstly the Expr interface that gets implemented by different expressions.… Read more ...



Simple caching Java application step by step

Problem Statement: How would you go about writing application in Java where employee id to department name is cached instead of reading from a database or an API. The cache needs to be refreshed every 1 minute.

Solution, step by step

Step 1: Firstly, a simplified config class that reads config values from a “.properties”… Read more ...



Don't be overwhelmed by the number of Q&As & tech stacks as nobody knows everything, and often key Q&As at the right moment makes a difference.

500+ Java Interview FAQs

Java & Big Data Tutorials

Top