2025-10-02

  • Doing a work study group with @Kevin Barta
  • Trying to do topics on Union-Find unionfind
    • Number of Islands
      • Classic problem, didn’t even do this with Union-Find as flood fill was much easier. Made two trivial errors on first run:
        • Decided to pass g as the grid into my dfs but then didn’t pass g again when I recurse for all adjacent islands.
        • Second one was slightly trickier to spot but just oversight, when I did a check for whether i and j were in bounds I checked the bound on M twice instead of M & N respectively. I had earlier swapped accidentally iterating over M & N in my for loops but caught that before running the code but didn’t see this check.
        • I think the last one was because I was working in chunks instead of linear lines, meaning I would do “first bound check on i”, “oh actually I want this to not be nested so we should do not” and then this back and forth lead to some confusion. I wonder if this means I should be more careful when proof read or whether I should spend more time on what exactly I’m trying to code before dumping the information out of my brain onto the board as a way to not have to juggle too much information.
        • Success: I did appropriately check that the values within the grid were strings i.e. '1' and '0' , thus not making the same mistake of doing not grid[i][j] check and instead checking for string equality.

2025-09-27

  • Doing a work study group with @Kevin Barta.
  • Continuing to work on topics array twopointer slidingwindow
    • Longest Palindromic Substring
      • Solved this < 10 minutes, but made a fundamental error of not considering the case that palindrome’s can be not odd. This was unfortunate because the examples illustrate this clearly as well, however my brain was too focused on finding ‘trick’ because I thought surely two pointer and iterating over every character isn’t an acceptable solution, however it was.
      • There is apparently Manacher’s Algorithm that can solve this problem in linear time, however it doesn’t seem worth it to know this yet.
      • Takeaway is that again I overlooking something because I thought about “palindrome” and thought that okay I know what that is, and then thought “ah I can’t think of a better approach than expanding from the center” and moved towards solving the problem. I think the fundamental issue was when I was done coding the problem, I just wanted to test it out and not think through a working example.
        • Why? I think this is because I was already optimizing earlier on for shorted code and as such it meant my code was less readable and harder to compartmentalize to solve the problem by running through steps.
    • Clone Graph
      • Solved this < 10 minutes, but again made an error where I didn’t consider the edge case of Node being None. I was given hints that this could be possible because we saw Optional['Node'] as the return types, however I misread the constraints of node.val as meaning Node would exist.
      • Again didn’t look through all the examples, as the example clearly indicated this edge case. Why did I not do that? I didn’t do it because I walked through the first example and it was taking a long time to do and thought it was sufficient to submit now.
      • What’s the take away? The examples should be read to see what the differentiators are and if we’ve handled those edge cases as well as explicitly checking the constraints against the possible edge cases.
    • Container with Most Water
      • Solve < 15 minutes but made a critical error again with reading comprehension. I believe I solved the ‘hard’ variant of the problem, where I assumed the middle segments would block the optimal container from being created, i.e. used the stack solution of popping all lines in the stack that are current line we’re at, as that indicates we’ve found the maximum right side for those left lines.
      • Instead this problem was simpler and completely different solution, where the problem was simply two pointers and finding any maximal rectangle (histogram?).
        • Why? I didn’t look at the examples image because I thought this wouldn’t be available in the interview potentially and then didn’t walk through the example because it seemed too complicated to walk through. I think I need to understand how to walk through complicated examples. I believe I didn’t follow my own advice of seeing the example and seeing what edge cases the example was attempting to illustrate.

2025-09-03

  • Continuing to focus on array/two pointers/sliding windows
    • Group Anagrams
      • Easy solve using suboptimal Time/Space complexity
      • Solved by sorting the strings before using the string as the key to the entry to the map, this was a O(m * n * log(n)) Time complexity and O(m * n) space complexity
      • Looking at the editorial and realized we could have a O(N * M) Time complexity and O(N * M ) space complexity if we instead used a count of the characters as a tuple key instead of the sorted string.

2025-09-02

  • Asked Opus regarding studying strategy and it mentioned I should focus on LeetCode patterns instead of what I originally thought of focusing on data structures. The reasoning being that as I’ve done a lot of LC questions the data structure knowledge is still encoded in my brain but just needs reactivation, and as such going through common patterns is probably more fruitful for me.
  • Focusing on Array/Two pointers/Sliding Window problems today
    • Two Sum
      • Easy solve on first pass with optimal Time/Space complexity solution.
    • Longest substring with repeating chars
      • Easy solve on optimal Time/Space Complexity solution.
      • Read the editorial to see the optimization regarding single pass instead of two pass. The key observation here being that at every increment of the right pointer we are looking at an element that may may our substring from [l, r] non-unique and as such we just need to view the last index that element was seen and have our left pointer be greater than that at least - l = max(l, map[c] + 1) - at least because it’s possible for the left pointer to already be further ahead from a prior element.
    • Best Time to Buy and Sell Stock
      • Easy solve on optimal Time/Space complexity solution.
      • Saw a post regarding Kadane’s algorithm which solves for the maximum subarray problem. Had to look up Kadane’s algorithm to have a refresher as well as understand how this applies if the question is morphed by providing a difference array of prices instead of absolute prices. Where difference array is p[i] = 0 if i == 0 else p[i] = p[i] - p[i - 1], and the reason we can apply maximal subarrays is because when you take two points and add up the middle terms of the differences it ends up being just being the left and right index of the subarray (waves hands).
    • Merge Intervals
      • Easy solve on optimal Time/Space complexity solution.
      • Spent time reasoning through why sort function needed to be lambda x: (x[0], x[1]) instead of just lambda x: x[0], because I was focusing on whether the previous interval overlaps with the current one instead of thinking I could just think of whether the current interval overlaps with the prior one and not have to worry about reversing the sort for end intervals.
    • Number of Islands
      • Okay solve on optimal Time/Space complexity
      • Spent way too long debugging why I kept only finding 1 island and it was because I glossed over the constraints and assumed 0/1 were integers instead of strings. I also spent some time rationalizing over the usage of nonlocal for functions defined within methods.
      • There was also an approach where they use Union Find (Disjoint Set) however I don’t have time to go over that or remember what exactly Union Find is trying to solve. I kind of have an idea of the data structure, but get confused with the connected components and usage of disjoint set to describe it.
    • Meeting Rooms
      • Easy solve on optimal Time/Space complexity solution
      • Figured out pretty easily that if the intervals were sorted by start time, then at a given meeting start, all we’d need is the previous number of meetings that are still ongoing or have an end time that is greater than the current start time
      • Messed up realizing that the end time of a meeting is not inclusive so we want to search for start_meeting_time <= end_meeting_time to purge our queue
      • I used a min heap pretty easily because I knew the complexity of log(n) operations wouldn’t affect the overall time complexity but figured it’s possible to do this portion more efficiently. It is by separating the start and end times but I didn’t fully understand the logic behind that.
  • Language Proficiency
    • Still forgetting basic data structure API’s of the language i.e. used set.pop instead of set.remove to remove a particular element from a set.
    • Used char, and then chr instead of ord when trying to get the ASCII character encoding of a character.
      • Why is it called ord?
      • What again is ASCII?
      • What am I looking for when I try to look for the numeric representation of a character in ASCII?
        • This is when I realized my mental model was weak and I was hand waving looking for unicode and encoding as well as trying to stay away from ASCII because I thought the priors were more descriptive or something.
    • Forgot that sort/sorted requires a key word parameter key to pass our own sorting function and instead tried passing an anonymous function as a positional argument.
    • Had to look up heapq module and API and felt clunky working with it

Daily Analysis Summary

Strengths: Successfully solved 6 problems with optimal time/space complexity, showing pattern recognition is intact from prior experience. Strong self-awareness in documenting mistakes and knowledge gaps. The foundation is there but needs significant polishing.

Critical Weaknesses: Python API confusion (set/heap operations, ord/chr, sorting syntax) would be fatal in quant interviews where looking up basic syntax fails you instantly. Lost significant time on type confusion (string “0” vs int 0) and don’t understand Union Find - both are red flags for production systems. The Kadane’s algorithm insight came from reading solutions, not independent recognition, indicating pattern recall needs work.

Readiness: 3.5/10 for Top Quant Funds. With 5 weeks available, you need aggressive daily practice: Week 1: Python API mastery + Union Find deep dive. Weeks 2-3: 10+ problems daily focusing on speed (LC Medium in <20 min). Weeks 4-5: LC Hards + mock interviews. Immediate actions: Create Python cheat sheet tonight, implement Union Find from scratch tomorrow, and start timing every problem. The bar is solving LC Mediums flawlessly in 15-20 minutes while explaining your approach - you’re currently taking longer with API lookups. Focus on precision over quantity; one perfectly executed problem beats three sloppy solutions.