Tag: java

Builder in Java and Ruby

Builder in Java and Ruby

Recently I’ve been context-switching between 2 different projects – one in Ruby and the other in Java – and I got a chance to utilize Builder Pattern (to be precise, it’s a variant of the classic builder pattern) in Java, and get impressed by how much simpler the solution could possibly be in Ruby. The…

Read More Read More

A Generic Solution to K-Sum Problems

A Generic Solution to K-Sum Problems

K-sum problems is a type of algorithm problems I encountered when preparing for job interviews.  Problem statement: Given an array of integers, return all unique combinations of k numbers such that they add up to a specific target. (Assuming k < number of elements in the given integer array) ( The signature of the function will…

Read More Read More