Dad and husband • Software Engineer for 15+ years • Algorithms, Distributed Systems, System Design, Computer Vision
12 subscribers
Mar 29 • 4 tweets • 2 min read
What's the difference between load balancers, reverse proxies, and API Gateways? ↓
1. Load Balancers
Their main job is sending client requests to several servers. The goal is to spread the load evenly so there are no bottlenecks and the system works smoothly.
They work in this way:
- The load balancer gets requests from clients
- The load balancer selects a server based on a predefined algorithm
- The request is sent to the service that was chosen
- The server processes the request and returns the response to the load balancer
- The load balancer then forwards the response back to the client
The main benefit of using a load balancer is that it increases throughput, reduces response time, and optimizes resource utilization.
Mar 19 • 11 tweets • 3 min read
If you're a software engineer who want to get better at system design, read these 10 articles: ↓ 1. How Shopify uses sandboxing to build secure checkout pages
They are a way to let two services talk asynchronously and are critical in any distributed system.
A producer creates messages and puts them in the queue.
A consumer gets messages from the queue and processes them.
Here's a practical use case: ↓
Multimedia applications often need to process content to meet different users' needs.
Simply sending the request to a processing service wouldn't be a great idea because the service may not work for any reason.
A better approach is to send the request to a message queue and put the content in a file store. The queue works as a temporary buffer until the service can process the request.
Feb 18 • 5 tweets • 2 min read
Latency and throughput are critical for any application.
But many developers get them wrong or use them in the wrong way.
Here are the key differences you should know: ↓
Latency is a way to measure how long an operation takes to finish.
You can think of it as the time it takes for your system to respond.
For example, latency is the time from clicking the link to when the data displays on your screen.
In computer networking, the most common latency is round-trip delay. That's the time it takes for a client request to reach the server and for the response to return.
Network latency is usually measured in milliseconds (ms) using ping tests or traceroute.
Feb 8 • 8 tweets • 2 min read
In any coding interview, you must solve problems about arrays or strings.
I completed over 350+ of them and learned to avoid the usual mistakes.
Here are some tips that will help you improve: ↓
1. You can efficiently access both ends of an array and use the 2-pointer technique.
2. It's usually possible optimize to O(1) space a brute force solution taking O(N) space.
3. Consider the possibility of overwriting an element instead of removing it.
Feb 1 • 8 tweets • 2 min read
Solving 300+ LeetCode problems doesn't mean you'll pass your coding interview.
What holds you back are not your coding skills but the way you approach problems.
If you want to do better, use this practical 7-step strategy: ↓
Step 1: Listen
Pay close attention to the problem description and catch every detail.
Each piece of information is crucial in finding the optimal solution.
For example, if the interviewer gives you sorted input data, this likely affects the optimal solution.
Jan 18 • 7 tweets • 2 min read
Many software engineers have trouble with recursion during coding interviews.
If you want to become good at solving such problems, learn these 6 templates: ↓
1. Iteration
Any problem that can be solved with loops can also be solved using recursion.
Sometimes recursion provides a more concise and elegant solution, even if less efficient.
Example:
- traversing a linked list in reverse order
Jan 11 • 8 tweets • 2 min read
The sliding window method isn't just a trick for coding interviews.
It's the cheat code for cracking most array and string problems.
Here's how you can quickly grasp and use it: [1/7] ↓
A sliding window is a subarray that moves from left to right through an array.
The window is defined by two pointers representing its left and right bound.
The window size can be fixed or variable.
[2/7]
Jan 4 • 5 tweets • 2 min read
Most developers don't use trees in their daily work.
But the reason is that they're avoiding tree problems.
You won't need to do that anymore once you know these 4 data structures: ↓ 1. Binary Search Trees (BST)
It's a constrained extension of a binary tree with a unique property.
Given a node, the value of its left child is less than or equal to the parent value.
The value of the right child is greater than or equal to the parent's value
The primary use cases of BSTs are:
- implement simple sorting algorithms
- maintain a sorted stream of data
- implement double-ended priority queues
The most popular BST implementations are balanced trees like Red Black or AVL.
Dec 30, 2024 • 7 tweets • 3 min read
Availability is critical for distributed systems.
A downtime of 1 hour:
• costs from $1K to $1M.
• affect the system credibility
• decrease the customers trust
Here's how you can get a system available: (cont'd) ↓ 1. Definition
Availability is a measure of how a system is resistant to failures.
The more a system stays operational when a component fails, the higher its availability.
Dec 4, 2024 • 6 tweets • 4 min read
If you want to get better at system design and scaling apps, read these blog posts from big tech companies (Netflix, Uber, Stripe, OpenAI, Airbnb..): ↓
1. Netflix: Extracting Image Metadata at Scale
Younger engineers seems to have a hard time understanding concepts like threads, CPUs, and cores.
But I remember feeling the same way before working on embedded systems.
I hope this can help some less experienced folks out there:
[1/6] ↓
A thread is a sequence of instructions executed by a processor.
Two decades ago, a single chip had only a processor and one hardware thread.
So, it could only execute one set of instructions at a time.
Nowadays, CPUs can handle multiple threads.
[2/6]
Oct 30, 2024 • 8 tweets • 5 min read
As a senior software engineer, you should read these famous white papers from big tech companies (AWS, Google, Meta,..): ↓
1. Dynamo: Amazon’s Highly Available Key-value Store