8 Tweets Mar 15, 2023
Do you want to know why people get rejected in FAANG interviews despite solving problems and having excellent resume? This is something very few people talk about but turns out to be a deciding factor in the last stages of selection.
(🧡)
Here are some do's and don'ts on writing modular code and how you can use these tips to your advantage while cracking FAANG interviews. Keep reading ⬇️
1) DRY (Don’t Repeat Yourself)
You can always reuse the code you have written if you modularize it. Always use sections of code that you have already written instead of rewriting them. This makes code more readable.
2) Abstract Out Code in a Function
This is critical. Use meaningful functions to write code that performs a specific function.
Do not scatter your logic throughout but keep it in one place.
3) Functions Should Perform Only One Task
Keep functions organised by letting them do just one activity. Do not clutter too many activities within one function.
4) Use Meaningful Function And Variable Names
Try to imply the type in variable names for eg. using the prefix β€œis_” for boolean type. The variable names should be simple but must indicate what it is being used for.
5) Do not overuse modularization
Something to be careful about: using too many functions and modules would make the code long. This will confuse you. Keep them to a certain limit.
That's a wrap!
If you enjoyed this thread:
1. Follow me @codedamncom for more of these
2. RT the tweet below to share this thread with your audience

Loading suggestions...