Open in app

Sign in

Write

Sign in

Ash
Ash

2 Followers

Home

About

Nov 22, 2021

Considerations for AWS EC2 Instances

There are several considerations when planning to use EC2 instances for your application. At a high-level they are as follows: Software (OS and applications through AMI) Hardware (Instance Family and Instance Type) Location (AWS Region, AZ, Placement Group and Tenancy) Price (On-Demand, Reserved, Spot) Let’s look at these considerations one-by-one: Software …

AWS

7 min read

AWS

7 min read


Mar 9, 2021

LRU Cache using LinkedHashMap (Java)

I wrote a compact LRU (Least Recently Used) cache implementation using LinkedHashMap’s “access order” feature. In an LRU cache, the eviction policy is to evict entries which have been accessed the longest time ago. LinkedHashMap maintains a doubly linked list of entries internally which is by default in insertion order…

Java

1 min read

LRU Cache using LinkedHashMap (Java)
LRU Cache using LinkedHashMap (Java)
Java

1 min read


Mar 3, 2021

Notes on Java’s ArrayList

Just wanted to jot down some notes on Java’s ArrayList [1] Capacity attribute is a performance hint. ArrayList will grow or shrink dynamically irrespective of what the capacity is set to. [2] Having capacity set does not mean you can read or write to an index which has not been…

Java

2 min read

Java

2 min read


Mar 3, 2021

Natural Ordering in Sets (Java)

I came across a note in TreeSet’s javadoc which intrigued me: “Note that the ordering maintained by a set (whether or not an explicit comparator is provided) must be consistent with equals if it is to correctly implement the Set interface.” What does that mean? The TreeSet doc says to…

Java

5 min read

Natural Ordering in Sets (Java)
Natural Ordering in Sets (Java)
Java

5 min read


Apr 11, 2020

Scala Notes — Function Return Types

This post is one in the series of posts about Scala. My goal is to provide simple examples to illustrate important gotchas or points about the language. Function Return Type Return type is optional, but it’s better to declare it because compiler may not be able to infer it to…

Scala Programming

1 min read

Scala Programming

1 min read


Dec 1, 2019

LC 1167 Minimum Cost to Connect Sticks (C#)

https://leetcode.com/problems/minimum-cost-to-connect-sticks/ You have some sticks with positive integer lengths. You can connect any two sticks of lengths X and Y into one stick by paying a cost of X + Y. You perform this action until there is one stick remaining. Return the minimum cost of connecting all the given…

Leetcode

2 min read

Leetcode

2 min read

Ash

Ash

2 Followers
Following
  • Ahmed shamim hassan

    Ahmed shamim hassan

  • King Rayhan

    King Rayhan

  • Swapnil Kabra

    Swapnil Kabra

  • Deepak Mehta

    Deepak Mehta

  • Linas Medžiūnas

    Linas Medžiūnas

See all (8)

Help

Status

About

Careers

Blog

Privacy

Terms

Text to speech

Teams