Fohlarbee - BlogAn inner view of Algorithms: Whatever language it may fit in JS,TS, GOLANG, RUST or C++

An inner view of Algorithms across languages
Algorithms are the foundations of computer science, providing logical solutions to complex problems, they are the rules that drive efficiency in our daily lives. From choosing the fastest route to work to organizing a to-do list, algorithms are at play, subtly guiding decisions and actions. Similarly, in back-end development which is my stack, algorithms form the backbone of systems that power modern applications, ensuring they function seamlessly and efficiently.
Algorithms in my Daily life
- Prioritizing Tasks:
When juggling work as a back-end developer, I instinctively use a priority-based system. For instance, starting the day by addressing the most critical bugs or tasks resembles a priority queue, ensuring the most important issues are resolved first. - Problem Solving:
Breaking down challenges into smaller, solvable parts parts is my go-to strategy, akin to the divide and conquer algorithm. Whether it's managing a complex project or planning a side hustle like Agro-Link (more on that soon), this logical approach ensures efficiency. - Efficient Learning:
As a Final year student of the prestigious University of Jos, and also as an algorithm enthusiast, I often organize my learning into digestible chunks, much like how dynamic programming approach solves problems step-by-step by storing previously computed results to avoid redundancy. - Meal Prep Efficiency:
As weird as it sounds, when cooking, I optimize the process by multitasking, I could be boiling water while chopping vegetables or pepper. It's just simple, it akin to parallel processing, where tasks run simultaneously for maximum efficiency.
In this moments, I realize that life, much like back-end systems, thrives on well-structured logic.
Back-End Development: The Algorithmic Parallel
In my work, algorithms underpin the reliability and performance of the systems and API's I build
- Sorting and Searching: Just as I organize my tasks for clarity, back-end systems use algorithms to sort the vast amounts of data. For instance, enabling a search feature in a database to deliver instant results. I recently enrolled in a course on Data structure and Algorithms by Maximilian Schwarzmuller of which I learnt (I'm learning) some interesting concepts.
* Example: Implementing a Binary Search in Typescript (My best language for now):function binarySearch(arr: number[], target: number){
let low = 0, high = arr.length - 1;
while (low <= high) {
const mid = Math.floor((low + high) / 2);
if (arr[mid] === target) return mid;
if (arr[mid] < target) low = mid + 1;
else high = mid - 1;
}
return -1;
}
console.log(binarySearch([2,4,6,8,10], 8)); //Output: 3 - Resource Optimization: Just as I optimize my daily schedules to save time, back-end systems optimize resources. For instance, algorithms like Load Balancers distribute server requests, ensuring systems run efficiently even under heavy load.
- Decision Models: When deciding whether take on a new project or focus on existing ones, I weigh the pros and cons---a natural decision-making algorithm. Similarly, back-end systems use algorithms to evaluate user data and provide recommendations.
My Final Thoughts
Algorithms seamlessly integrate into both our daily lives and the systems we build, just as I have highlighted using my daily activities and interactions. Whether I'm optimizing my schedules or designing a scalable back-end service, the same principle apply: structure, efficiency, and adaptability. For me algorithms are not just tools neither are they just code---they are lifestyles, a way of thinking that bridges the logical and the practical.