Do you modularize your code in technical interviews?

VMware
piedpippr

Go to company page VMware

piedpippr
Feb 10, 2021 6 Comments

In technical interviews do you write helper functions? I heard from the author of CTCI that you should

It helps make it slightly more readable. But doesn’t it make things harder to change if you have to change the signature or return type?

#ctci #interview #faang #facebook #snap #Google #Amazon

comments

Want to comment? LOG IN or SIGN UP
TOP 6 Comments
  • TikTok / Eng
    ihiy20

    Go to company page TikTok Eng

    ihiy20
    This is absolutely something you should be doing in interviews and it’s definitely one of the things interviewers look for to make sure you can write readable code
    Feb 11, 2021 3
    • TikTok / Eng
      ihiy20

      Go to company page TikTok Eng

      ihiy20
      That’s why i always write down everything in pseudo code while I’m walking through my solution to the problem. That way I don’t have to worry about types while coding and can just refer to the notes I left for myself... also you’re refactoring 30-40 lines at the most it’s not like you need to refactor an entire code base
      Feb 11, 2021
    • VMware
      piedpippr

      Go to company page VMware

      piedpippr
      OP
      I’m guessing you don’t interview in Java? Type signatures are expensive when you have to do each problem in 20 min
      Feb 11, 2021
  • Vudu
    SqSJ45

    Go to company page Vudu

    SqSJ45
    Yes, if you are experienced developer it will come naturally.
    Write your helper function last. If you have written a helper function already and it needs a new signature then write a new function. Of course you can ask interviewer if he wants to see helper function implementation
    Feb 12, 2021 0
  • Apple
    ljcr25

    Go to company page Apple

    ljcr25
    I did
    Feb 10, 2021 0