Tip 1 : Practice more problem-solving questions
Tip 2 : Understand the concepts in depth
Tip 3 : Try to work on one or two hands-on projects to get more experience in that stack.
Tip 1 : Add some good projects to resume
Tip 2 : Put things that you know well and not technologies that you don't know.



Step 1 : I solved with brute forces using for loop.
Step 2 : The interviewer asked me to optimize the solution.
Step 3 : Then I came up with a log n solution.
What is deadlock and its types?
A deadlock in OS is a situation in which more than one process is blocked because it is holding a resource and also requires some resource that is acquired by some other process. The four necessary conditions for a deadlock situation to occur are mutual exclusion, hold and wait, no preemption and circular set.
We have a standard approach to system design which is explained more thoroughly in the article here. However, the steps are summarised below:
Requirements clarification: Making sure we have all the information before starting. This may include how many requests or users we are expecting.
Back of the envelope estimation: Doing some quick calculations to gauge the necessary system performance. For example, how much storage or bandwidth do we need?
System interface design: What will our system look like from the outside, how will people interact with it? Generally this is the API contract.
Data model design: What our data will look like when we store it. At this point we could be thinking about relational vs non-relational models.
Logical design: Fitting it together in a rough system! At this point I’m thinking at a level of ‘how would I explain my idea to someone who knows nothing about tech?’
Physical design: Now we start worrying about servers, programming languages and the implementation details. We can superimpose these on top of the logical design.
Identify and resolve bottlenecks: At this stage we will have a working system! We now refine the design.

Here's your problem of the day
Solving this problem will increase your chance to get selected in this company
How do you remove whitespace from the start of a string?