Day 5 of 90: Effective HFT Prep with the Two-Pointer Technique and Overcoming Difficulties

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 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...

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 foc...

Watch the Day 5 raw log here: https://youtu.be/Kh3lQ0drC8Y
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 for Salesforce that featured complex DP and Graph questions. However, in HFT, discipline means showing up and documenting the grind even when things aren't going your way.
The Internship Grind
Despite the personal setbacks, I maintained my professional momentum. I put in over 3 hours of work on my remote internship, successfully completing three TypeScript tasks and getting my Pull Request merged.
Today's focus was on LeetCode 167, which is a more constrained version of the classic Two Sum problem.
1. The Problem Statement
Given a 1-indexed array of integers that is already sorted in non-decreasing order, find two numbers such that they add up to a specific target number.
O(N²)): A nested loop approach checking every possible pair—too slow for high-performance requirements.O(N)): Since the array is already sorted, we can use a Two-Pointer approach to find the target in a single pass.2. The Logic
left) at the beginning of the array and another (right) at the end.right pointer to decrease the sum. If the sum is less than the target, increment the left pointer.long long for the sum but realized a standard int was sufficient given the input constraints, avoiding unnecessary memory overhead.3. Results
O(N)O(1)Current Status: 5/90 Days Complete
Today was a "reality check" day, but the 90-day grind doesn't stop for bad moods or failed OAs. I'll be back tomorrow to pick up the pace, likely moving toward Three Sum problems.
#HFT #CPP #TwoPointers #90DayChallenge #MAIT #TypeScript #Discipline