Skip to main content

Posts

Showing posts from November, 2024

How I Used a Classic Algorithm to Solve a Real-Life Restaurant Problem

Algorithms and data structures often feel like abstract, academic exercises when you first encounter them. Many of us in university wondered, Will I ever use this in real life? Fast forward to the working world, and the answer is often a resounding yes . Here’s a story of how I used Breadth-First Search (BFS), a classic algorithm, to solve a seemingly impossible problem for a restaurant inventory system. The Restaurant Dilemma Imagine you’re designing a system for a restaurant chain. The system needs to handle recipes, track ingredient usage, and calculate costs for menu items. Sounds straightforward, right? Let’s complicate it. Consider a dish like Lasagna. To make lasagna, you need: Pasta Sheets Bolognese Sauce Cheese But here’s the twist: Bolognese Sauce is itself a recipe that requires: Ground Meat Tomatoes Spices Every ingredient comes from an inventory with details like: Unit of Measurement (UOM) : Grams, Liters, etc. Cost per Unit : Calculated based on the last purchase price...

How to Make API Documentation the Easy Way with Postman

If you’re like me, you probably hate making API documentation. It’s boring, takes a lot of time, and feels like extra work. I used to skip it most of the time. But recently, I had no choice. I was working on a Web API that other software needed to use, and I had to make proper documentation. That’s when I found an easy solution:  Postman . Most of us already use Postman to test APIs, right? The good news is that Postman can now help you create documentation automatically with its AI tool. Here’s how you can do it. Steps to Create API Documentation in Postman Step 1: Add a Collection Description First, open Postman. On the left side, click on the  collection  you want to document. Go to the  Overview  tab and write a short description of your collection. This helps explain what your API is about. Overview page Step 2: Use AI to Write API Descriptions Select one of the API requests in your collection. On the right-hand side, click the  Documentation  ico...