...

Full Bio

Google Go Language Future, Programming Language Programmer Will Get Best Paid Jobs

69 days ago

New Coder Tool Promises to Turbo-Charge Coding In Major Programming Language

70 days ago

Why Many Companies Plan To Double Artificial Intelligence Projects In The Next Year

70 days ago

Why 75% SMBs Are Not Worried About Artifical Intelligence Killing Their Jobs

70 days ago

Interview Study Guide for Data Science To Get Job Quickly

73 days ago

Highest Paying Programming Language, Skills: Here Are The Top Earners

637155 views

Top 10 Best Countries for Software Engineers to Work & High in-Demand Programming Languages

469308 views

Which Programming Languages in Demand & Earn The Highest Salaries?

443487 views

50+ Data Structure, Algorithms & Programming Languages Interview Questions for Programmers

261759 views

100+ Data Structure, Algorithms & Programming Language Interview Questions Answers for Programmers - Part 1

223878 views

### Follow These Steps To Crack Any Dynamic Programming Language Interview Problem

**Refdash, Google**, and at

**startup**s, I've been a part of, and some of the most common questions that make engineers uneasy are the ones that involve Dynamic Programming Language.

- How to recognize a Dynamic Programming Language problem
- Identify problem variables
- Clearly express the recurrence relation
- Identify the base cases
- Decide if you want to implement it iteratively or recursively
- Add memoization
- Determine time complexity

Recognizing a Dynamic Programming problem is often the most difficult step in solving it. Can the problem solution be expressed as a function of solutions to similar smaller problems?

- Array position (P)
- Speed (S)

Identify the changing parameters and determine the number of subproblems.

- (S, P + S); # if we do not change the speed
- (S - 1, P + S - 1); # if we change the speed by -1
- (S + 1, P + S + 1); # if we change the speed by +1

Recurrence relation: Assuming you have computed the subproblems, how would you compute the main problem?

- P should be within the bounds of the given runway
- P cannot be such that runway[P] is false because that would mean that we're standing on a spike
- S cannot be negative, and a S==0 indicates that we're done

- Store your function result into your memory before every return statement
- Look up the memory for the function result before you start doing any other computation

- I created a runway of length 1000 with spikes in random places (I chose to have a probability of a spike being in any given spot to be 20%)
- initSpeed = 30
- I ran all functions 10 times and measured the average time of execution

- Count the number of states - this will depend on the number of changing parameters in your problem
- Think about the work done per each state. In other words, if everything else but one state has been computed, how much work do you have to do to compute that last state?

- P is the set of all positions (|P| indicates the number of elements in P)
- S is the set of all speeds