Skip to content

Instantly share code, notes, and snippets.

View YourAKShaw's full-sized avatar
:electron:
tapping away on my keyboard _</>...

Ayush Kumar Shaw YourAKShaw

:electron:
tapping away on my keyboard _</>...
View GitHub Profile
@vasanthk
vasanthk / System Design.md
Last active July 8, 2024 02:37
System Design Cheatsheet

System Design Cheatsheet

Picking the right architecture = Picking the right battles + Managing trade-offs

Basic Steps

  1. Clarify and agree on the scope of the system
  • User cases (description of sequences of events that, taken together, lead to a system doing something useful)
    • Who is going to use it?
    • How are they going to use it?
@Alchemik
Alchemik / Java Interview.MD
Last active May 27, 2024 18:40
Java Interview

Multithreading, Concurrency and Thread basics Questions

  1. Can we make array volatile in Java? This is one of the tricky Java multi-threading questions you will see in senior Java developer Interview. Yes, you can make an array volatile in Java but only the reference which is pointing to an array, not the whole array. What I mean, if one thread changes the reference variable to points to another array, that will provide a volatile guarantee, but if multiple threads are changing individual array elements they won't be having happens before guarantee provided by the volatile modifier.

  2. Can volatile make a non-atomic operation to atomic? This another good question I love to ask on volatile, mostly as a follow-up of the previous question. This question is also not easy to answer because volatile is not about atomicity, but there are cases where you can use a volatile variable to make the operation atomic.

One example I have seen is having a long field in your class. If you know that a long field is accessed

@keithmorris
keithmorris / drive-format-ubuntu.md
Last active July 4, 2024 09:06
Partition, format, and mount a drive on Ubuntu
@nicolasdao
nicolasdao / open_source_licenses.md
Last active July 5, 2024 04:02
What you need to know to choose an open source license.

MongoDB Cheat Sheet

Show All Databases

show dbs

Show Current Database

Interview Questions

Node.js

Q1: What do you mean by Asynchronous API? ☆☆

Answer: All APIs of Node.js library are aynchronous that is non-blocking. It essentially means a Node.js based server never waits for a API to return data. Server moves to next API after calling it and a notification mechanism of Events of Node.js helps server to get response from the previous API call.

Source: tutorialspoint.com