01: Spring DI & IoC interview Q&As

Video: Spring DIP, DI, and IoC. This extends 13 Spring interview questions & answers.

Q1. What do you understand by the terms Dependency Inversion Principle (DIP), Dependency Injection (DI) and Inversion of Control (IoC) container?
A1. Dependency Inversion Principle (DIP) is one of the 6 OO design principles abbreviated as “SOLID“, and is in some ways related to the Dependency Injection (DI) pattern. The idea of DIP is that higher layers of your application should not directly depend on lower layers. Dependency Inversion Principle does not imply Dependency Injection. This principle doesn’t say anything about how higher layers know what lower layer to use. This could be done as shown below by

1) Coding to interface using a factory pattern or

2) Coding to interface and through “Dependency Injection” by using an IoC container like Spring framework, Guice, or JEE 6+.

The Dependency Inversion Principle (DIP) states that

– High level modules should not depend upon low level modules. Both should depend upon abstractions.

– Abstractions should not depend upon details. Details should depend upon abstractions.

When this principle is applied, the higher level classes will not be working directly with the lower level classes, but with an abstract layer (i.e. an abstract class or an interface). This gives us the flexibility at the cost of increased effort.… Read more ...

16+ Tech Key Areas to go places as a Java, Big Data or any software engineer or architect

If you want to be a top-notch developer who goes places, then you must have a good handle on these 16+ technical key areas. Seasoned Java developers must have a solid understanding of these “transferrable skills“. These are transferrable skills that can be applied to any technology & programming by asking the right questions.

Inexperienced or rushed developers can create systems that work great in development, but have many problems in the test or production environments due to sheer load, concurrent access, locale or timezone settings, portability issues, hard coded values, not having proper service timeouts & retries, and the list goes on…NON Functional requirements are a must to build robust systems. In other word, the edge cases need to be properly handled.

What are the 16+ technical key areas?


  1. Language Fundamentals (LF) – Core Java
  2. Specification Fundamentals (SF) – Enterprise Java Specs
  3. Platform Fundamentals (PF) – Enterprise Java, Spring framework, etc
  4. Design Considerations (DC)
  5. Design Patterns (DP)
  6. Concurrency Management (CM)
  7. Performance Considerations (PC)
  8. Memory/Resource Considerations (MC)
  9. Transaction Management (TM)
  10. Security (SE)
  11. Scalability (SC)
  12. Best Practices (BP)
  13. Coding (CO)
  14. Exception Handling (EH)
  15. Software Development Processes (SDP)
  16. Quality of Service (QoS)
  17. Low Latency
  18. Debugging – Core Java | JEE | Hadoop & Spark | Spring | Hibernate
  19. CI/CD & DevOps

Why will these key areas help you fast-track your career?

Read more ...

10 Tips to have a great career in Software & Data Engineering

#1 Grow gradually and consistently

The income you earn is not often proportional to how hard you work, but how smart you work & how well rounded you are. Often professionals tend to earn more:

1) who are well rounded.
2) who have better mental clarity & focus.
3) who prioritise working smarter.
4) who takes risk – e.g contracting, changing jobs every x years
5) who continuously learn, especially keeping up to date with mainstream & sought-after technologies, frameworks & tools

At times working extended hours is okay as long as you don’t make it a habit. For example, a production issue or you are having a good thought process & making a good progress on solving a problem, designing a system or building a feature. You don’t want to interrupt that flow.

#2 You have to look after yourself

No matter how good you are & how much value you add to an organisation, no one is indispensable. When you are working for an organisation, do your best and be a person who adds value to the company, but when the time is right, changing jobs will boost your career in terms of both learning and earning opportunities. When to jump ship vs when to steady the ship?.

#3 Is contracting your cup of tea?

In some countries IT professionals can work on a contract basis to earn 40% to 60% more than the equivalent permanent position, but the risk is to be able to continuously find work without long gaps.… Read more ...

15 Ice breaker interview Q&As asked 90% of the time

Most interviews start with these 15 open-ended questions. These are ice breaker interview questions with no right or wrong answers to ease nervousness, but the quality of the answers can make a good first impression. Your answer can reveal a lot about your experience & industry knowledge. Even though the answers provided here are Java focussed, the questions are generic.

Q01. Tell us about yourself?
A01. Let’s start with a video & then list down the key points to remember.

[Hint: Focus on your strengths and marry up your strengths with the job specification. For example,

5 year hands on experience in building web based applications to integrating disparate systems using micro services, messaging, and XML/JSON/Protobuff data formats.

Completed 3 projects through full SDLC process using sought-after technologies X, Y, and Z, and frameworks P and Q in 2 of those projects. One of the projects was a mission critical transactional system that handles 300 concurrent users

— Designed & developed 40+ micro services using Springboot & Kafka at XYZ Bank.

— Initiation of any “QuickWins” projects. The focus is to improve the overall effectiveness and usefulness of a system through small changes in a collaborative effort with the business. For example, automating tedious manual tasks, improving website user experience & independent rankings, stabilising the environment, etc.

Fixed security holes. Security is of paramount importance to any application or website.… Read more ...


GitOps interview questions & answers

Q1. What is GitOps?
A1. GitOps is a workflow for continuous delivery, which is a CD in CI/CD that is used in DevOps. It is a software development and deployment approach where the entire infrastructure and application lifecycle is managed through Git repositories as the single source of truth. GitOps means Ops practices using Git. The Ops practices involve Configure, build, test, deploy, CI/CD, upgrades, rollback, history, automation, etc.

Git is a mission critical tool for software development that enables pull request and code review workflows. Pull requests promote visibility into incoming changes to a codebase and encourages communication, discussion, and review of changes.

In GitOps, the Git repository is the sole source of truth for system and application configuration. It is used with IaC (i.e. Infrastructure as Code e.g Terraform, k8s manifests, etc), CaC (i.e. Config as Code e.g. Ansible), PaC (i.e. Policy as Code), etc stored in Git instead of manually executing commands like kubectl, terraform, ansible, etc via command-line. It consists of a declarative description of the infrastructure for your environment and works in tandem with automated processes handled by GitOps tooling like Argo CD & Flux CD.

If the kubectl and other commands are executed directly from a local machine or a server, it is harder to audit who did what. This is where Iac in Git is very useful to track changes and rollback changes if anything goes wrong.… Read more ...

01: 15+ Apache Kafka must-know basics interview Q&As – Part 3

This extends Apache Kafka must-know basics interview Q&As – Part 2. Q10. What do you understand by the terms Kafka Consumer Groups & group.id? A10. Consumers read from any single partition, allowing you to scale throughput of message consumption as depicted below. Consumers can also be organised into consumer groups…

Read more ...

02: Golang getting started commands & environment variables you must know

What is GOPATH?

GOPATH is an environment variable that defines the root of your workspace. You can list all Go env variables with “go env” command. By default, the workspace directory is a directory that is named go within your user home directory (i.e ~/go). You can use another directory as your workspace by configuring GOPATH for different scopes.

you can use go env to learn GOPATH value.

GOPATH has 3 folders:

If your source code is in “$GOPATH/src/“, after you run “go get” within this folder you will see $GOPATH/bin and $GOPATH/pkg created. The GOPATH env variable is used by the Go tools. It must be set to get, build & install packages.

What is GOROOT?

GOROOT is an environment variable that defines where your Go SDK is located. This means you can find the compiler, go tools or, standard libraries in this directory. The default value of GOROOT is /usr/local/go . You do not need to change this variable, unless you plan to use different Go versions.

To check where is your GOROOT, you can use go env.

If you list

What is a “go mod init” command?

Read more ...

07: Apache Kafka Streaming with stateless operations

This extends 06: Apache Kafka Streaming with JSON & Java Tutorial – stateful operations groupByKey, windowing & aggregate and Getting started with Apache Kafka on Mac Tutorial.

Kafka Streams DSL (i.e. Domain Specific Language) is built on top of the Streams Processor API. It is recommended to use DSL as most data processing operations can be expressed in just a few lines of DSL code. Kafka streaming can be stateful or stateless. Stateful operations are dependent on previous events of the stream whereas stateless operations are not.

Let’s look at a non-trivial stateless streaming example.

#1. Maven pom.xml

Read more ...

Git interview Q&As on undo operations via reset vs revert & solving common Git errors

Let’s look at how we can undo changes in Git. Often we need to rollback or stash our changes.

Q01. What is the difference between reset & revert in Git?
A01. The git commit moves the HEAD & branch pointer forward to the latest commit. The git checkout of a particular commit moves the HEAD pointer to the specified commit without moving the branch pointer.

The Git reset is used for rewinding a project’s history to a particular point. This is done by moving the HEAD and the branch pointer to a specific commit.

The ~1 in the command means point to the 1 commit before the current HEAD.

Git revert creates a new commit to undo a change introduced by a specific commit. So, reset modifies the history, whereas revert creates a new commit to cancel out a particular change commit.

Creates a new commit say 655a20f99af32926cbf6d8fab092506ddd70e49c to undo the commit 9eabf5b536662000f79978c4d1b6e4eff5c8d785.

So, in summary:

git reset = moves the HEAD & branch pointer, discards the changes in history, and does not preserve the commit history.

git revert = creates a new commit, hence preserves the history without discarding the changes.

Q02. What are the different modes of Git reset command?
A02.Read more ...

06: Apache Kafka Streaming with JSON & Java Tutorial – stateful operations groupByKey, windowing & aggregate

This extends Apache Kafka Streaming with JSON & Java Tutorial and you can either use Kafka on Docker as per Apache Kafka example with Java – getting started tutorial or install Kafka on Mac (i.e Getting started with Apache Kafka on Mac Tutorial) or Windows. This kafka tutorial is stateful…

Read more ...

500+ Enterprise & Core Java programmer & architect Q&As

Java & Big Data Tutorials