top of page


Tutorials, Errors and Exceptions
Its a journey to understand things better. It will have tutorials, any error/exceptions encountered, its resolutions and lots of learning.

Search


Set Swappiness in Linux
In this post we will look into how to change the swappiness value in Linux. Swappiness is the kernel parameter that defines how much your...
Ankit Agrahari
Nov 17, 20211 min read
Β
Β
Β


#LC438 - Find All Anagrams - Sliding Window Algorithm
In this topic we will cover the leetcode #438 Find all anagram programming question. Problem Statement: Given two strings s and p, return...
Ankit Agrahari
Nov 16, 20212 min read
Β
Β
Β


Maven - Manifest file and Jar with Dependencies
In this post, we will build a simple maven project which will create two jar files, which can be executed using below command java -jar...
Ankit Agrahari
Nov 16, 20211 min read
Β
Β
Β


IV - Recognizing Parts Of Speech Using Apache OpenNLP
In this post we will discuss on recognizing parts of speech in a given sentence using Apache OpenNLP library. This is part of the series...
Ankit Agrahari
Nov 15, 20212 min read
Β
Β
Β


III - Named Entity Recognition - Apache OpenNLP
In this series of learning Natural Language Processing with Apache OpenNLP library in Java, we will discuss on NamedEntityRecognition,...
Ankit Agrahari
Nov 15, 20212 min read
Β
Β
Β


II - Tokenization using Apache OpenNLP
In this post we will create tokens of the given string using Apache OpenNLP library. This post is a continuation of the previous post...
Ankit Agrahari
Nov 14, 20213 min read
Β
Β
Β


I - Sentence Segmentation Using Apache OpenNLP
In this post, we will discuss on how to find sentences in a block of text, which can be a paragraph or an entire book. We will be using...
Ankit Agrahari
Nov 14, 20213 min read
Β
Β
Β
Contact
bottom of page



![If this shifted how you think about AI β
you're ready to Harness it. π₯
π¬ Comment "HARNESS" below
β I'll DM you the open-source agent template
π Save this carousel β refer back when you build
π€ Share with one engineer who's still copy-pasting
Follow @backendbrilliance for more content on
AI agents, Spring Boot architecture & backend systems
that actually scale.
#AIHarnessing #BackendBrilliance #JavaDeveloper
#SpringBoot #SpringAI
[AIAgents SystemDesign BackendEngineering SoftwareDevelopment LLMOps]](https://scontent-den2-1.cdninstagram.com/v/t51.71878-15/729219604_894359219640315_5276418046541229917_n.jpg?stp=dst-jpg_e35_tt6&_nc_cat=102&ccb=7-5&_nc_sid=18de74&efg=eyJlZmdfdGFnIjoiQ0xJUFMuYmVzdF9pbWFnZV91cmxnZW4uQzMifQ%3D%3D&_nc_ohc=ZArsYJt35hwQ7kNvwG3w1Ni&_nc_oc=Adq-9PFwabrih1777MrsPdOhiJKT-fSa4DRqUBwhIJCyH2HIVfDYXuO14YaCnyWO9mw&_nc_zt=23&_nc_ht=scontent-den2-1.cdninstagram.com&edm=ANo9K5cEAAAA&_nc_gid=zhpO630fLKc_jVOFEAILBg&_nc_tpa=Q5bMBQFaDaG9rJHmuo1suvcCXsKI01iTNJj351BvOTR9nD398PG1aJ_G5hvLzoDMUo81TShrLlrD5QD0&oh=00_AQCrlk7hrqI1-Yza1lWHb6BJgBnOJ5sZ-lQRSdJfsD60kA&oe=6A5CEF6F)























![You think HashMap is always O(1).
It isn't. Here's what actually happens. π§΅
HashMap stores pairs using `index = hash(key) % capacity` β direct slot access, no scanning. Pure O(1). Until two keys land on the same slot. That's a collision β not a bug, a math inevitability.
Two ways to fix it π
π Chaining β each bucket holds a linked list. Collisions append to the list. Simple, handles high load, easy deletion. Downside: pointer overhead, poor cache performance, chains degrade to O(n) at high load. Java's fix? At 8 nodes, the list auto-converts to a Red-Black Tree β O(log n) worst case.
π¦ Open Addressing β no linked lists. Collision at slot X? Probe X+1, X+2 until empty. Cache-friendly, zero memory overhead. Downside: deletion needs tombstone markers, and keys cluster together making future collisions worse. Used by C++, Go, Redis.
βοΈ Load Factor = entries Γ· capacity
π’ Below 0.5 β rare collisions, wasted memory
π 0.75 β Java's sweet spot, triggers resize + rehash
π΄ Above 0.9 β collision cascade, O(n) territory
Double hashing kills clustering by varying the probe step per key:
`probe(i) = (h1 + i Γ h2) % m`
Elements scatter evenly. No bunching. O(1) preserved.
The truth: HashMap is O(1) until a bad hash function, wrong load factor, or wrong strategy turns it into O(n).
Three things protect you:
β Well-distributed hash function
β Load factor under 0.75
β Right collision strategy for your use case
π¬ Java interview question: what happens when a chain hits 8 nodes?
Drop your answer below π
π Save this before your next interview.
#java #hashmap #datastructures #dsa #algorithms
[codinginterview programming 100daysofcode]](https://scontent-den2-1.cdninstagram.com/v/t51.71878-15/641188820_1859196944673752_5535080284006983284_n.jpg?stp=dst-jpg_e35_tt6&_nc_cat=102&ccb=7-5&_nc_sid=18de74&efg=eyJlZmdfdGFnIjoiQ0xJUFMuYmVzdF9pbWFnZV91cmxnZW4uQzMifQ%3D%3D&_nc_ohc=ffhGGgNASMAQ7kNvwG-36qv&_nc_oc=AdoockbRsMm1NzljVT15Nx3iF8OMLrEwmbcIY5qT5R6z7HzUQw4-Q1gzOwK12EK5gIk&_nc_zt=23&_nc_ht=scontent-den2-1.cdninstagram.com&edm=ANo9K5cEAAAA&_nc_gid=zhpO630fLKc_jVOFEAILBg&_nc_tpa=Q5bMBQG9aw-oW_j1JnfipiOh9dwl9ekWkoEF8o6Qs75T3zb7OhfMEtVx_yEy879Mu81bbJSHQ95wXMYW&oh=00_AQAYZxnGtQI3JgZd0L9jtObFtvP6wVoHolpkZmxPV-a2Bg&oe=6A5CE3BE)


