Skip to content

Instantly share code, notes, and snippets.

View mboya's full-sized avatar

mboya mboya

  • Nairobi
  • 13:08 (UTC +03:00)
View GitHub Profile

Here's an outline of the approach I would adopt for each of the mentioned areas:

Scalability Solutions:

  1. Assessment: Understand the current system architecture, identify pain points, and forecast growth projections.
  2. Scalability Plan: Develop a roadmap outlining short-term and long-term scalability goals.
  3. Technology Stack Evaluation: Assess existing technologies and evaluate alternatives that can better support scalability requirements.
  4. Architecture Refactoring: Implement changes to the architecture to introduce scalability patterns like microservices, horizontal scaling, caching strategies, etc.
  5. Monitoring and Optimization: Implement robust monitoring tools to track system performance and continuously optimize for scalability.

Team Building:

@mboya
mboya / assign_task.rb
Last active May 15, 2024 16:07
Task Scheduler
# automation methis 'assign_task' to be able to match work with eng based on skills and availability
def assign_task(available_eng, tasks)
assigned = Hash.new { |hash, key| hash[key] = [] }
tasks.each do |task|
eng_suited = available_eng.select do |eng|
eng.availability && ((eng.skills & task.skills_required).sort).eql?(task.skills_required.sort)
end
assign = eng_suited.sort_by { |e| assigned[e].sum(&:duration) }.first
@mboya
mboya / count_symbols.rb
Created May 15, 2024 15:35
Button Challenge.
# # When Kevin turns on the machine, the screen displays the symbol '@'. When the button is pressed, the display of the screen changes in the following way:
# - 1st time button is pressed: '@' turns to '&&'
# - 2nd time button is pressed: '&&' turns to '&@&@'
# - 3rd time button is pressed: '&@&@' turns to '&@&&&@&&'
# - the 4th time the button is pressed: '&@&&&@&&' turns to '&@&&&@&@&@&&&@&@' and so forth.
# Requirements:
# - Create a function called `count_symbols` that will count the number of '@'s and '&'s that are displayed on the screen after the button has been pressed ñ number of times.
def count_symbols(clicker)