#1 How to approach the problem Solving

January 26, 2023

So,
whenever you see a problem we try to think how to solve the problem in language specific way. For eg :

merge-two-sorted-arrays : For this problem you immediately start things of the loop , start<end condition and recursion but that approach is little off. I emphasise that i wrong little off and not wrong , reason is the latter is faster and muscle memory works.

How i believe problem should be approached.

Think of the logic , i.e divide and conquer would work , how array will be divided and take a live example of the working , With that you would understand the working steps involved and then take 1 or 2 example to verify it covers it and then after checking the edge cases. Write a psuedo code (this is language independent).

the above steps might seems to be a hassle and extra work but trust me , Methodical persons goes longer.

follow this approach and please tell in the comments whether this little change improved you or not. P.S In interview they expect this approach coz with the you will know that your thought process is correct and you understand the use case completely.

Go to the next lecture to see how i approached a simple problem with same approach as above.


Profile picture

Created and Maintained by Kanishk Verma

Works in Goldman Sachs and trying to share little knowledge I have.

@KanishkVerma97

Comments