A Good Free Alternative To Collabedit

Many of us use Collabedit frequently to conduct technical interviews. It is a easy to use online code editor where code can be shared between interviewer & interviewee. It supports most of the common programming languages available like Java, C++, Python, PHP or JavaScript. But recently I have seen Collabedit having server problems frequently. Sometimes the website … Read more

Working Java Program For Largest Rectangle in Histogram

Here we will try to find a solution for largest rectangle in histogram problem. We will use “LeetCode 84. Largest Rectangle in Histogram” problem as an example here. It says: Given an array of integers heights representing the histogram’s bar height where the width of each bar is 1, return the area of the largest … Read more

Java Code Implementation For All Unique Permutations

We will try to find all possible permutations of a given string. To understand this problem, we will use “LeetCode problem 47. Permutations II” and solve it. The problem states that: Given a collection of numbers, nums, that might contain duplicates, return all possible unique permutations in any order. Input: nums = [1,1,2] Output: [[1,1,2], … Read more

Log When JDBC Connection Is Acquired And Released

We are fond of one db session per request pattern. For web applications with JPA & Hibernate, it is good strategy in common cases. But for some long-running requests (definition of long-running depends on your use case, maybe 500 ms or 2 s), we need to tweak when we are actually acquiring a db connection … Read more

Evaluate Reverse Polish Notation In Java

We will evaluate postfix expression here. Postfix expression is also called Reverse Polish Notation. This is a common LeetCode problem “150. Evaluate Reverse Polish Notation”. Let’s take an example & see how postfix expression works. Input: [“6”, “1”, “-“, “3”, “*”] Output: 15 Postfix means operator comes after the two operands. If you see the … Read more