How to answer Technical questions
Interview Guide
Answers (1)
You'll get access to over 3,000 product manager interview questions and answers
Recommended by over 100k members
So, the base assumption here is that my grandma is totally unaware of any of the programming concepts. Thus, with the above assumption I would like to give the following example.
Hey Grandma!, assume that you are standing in a queue of people and naturally you would want to know how many people are there before you. To know the same, you can move to the side and start counting. But like always, you'll be afraid what if you miss your position in the line.
At this juncture, you'll be trying to ask the person before you on how many are standing ahead of him. Assuming he also doesn't know, he'll naturally ask the person before him. This will continue on and on until the very first person gets the question. Now, the first person would say "0 people are standing ahead of him". The second hearing this, would reply to the 3rd, " 1 person is before him". The 3rd will reply to the 4th, "2 people are before me". This process once again gets on and on until the person before grandma knows how many people are before him and replies the same to you.
So this way of getting information by repeatedly doing the same thing until a condition is met is called Recursion. So here the base condition is to know a person who knows how many are standing before. Once the condition is met the answer starts flowing back to the caller. Here the caller was you, Grandma.
So the actual definition of recursion is, Solving a problem by using a simpler version of the problem itself.
Hey Grandma!, assume that you are standing in a queue of people and naturally you would want to know how many people are there before you. To know the same, you can move to the side and start counting. But like always, you'll be afraid what if you miss your position in the line.
At this juncture, you'll be trying to ask the person before you on how many are standing ahead of him. Assuming he also doesn't know, he'll naturally ask the person before him. This will continue on and on until the very first person gets the question. Now, the first person would say "0 people are standing ahead of him". The second hearing this, would reply to the 3rd, " 1 person is before him". The 3rd will reply to the 4th, "2 people are before me". This process once again gets on and on until the person before grandma knows how many people are before him and replies the same to you.
So this way of getting information by repeatedly doing the same thing until a condition is met is called Recursion. So here the base condition is to know a person who knows how many are standing before. Once the condition is met the answer starts flowing back to the caller. Here the caller was you, Grandma.
So the actual definition of recursion is, Solving a problem by using a simpler version of the problem itself.
0 likes | 1 feedback
Top Startup interview questions
- Consider there is a company say LinkedIn. Which are the top three metrics you would see first thing in the morning?7 answers | 5.1k views
- What if before product launch, the director of engineering tells you that due to technical complexities, the development of the feature would significantly delay the launch of the product. As a PM, what will you do?3 answers | 740 views
- Estimate Airbnb's annual revenue in the US.2 answers | 1.2k views
- See Startup PM Interview Questions
Top Technical interview questions
- Imagine you're the product manager for Facebook Marketplace. Since many sellers don't mark items as sold, what existing functionality and metrics could you use to determine whether an item has likely sold?7 answers | 20.9k views
- What happens when you enter a URL in your browser?6 answers | 10.8k views
- How does TinyURL work?5 answers | 317k views
- See Technical PM Interview Questions
Top Startup interview questions
- What metrics would you use to measure the success of Amazon Echo Dot1 answers | 182 views
- Canva is experiencing a gradual decline in it's paid subscribers restricted to India? What is going wrong?1 answers | 159 views
- Share an example of a time when you empowered someone else.1 answers | 79 views
- See Startup PM Interview Questions
Top Technical interview questions
- How would you determine how to rank posts in the newsfeed?4 answers | 3.3k views
- The Chrome team is looking to reduce power utilization on mobile phones when using the browser. How would you go about solving this problem?3 answers | 3.7k views
- How would you map the ocean?3 answers | 2.9k views
- See Technical PM Interview Questions