Sunday, March 07, 2021

Learning to Solve the Coding Problem

 Learn the reasoning behind a solution and how they derived that solution. After a few days, go back and solve the same problem again from scratch without any reference. Even if you remember the gist of the solution, you would still have to implement it again, which can be a challenge. You can also look at the solution in a different language and code it in a language more familiar to you. Understand the thought process behind a solution and how to derive it. Ideally use only the hints so you don’t look at the complete solution and have the chance to solve the problems on your own. But the goal is to reach a state where you can come up with optimal solutions without looking at the answer. This just takes practice and time.


Build a solution from scratch. Get into the habit of getting your implementation to work. If you have difficulty to get it to work, you can then rule it out and move on to another approach. Speed should not be the focus. Developing a method of working through the problem in a methodical way with a set number of steps is the goal. Speed will be a byproduct of refining your method of approaching a problem you've never seen before.


Part of the process is working through frustration, finding a starting point and building confidence in your solution. You must expect to work through those uncomfortable moments. Do not look at the solution until you have your own working implementation. Do not write a single line of code until you have written what you think is an entire working solution on paper.


If you are passing some of the test cases and can't think of any other solution after spending a significant amount of time on it then look up the solution. Read the algorithm and then implement it. Do not look at the solution and copy and paste the solution in to add a +1 to your record.


There's no short cuts. It's hard work, discipline and spending time working through it. The point isn't solving the problem. The point is improving your problem solving skills and communicating how you're going to approach the problem before writing code.


 The hard part isn’t solving the problems themselves, but rather overcoming the mental barriers and having the discipline to solve the problems consistently.

 

Study Links

 https://medium.com/basecs

https://www.youtube.com/playlist?list=PLDV1Zeh2NRsB6SWUrDFW2RmDotAfPbeHu

http://www.youtube.com/mycodeschool

https://www.udemy.com/course/introduction-to-data-structures-algorithms-in-java/#/)

http://cp-algorithms.com/

https://www.reddit.com/r/cscareerquestions/comments/bc85gv/i_have_to_literally_lookup_up_every_leetcode/

https://medium.com/@sourabreddy

https://www.reddit.com/r/cscareerquestions/comments/6luszf/a_leetcode_grinding_guide/

https://teachyourselfcs.com/

https://bottomupcs.com/intro.xhtml#d0e93

https://techdevguide.withgoogle.com/resources?no-filter=true


Thursday, March 04, 2021

Long Term Goal

 1. Solving 1500 problems is NOT practical

2. Two types of problem on LC.

    1. Problems Skills

    2. Mundane coding exercise

3. Copying code from their notes.

4. Just show the finished product. 

    Thinking process is more important.

5. Why does this work?

6. Very abstract explanations.

7. Stanford: Code for demos.

8. What to emphasize? Graph topics IK.

9. algo + data structures

   Software Engineer - 2021

   Chips - Go ALL IN.

10. Slack access

11. Kills Two Birds in One Stone

      - Russel Brunson

      - Competitive Research

      - Nomad life

12. Build a product that delivers the most value for the customers

     - $50

     - $500

     - $2000


50% - Problem Solving

50% - Coding Drills


1. Wyzant

2. Course Hero 

3. codementor.io   


   Luck + Personality 


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)


Saturday, January 23, 2021

Desirable Difficulty

UCLA professor Robert Bjork has argued that desirable difficulty is actually required for us to upskill and move to another level.

Consider two kinds of batting practice. In one, the pitches are chunked into categories—twenty-five fastballs, twenty-five curve balls—in a predictable rhythm. At the end of this practice, hitters reported feeling a sense of confidence and flow.

The alternative involves mixing up the pitches randomly. Here, the batters reported frustration and less satisfaction. But teacher Torre’ Mills points out that the random method, where desirable difficulty is at work, actually improves players’ skills more than the chunked approach.

Desirable difficulty is the hard work of doing hard work. Setting ourselves up for things that cause a struggle, because we know that after the struggle, we’ll be at a new level.

Learning almost always involves incompetence. Shortly before we get to the next level, we realize that we’re not yet at that level and we feel insufficient. The difficulty is real, and it’s desirable if our goal is to move forward.

When we intentionally avoid desirable difficulty, our practice suffers, because we’re only coasting.

The commitment, then, is to sign up for days, weeks, or years of serial incompetence and occasional frustration. To seek out desirable difficulty on our way to a place where our flow is actually productive in service of the change we seek to make.

Seth Godin. “The Practice.” 

Monday, January 18, 2021

Learning Environment

 Learn in a relaxed environment. The best recall occurs when brainwave patterns show a relaxed state.

Learn in a multi-sensory environment by involving visual, auditory and kinesthetic activities.

Use color! This stimulates the right brain and helps recall.

Make sure you take breaks every hour.

Try to relate what you are learning to a bigger picture.

Reinforce what you have learned through practice and review.