Day 3/90: HFT Prep – Digital Whiteboarding & Binary Search Precision

Search for a command to run...

No comments yet. Be the first to comment.
Let’s be real: some days of development are 10% coding and 90% fighting your tools. Day 7 was exactly that—a mix of OBS audio tuning, "Day 1" algorithm logic, and deep-level C++ concurrency. Check the live session here: Watch on YouTube 🎙️ The "Pre...

In the world of software development, we often talk about "clean code" and "optimal algorithms" in a vacuum. But for many developers, coding doesn't happen in a sterile lab; it happens amidst system crashes, environmental frustrations, and the weight...

Watch the Day 5 raw log here: https://youtu.be/Kh3lQ0drC8Y The Pursuit of Discipline I’ll be honest: today was a rough day and my mood was quite off. I faced setbacks with two Online Assessments (OAs)—one for Milliman that didn't go well and another ...

Watch the Day 4 raw log here: https://youtu.be/TNzKKlwQrYM The Pursuit of Discipline Day 4 is about refining the "Signal." In high-frequency trading, every nanosecond counts, and today I focused on how both our algorithms and our choice of data struc...

On this page
Watch the Day 3 raw log here: https://youtu.be/Mcia2gwFWfA
I’ll be honest: I struggled with procrastination yesterday. I realized my previous 40-minute videos were too long to be sustainable logs, so I'm shifting to more focused updates. In HFT, efficiency is everything—not just in the code, but in how you manage your time.
The "Tablet Setup" Breakthrough
To become better at technical interviews, I needed a way to draw logic in real-time. I spent a good portion of today setting up scrcpy on my Fedora Linux system to mirror my Motorola tablet.
The Engineer's Choice: I opted for a USB cable connection over Wi-Fi to ensure the lowest possible latency and best performance while sketching.
The "Rubber Duck": As always, Mr. Pengu was there to "interview" me as I worked through the setup and the code.
While I’m logging this today (February 8th), this progress is for yesterday (February 7th). I tackled the Floor in a Sorted Array problem.
1. The Problem Statement
Given a sorted array and an integer X, find the index of the largest element in the array that is less than or equal to X.
Brute Force (O(N)): A simple linear search where you check every element until you find one larger than X.
HFT Optimized (O(log N)): Since the array is sorted, we must use Binary Search.
2. The Logic
We calculate the midpoint using left + (right - left) / 2 to prevent integer overflow—a small but critical detail for high-performance systems.
If array[mid] <= X, we store this index as a potential answer and move to the right half (left = mid + 1) to see if a larger "floor" exists.
If array[mid] > X, we move to the left half (right = mid - 1).
3. Results
Time Complexity: O(log N)
Space Complexity: O(1)
Performance: The solution passed all cases with a runtime of 0.454s.
Current Status: 3/90 Days Complete
I know I've been a bit slow, but I'm picking up the pace. Mastering these fundamental boundary conditions is the only way to handle the high-pressure questions asked by firms like Graviton or Tower Research.
#HFT #CPP #BinarySearch #90DayChallenge #MAIT #FedoraLinux