21

How do you become better at coming up with alternative solutions to a problem?

Profile picture
Anonymous User at Taro Community2 years ago

Both in the context of a data structure and algorithm problem and in the context of a software problem or any problem really it is important to weigh the pros and cons and have arguments to back your decision making.

Having the knowledge to come up with several solutions is challenging - how do you get good at this? Is experience the only answer? Do you have any techniques you put in place to help with this?

1.3K
3

Discussion

(3 comments)
  • 18
    Profile picture
    Tech Lead @ Robinhood, Meta, Course Hero
    2 years ago

    The main way is to just to talk to other people. Bounce your ideas off of them and seek their feedback using the techniques from this video: This Is How You Get Feedback - Making The Process Smooth

    Clearly explain your current approach and let your peers know that you genuinely welcome any and all input on alternatives and improvements. In the workplace, there's so many ways to achieve this:

    • Code review - This is a great place for the team to discuss potentially better approaches and push one another to write the best code possible. Earlier-in-career and onboarding engineers should really prioritize this to grow their technical skills fast. Here's a good video about how you can get richer code review comments faster: Quick Tips To Get Higher Quality Code Reviews Faster
    • System design meeting - We called this "Tech Review" back at Meta. The idea is that all the technical stakeholders on a project come together, usually around a technical design doc, and work together to flesh it out through the discussion of tradeoffs, milestones, and more. Here's a good discussion to help you improve at this skill: "How to improve on non-technical skills like writing Software design document?"
    • 1 on 1 meetings - If you have one of these with your tech lead, then that's the prime place to do it. Here's our masterclass about 1 on 1s: [Masterclass] How To Have Impactful 1 on 1 Meetings
    • Asking questions - This is sort of a superset of everything before this (they're all mediums to ask great questions in). Where I think a lot of engineers are held back is that they're afraid to ask these questions, and for these folks, I recommend this video: Asking Questions Is NOT A Sign Of Weakness

    The recent discussion around strengthening your technical communication skills should help here as well: "How do you get good at understanding and communicating technically?"

    Both in the context of a data structure and algorithm problem...

    DSA is much more straightforward as we talk about in this video: Effectively Learning Data Structures And Algorithms (DSA) For Software Engineer Interviews

    There's only really 2 angles:

    • Run-time
    • Space

    When you come up with a DSA solution, see if you can trade run-time for space (this is generally the one you should try as DSA solving is overwhelmingly based around optimizing run-time) or vice-versa. Any known DSA problem will have many, many alternative solutions online - You can read through them and extract patterns to learn how you can come up with these in the future.

  • 3
    Profile picture
    Mid-Level Software Engineer at Walmart
    9 months ago

    For me having a breadth of knowledge helped me to come up with alternative solutions for DS&A and System Design (Android).

    For DS&A understanding the in-depth working of each and every data structure and understanding the intuition for every algorithm will make you come up with multiple solution for a problem.

    Similarly for System Design, the more you read and the more you know it'll be easy to come up with multiple solutions for a problem

    Basically, Knowledge Is Wisdom!

  • 1
    Profile picture
    Anonymous User [OP]
    Taro Community
    2 years ago

    Thank you - really helpful!