Blog

Java Concurrency – Basic Concepts

Defining and Starting a Thread There are two ways to define a thread: Provide a Runnable object or Subclass Thread. The first approach is more flexible and applicable to high-level thread concurrency APIs. It is also more general because the Runnable object can subclass a class other than Thread. Synchronization Synchronization can introduce thread contention, which occurs when two or more threads try […]

Senior Java Software Engineer Interview Notes – Part 3

Introduction These are the interview questions that were asked for the Software Engineer role in Bally’s Interactive. This post mentions Java, Design Patterns, REST, and Testing. Java What is immutability? An object is considered immutable if its state cannot change after it is constructed. They are helpful when writing secure code as you don’t need to worry […]

Senior Java Software Engineer Interview Notes – Part 2

Introduction This is the 2nd post regarding my interview experience for Senior Java Software Engineer roles in the UK. Note that these are NOT copy-paste interview questions that I found on the internet but the actual ones asked during interviews. Questions As a senior developer, you are basically expected to convert a problem statement into […]

Senior Java Software Engineer Interview Notes – Part 1

This is the 1st post regarding my interview experience for Senior Java Software Engineer roles in the UK. Note that these are NOT copy-paste interview questions that I found on the internet but the actual ones asked during interviews. Collections API Which data structure is used when you have lots of add and remote operations? […]

Authentication and Authorization Flow in Spring Security

Introduction Spring Security is a framework that provides authentication, authorization, and protection against common attacks. It is the de-facto standard for securing Spring-based applications and supports securing both imperative (servlet) and reactive applications. In this post, we are going to discuss the main actors in the Spring Security architecture that take part in the process […]

Singleton Design Pattern

Introduction Singleton is a popular topic that you will encounter at least once during your job search. This short tutorial describes three approaches to implement a singleton class. Singleton Pattern A singleton is simply a class that is instantiated exactly once. We want a single instance of a particular object in the memory. The common […]

If/Else Cumleleri Icin Rule Tasarim Kalibi

Bugun, projemizde kullandigimiz Rule tasarim kalibi (Rule Design Pattern) anlatacagim. Bu yontemi zaman baskisi yuzunden ekibe kabul ettirmek zor oldu ama ortaya cikan sonuctan memnun kaldik. Umarim sizin de isinize yarar. Problem Spring Boot ile yazilan backend uygulamamizda farkli musteri tipleri icin farkli kurallarin uygulandigi bir fonksiyon vardi. Musteri tiplerine gore onyuze farkli bildirim mesajlarini […]

Factory Method Pattern for Spring Hateoas Links

Problem Description You have a single class in your application where you create Hateoas Links for different API versions (e.g.: V1 and V2). The class grows quickly with time as you add a lot of logic for those versions. You want to refactor the existing class so that it is easier to be modified for […]

How to read and override Spring Boot YAML Properties

There are some cases where we need to read and override YAML properties for implementation and testing purposes. This short tutorial will teach you how to do it. You can find the source code on GitHub. Project Structure The project structure is as follows. Reading a YAML Property There are some cases that we read […]

Testing HTTP Methods using Mockito framework

In this post, you will learn how to create HTTP methods in Spring Boot and test them using the Mockito framework. If you are not familiar with unit testing, see my post on Medium. For those who are impatient, you can find the source code on GitHub. HTTP Verbs Overview The most-commonly-used HTTP verbs are […]