Taro Logo
1

As SWE in a Big tech, which DSA do you apply mostly in your day to day?

Profile picture
Senior Software Engineer at Taro Community3 months ago

I am curious about it because I believe understanding Big O and some basic DS definitely helps to improve your code skills.

For example: using a hashmap or dictionary (depending the programming language) is really helpful when mapping values with a key or hash, having faster look ups - O(1).

What data structures would you say are most valuable in practice - in the real world - beyond passing interviews?

40
2

Discussion

(2 comments)
  • 1
    Profile picture
    Software Engineer
    3 months ago

    Trees. I was working with some guide data (in the form of decision trees) from a vendor where the API response came as a raw list of nodes with IDs attached to them.

    The goal was to do a LLM-based enrichment scheme by feeding in the leaf nodes to a language model and having it extract key facts. In this case, getting pathing information on the leaf node was extremely valuable. (think URLs like abc123.com/products/trucks/tires)

    So I found a way to identify the root node and did a BFS traversal to save the "filepath" of leaf nodes. This made the LLM-based analysis much better. Didn't think much of it until the vendor asked a few months later about how I did it 😅

    Haven't worked in big tech yet but yeah.

    Other quick examples conceptually:

    • you can build a graph at scale using Redis. Since graphs can be expressed as sparse matrices, and sparse matrices are implemented on computers using hashmaps, and Redis is a gigantic hashmap/KV store

    • Never use set() in Python, you get nondeterministic results. Instead use the OrderedSet object

    • Workflows are generally DAGs, ie Airflow or even LangGraph. The better you construct workflows as composable DAGs, the smoother these are to debug/extend

    • 0
      Profile picture
      Senior Software Engineer [OP]
      Taro Community
      3 months ago

      That sounds like a really good example of using trees! thanks for sharing!