Top K Frequent Items
This post explores a functional style implementation in Scala and Java to a famous interview question to find the top k frequent items in an array. Beware the functional implementation may not be …
Read more →
This post explores a functional style implementation in Scala and Java to a famous interview question to find the top k frequent items in an array. Beware the functional implementation may not be …
Read more →
In the previous post - Why Functional Programming Matters, we explored the design of a high-throughput timed buffered reader in Scala using cats-effect. In this post, we implement the same in Java and …
Read more →The billion dollar mistake has been committed already. No going back. But it is not necessary to keep repeating it. Oh, I am talking about the infamous null. Would Java’s Optional come to the …
Read more →Yes, there is a difference. Although both produce the same end effect, an iterator is not the same as a generator. The difference is in the way it is implemented and also consumed.
Read more →New things are not always instantly accepted. Beyond skepticism, new things challenge the comfort people are accustomed to. JINQ wasn’t particularly welcomed. It was either discarded as unknown …
Read more →
JINQ (Java INtegrated Query) is an ultra minimalistic library inspired from and mimicking the .NET LINQ. While LINQ is a language level construct, JINQ is composed of types - classes and methods, but …
Read more →I am really sorry if I tricked you into believing that Java is offering partial class feature. Unfortunately, Java doesn’t. Maybe never will. But I am going to talk about a workaround also presenting …
Read more →What are your thoughts on the following piece of code? public String someGibberishMethod() { int length = someMethodReturningLength(); int sum = 0; for (int index = 0; index < length; ++index) { // …
Read more →It all began when I wanted to return more than one value from one of the methods. Although my attempts ended futile, it was fun exploring and musing how things could have been. There are at least a …
Read more →In the recent interviews, I asked the candidates the following question: Is there a difference that I need to consider in the following declarations? Both allocate fixed size array to store integers: …
Read more →