Problem solving is the essential skill. So what is the good way to improve this skill? So many developers with good problem solving skill tell us that we need to train this…
Ruby Performance Optimization
How do people work good in the morning and performance decreases gradually until Evening? If we don’t mention the spirit cause computers don’t have it (lol), so the cause is the amount…
Ruby on rails with programing to interface pattern
Developing methods of class for other classes to use, that is interface. Interfaces should not be changed time by time. Because that is knowledge which the other classes know about this class. Those are…
How to develop realtime feature using action cable in rails and angular
Imagine that we have a rails application which have been running for more than six year. Suddenly, we have a requirement about realtime feature. We have two choices. The first one is…
Graphql – modern query language for API
Actually, in my opinion there is nothing best. Anything has its own advantages and disadvantages. It depends on the context we apply the proper technology, design patterns, best practices etc. Some benefits…
Open/Closed principle with hook methods
I actually intended to add this post to old article about the same title. However, I don’t want to make an article too long. Regarding to this principle, there are so many…
Open/Closed Principle
Last article I introduced S.O.L.I.D in coding. I found that I didn’t really dive deep in each principle as I thought. Programming is not about the chain of theories. We need to…
SOLID – Fundamental OOP Principles
S – Single Responsibility Whenever we create a class or method or even variable, we create each one with only one responsibility. If we create “sing” method, we can’t implement “dance” behavior…
Find Closest Value in BST
Write a function that takes in a Binary Search Tree (BST) and a target integer value and returns the closest value to that target value contained in the BST. You can assume…
First Duplicate Value
Given an array of integers between 1 and n, inclusive, where n is the length of the array, write a function that returns the first integer that appears more than once (when…