Skip to content

Instantly share code, notes, and snippets.

View manoj2411's full-sized avatar

Manoj Kumar Sehrawat manoj2411

View GitHub Profile
@manoj2411
manoj2411 / System Design.md
Created August 11, 2020 13:39 — forked from vasanthk/System Design.md
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?
@manoj2411
manoj2411 / The Technical Interview Cheat Sheet.md
Created May 8, 2018 14:02 — forked from tsiege/The Technical Interview Cheat Sheet.md
This is my technical interview cheat sheet. Feel free to fork it or do whatever you want with it. PLEASE let me know if there are any errors or if anything crucial is missing. I will add more links soon.

Studying for a Tech Interview Sucks, so Here's a Cheat Sheet to Help

This list is meant to be a both a quick guide and reference for further research into these topics. It's basically a summary of that comp sci course you never took or forgot about, so there's no way it can cover everything in depth. It also will be available as a gist on Github for everyone to edit and add to.

Data Structure Basics

###Array ####Definition:

  • Stores data elements based on an sequential, most commonly 0 based, index.
  • Based on tuples from set theory.
@manoj2411
manoj2411 / sidekiq_manager.rb
Created November 16, 2017 01:14 — forked from kcore/sidekiq_manager.rb
a load balancer for sidekiq jobs!
module Amura
class SidekiqManager
# a datastructure to maintain queue meta data. the structure of which is {host_name: {queue_name:{min:1,max:1,conc:10,latency:1,queue_size:10,kill_idle:-1, tags:['default'], total_checks:1,current_check:0}}}
# host_name - name of the machine where its running. useful in a distributed environment where app is running on mulitple instances
# queue_name - name of the queue (which you can mention in the sidekiq worker as sidekiq_options :queue => :mailer )
# min: minimum number of processes required to process this queue on this machine.
# max: maximum number of processes permitted to process this queue on this machine. a upper limit to avoid memory overflow and unlimited process spawning.
# conc: concurreny (number of worker threads) for each of the processes. this is -C option given while booting up sidekiq.
# latency: this is the default safe latency which is permissable for this queue. anything beyond this will trigger new p