Tuesday, February 23, 2021

Coding Interview Preparation Phases

Crawl Phase

Step 1 : Basic Concepts

Learn the basic data structures and algorithms. Learn the basic concepts and terminology to build your vocabulary of programming.

Step 2 : Code

Code the representation and operations for the data structures in your list.

Step 3 : Coding Drills

Design coding drills and practice the algorithms in your list.

Step 4 : Analyze

Analyze the time and space complexity of your code.

Step 5 : Test

Test your code using test cases. Debug and fix any bugs.

Step 6 : Take Notes

Take notes to help you review later. Learn from your mistakes.

Step 7 : Pros and Cons

After you have learned about the data structures in your list, compare the pros and cons of using similar data structures.

Walk Phase

Step 1 : Understand the Problem

Understand the problem statement before you design the algorithm.

Step 2 : Identify the Approach

Identify the data structure, algorithm and strategy to solve the problem.

Step 3 : Outline the Solution

Outline the solution at a high level.

Step 4 : Identify the Obstacles

Identify the obstacles to solving the problem. Revisit your study materials to gain a deeper understanding of the concepts. This is a top down approach to assimilation process.

Step 5 : Work Backwards

Work backwards from the solution. Design and practice coding drills. Practice coding the solution and understand the solution. This is a bottom up approach to assimilation process.

Step 6 : Test

Test your code with test cases.

Step 7 : Analyze

Analyze the time and space complexity of your solution.

Step 8 : Take Notes

Review your solution and reflect. Take notes on where you made mistakes and review your solution.

Run Phase

Step 1 : Form Links

Connect the dots between problems you solved in walk phase.

Step 2 : Problem Types

Solve problems by category.

Step 3 : Recognize Patterns

Summarize common patterns used for solving problems within the same category.

Step 4 : Take Notes

Take notes on where you made mistakes to help you review later.

Step 5 : Practice

Practice articulating your solution.

Step 6 : Evaluate Progress

Form a study group. Take mock interviews.

Customized Action Plan

I can guide you in creating a customized action plan for your situation. Sign up here https://go.oncehub.com/BalaParanj for your FREE session and we will figure it all out. Why is this free? Because I believe in Zig Ziglar's quote:

You can get everything in life you want if you will just help enough other people get what they want.

Thursday, February 11, 2021

Coding Interview Question

        # 0 1 2 3 4 5 6

input = [1,2,4,2,5,3,5]


def duplicates(input)

  hash = Hash.new(0)

  output = Hash.new([])

  

  input.each do |n|

    hash[n] += 1

  end

  

  hash.each do |k,v|

    if v > 1

      output[k] = []

      input.each_with_index do |e, i|

        if e == k

          output[k] << i

        end

      end

    end

  end

  

  output

end


p duplicates(input)