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

Watch the Day 3 raw log here: https://youtu.be/Mcia2gwFWfA
The Pursuit of Discipline
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.
Technical Deep Dive: Floor in a Sorted Array
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) / 2to 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



