Hey Leetcoders,
I have been praticing leetcode from some time. But I do have these confusing points in my mind:
a) Whenever I see a problem, I could get to a brute force solution for most of the questions and a little more than half times to an optimized solution easily. However there are some questions , where there are some slick tricks with them. For example most of the greedy based questions have quite an interesting trick to them which improves the complexity. I see them, and then solve them / write code using that trick as advised by many folks. However I always have this confusion, if I see a similar question in an interview, I might not be able to use the same trick again. How do it get past this hurdle, how do I inculcate those tricks such that they come naturally to me during an interview?
I know a lot of folks might say practices makes you better, which I do understand, but am just checking with the community, if there is something that I can do to improve my ability to make these tricks come naturally to me. Let me know your thoughts.
b) Also a lot of interviewers say that, let us know if you have seen a question before, as an interviewer is able to assess if you have seen a question before. Also on the top of it most companies standard today for a technical screen or coding round interview is 2 LC medium questions within 45 mins. I am not sure how to get that good, that if I have not seen a question before which is an LC medium, I will be able to solve both of these within 45 mins? Any tips for how to improve on this?
I guess the answer again goes back to practice more and more under time constraint or join contests, I do understand and agree with it. Just wanted to check with the community, if there are some other tips from folks that I should focus on more to help me improve on this.
Let me know your thoughts folks, looking forward to your advice.