Wednesday, March 24, 2021

linkedlist notes

 CreateList(),createsandreturnsanew,emptylist.

• InsertListNode(L,p,n),addsnodenafternodepinlistL.Ifpisnull,then we insert n as the new head of the list. The function returns a pointer to n. We assume that the node n has already been created with some data that we want to add in the list. We will not get into the details on how nodes are actually created. Briefly, some memory must be allocated and initialized, so that the node contains the data we want and a pointer. InsertListNode then needs only change pointers. It must make the pointer of n point to the next node, or to null, if p was the last node of the list. It must also change the pointer of p to point to n, if p is not null.

• InsertInList(L, p, d), adds a node containing d after node p in list L. If p is null, then we insert the new node as the new head of the list. The function returns a pointer to the newly inserted node. The difference with InsertListNode is that InsertInList creates the node that will contain d, whereas InsertListNode takes an already created node and inserts it in the list. InsertListNode inserts nodes, whereas InsertInList inserts data contained in nodes it creates. That means that InsertInList can use InsertListNode to insert in the list the node it creates.


RemoveListNode(L, p, r), removes node r from the list and returns that node; p points to the node preceding r in the list, or null if r is the head. We will see that we need to know p in order to remove the item pointed by r efficiently. If r is not in the list, it returns null.

• RemoveFromList(L, d), removes the first node containing d from the list and returns the node. The difference with RemoveListNode is that it will search the list for the node containing d, find it, and remove it; d does not point to the node itself; it is the data contained inside the node. If there is no node containing d in the list, RemoveFromList returns null.

• GetNextListNode(L, p), returns the node following p in list L. If p is the last node in the list, then it returns null. If p is null, then it returns the first node of L, the head. The returned node is not removed from the list.

• SearchInList(L, d), searches the list L for the first node containing d. It returns the node, or null if no such node exists; the node is not removed from the list.

Difference between training, seminar, workshop, coaching, conference, symposium, webinar, course, lesson, class

training -the process of learning the skills you need to do a particular job or activity

workshop - training class or seminar in which the participants work individually and/or in groups to solve actual work related tasks to gain hands-on experience

webinar  - an occasion when a group of people go on the internet at the same time to study and discuss something

seminar - formal presentation by one or more experts in which the attendees are encouraged to discuss the subject matter

coaching - extending traditional training methods to include focus on (1) an individual's needs and accomplishments, (2) close observation, and (3) impartial and non-judgmental feedback on performance

symposium  - a meeting where experts discuss a particular subject

conference  - a large meeting, often lasting a few days, where people who are interested in a particular subject come together to discuss ideas

course  -a series of lessons about a particular subject

lesson  - a period of time when a teacher teaches people

class - a period of time in which students are taught something

Monday, March 15, 2021

Icons

 Process:

https://thenounproject.com/search/?q=process&i=363475


Constraint: 

https://www.vectorstock.com/royalty-free-vector/constraint-icon-simple-element-vector-27077967


Invariant:

https://thenounproject.com/term/constant/239044/


Patterns of Reasoning:

https://thenounproject.com/term/pattern-lock/993151/


Insight:

https://www.pngitem.com/middle/wiwTw_data-insight-icon-png-transparent-png/


Crawl:

https://thumbs.dreamstime.com/z/crawling-man-icon-flat-design-gray-color-symbol-modern-ui-web-navigation-sign-illustration-element-crawling-man-icon-flat-design-114966254.jpg


Walk:

https://thenounproject.com/term/walk/709031



Run:

https://upload.wikimedia.org/wikipedia/commons/b/b0/Running_icon_-_Noun_Project_17825.svg


Analytical Reasoning:

https://s3.amazonaws.com/wj-cdn/uploads/aba2a20d6675bb1f8333eff5027c9760


Use the top image on the D section


Visual Model:

https://icons8.com/icon/55808/3d-model



Pricing Section:

book:


https://stock.adobe.com/search?k=%22book+icon%22&asset_id=190506160


course:

https://www.freeiconspng.com/img/15341


coaching:

https://www.123rf.com/photo_111338969_stock-vector-coaching-icon-coaching-symbol-design-from-human-resources-collection-.html



community:

https://thenounproject.com/search/?q=community&i=2522271


Problem Classification

https://thenounproject.com/search/?q=classification&i=1705417


Never Get Stuck

https://thenounproject.com/term/wall/1171258/

https://thenounproject.com/search/?q=maze&i=369013


Over 200 Problems

https://thenounproject.com/term/quantity/2463381/


No Memorization Required

https://thenounproject.com/search/?q=memorization&i=544757

https://thenounproject.com/term/wrong/539385/


Stand Out from the Crowd

https://thenounproject.com/search/?q=community&i=199749


Inductive and Deductive Reasoning

https://thenounproject.com/search/?q=reasoning&i=3239961



Practice:

https://s3-eu-central-1.amazonaws.com/glossika-blog/2019/05/use-deliberate-practice-to-learn-foreign-languages.png


Use the rightmost diagram. Remove all the texts in this diagram.


Theory

https://thumbs.dreamstime.com/z/atomic-theory-icon-filled-thin-line-outline-stroke-style-vector-illustration-two-colored-black-atomic-theory-atomic-180544804.jpg


Use the rightmost image.


Drills

https://thenounproject.com/search/?q=exercise&i=3507234


Analytical:

https://thenounproject.com/search/?q=deductive&i=79239




The Feynman Learning Technique

Learning occurs when you can explain the concepts and use it in a wide variety of situations. The more you know, the fewer blocks you will encounter, because most new things will connect to something you already understand.

The Feynman Technique turns information into knowledge that you can access easily without any memorization. There are four steps to this method. They are as follows:

  1. Pretend to teach a concept you want to learn about to a sixth grade student.
  2. Identify gaps in your explanation. Go back to the source material to better understand it.
  3. Organize and simplify.
  4. Share it.

Step 1: Pretend to Teach it to a Child

Take out a blank sheet of paper. At the top, write the topic you want to learn. Now write out everything you know about the subject as if you were teaching it to a child. They have just enough vocabulary to understand basic concepts and relationships. Force yourself to be as simple as possible.

We hide our lack of understanding by using complicated vocabulary and jargon. If you can’t define the words and terms you are using, you don’t really know the meaning of those words. Explanation must be at a sixth-grade reading level by using simple words and phrases.

When you write out an idea from start to finish in simple language that a child can understand, you force yourself to understand the concept at a deeper level and simplify relationships and connections between ideas. You can better explain the why behind your description of the what.

Some of the writing to teach will be easy. These are the areas where you have a clear understanding of the topic. But you will find many places where things are confusing to you.

Step 2: Identify Gaps in your Explanation

In the previous step you will identify areas where you struggle, you have gaps in your understanding in these areas. Gaps in your knowledge means you forget something important, aren’t able to explain it or simply have trouble thinking of how variables interact. Identifying gaps is a critical part of the learning process. Filling those gaps makes the learning stick.

Now that you know your gaps in understanding, go back to the source material. Supplement it with other sources. Look up definitions. Keep going until you can explain everything in basic terms.

Only when you can explain without jargon and in simple terms you demonstrate your understanding. If you need complicated terminology to explain, when someone asks you a question, you can only repeat what you’ve already said.

Simple terms can be rearranged and easily combined with other words to communicate your idea. When you can say something in multiple ways using different words, you understand it really well. Skipping the work needed to explain in a simple way leads to getting stuck when challenged.

Identifying the boundaries of your understanding is also a way of defining your circle of competence. When you know the topic and are honest about what you don’t know, you limit the mistakes you’re liable to make and increase your chance of success when applying knowledge.

Step 3. Organize and Simplify

Now you have a set of hand-crafted notes containing a simple explanation. Organize them into a story that you can tell from beginning to end. Read it out loud. If the explanation sounds confusing at any point, go back to the previous step of identifying the gaps in your explanation. Keep iterating until you have a clear story that you can tell others. You can use the Cornell notes taking template to organize your story. Download the template from: https://www.codingskill.net/assets/files/CornellNotesTemplate.pdf

If you follow this approach, over time you will end up with a lot of notes on different topics. When you revise your notes periodically, you will see just how much you retain.


Step 4: Share It


Share your understanding of the material with someone who knows little about the topic. A good test of your understanding is your ability to convey it to another person. You can read out directly what you’ve written. You can present it like a presentation. Make an attempt to share the material with at least one person who isn’t that familiar with it.

The questions you get and the feedback you receive are invaluable for further developing your understanding. Hearing the curiosity of your audience will likely stimulate your own curiosity and set you on a path for further learning. 

The Feynman Technique is also a different way of thinking that makes you tear ideas apart and reconstruct them from the ground up. Feynman understood the difference between knowing something and knowing the name of something, when you truly know something, you can use that knowledge broadly. When you only know the name of something, you don’t know its meaning and lack understanding. You can’t take it apart and play with it or use it to make new connections and generate new insights. When you know something, the labels are not important, because it’s not necessary to keep it in the box it came in.

Feynman’s explanations on why questions are simple and powerful. We talk in fact-deficient, confusing generalities to hide our lack of understanding. Take things apart. Staying at the abstract level does not promote understanding. Take apart the final solution; see how it works. See the cleverness of the different pieces; see the interactions between them. Learn something about the working code, the way the algorithm is put together, the ingenuity of people devising the algorithms and data structures.

Learning doesn’t happen in isolation. We learn from books, people, ideas and getting exposed to different ideas. Improving requires questioning your knowledge and the knowledge of others.

You can see how I applied this technique to learn about Topological Sort in my PDF notes: https://www.codingskill.net/assets/files/toposort.pdf. 

Read about interleaving as a study strategy: https://www.codingskill.net/assets/files/Interleaving.pdf. 

Download Feynman learning technique template: 

Book Content Outline

  1. Problem solving approaches/strategies (how to think)
  2. Learning/Study tips so material don't get forget that easily
  3. Problem patterns/tricks (not only problem categories)
  4. A curated list with decent amount of problems to get exposed to all categories and useful patterns/tricks (hopefully sequential, like building blocks)

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)