Google, FB & Amazon's favorite backtracking interview problem | java | Combination Sum: Leetcode 39

preview_player
Показать описание
#backtracking #interview #problem #Amazon #Facebook #Google #Important #Concept #Learning #Blind75

Solving the Combination Sum Leetcode problem in optimal time, using backtracking. The question has been asked by tech giants like Google, Facebook, Amazon, Microsoft and Uber.

Learning Backtracking approach using leetcode Combination Sum question that was asked in many Big Tech technical and programming interviews to the best companies in the world. We will be understanding the problem, get optimal solution, create the code in Java, complete the code and run it.

This concept is used to solve most of permutation combination problems.

Leetcode Medium: Dynamic Programming, Very Important, Concept and understanding.

Not stopping till we get employed in FAANG.
------------------------------------------------------------------------------------------------------------------------------------------------
(Contact me if you want to sponsor your product):

List of Most Important Questions and Solutions:

GitHub Repository for Questions solved so far:

(Support the channel, if videos helps you in any manner... Give me a Coffee)

About me and My Purpose:

I am a software engineer with 5+ years of experience @ Non-FAANG company. I have always been bad at coding and really bad at programming interviews. So, once I got employed in IT industry, I worked on operations (just so I can avoid coding).

But deep down I always wanted to work at an Elite IT company. So, I decided to face my fears, and to master coding & technical Interviews. I started with LeetCoding 1 problem a day. But I was facing issues with consistency, I would solve LC problems for week, and then drop it for 2-3 weeks. This lasted till 6 months.

And upon deeper investigation I found that I was not committed enought. Then suddenly my wife gave me an idea, that rather then focusing on solving a LC problem for my-self, why don't I commit to make videos on solving the LC problems. And try to complete atleast one video a day. Hence, I started this channel.

Here are reasons on why I started the channel.

1) To have a motive for me to solve leetcode problems.
2) In order to solve a LC problem, first I have to really understand the problem and explain my thought process, which solidifies my concepts.
3) I can document my progress. Also learn a new skill on how to run a YT channel.
4) My work can help other software engineers.
5) I can have something cool to mention in my linked-in and resume.

---------------------------------------------------------------------------------------------------------------------------------

Problem asked recently in following companies in coding interview:
Amazon interview,
Facebook interview,
Microsoft interview,
Airbnb interview,
Apple interview,
Snapchat interview,
Adobe interview,eBay interview,
Google interview,
Goldman Sachs interview,
Bloomberg interview,
LinkedIn interview,
Salesforce interview,
Uber interview,
Oracle interview,

My dream IT companies:

FAANG,
Facebook,
Google,
Amazon,
Netflix,
Microsoft,
apple,
doordash,
roblox,
stripe,
instacart,
uber,
lyft,
twitter,
linked In,
pinetrest,
bloomberg,
robinhood,
box,
two sigma,
byte dance,
tik tok,
air bnb,
nuro,
ui path,
oracle,
twitch,
data bricks,
waymo,
dropbox,
coinbase,
snowflake,
snap,
nvdia,
broadcom,
slack,
intel,
cisco,
indeed,
salesforce,
reddit,
wayfair,
okta,
splunk,
service now,
coursera,
square,
upgrade,
mozilla,
yelp,
unity,
ebay,
affirm,
stach adapt,
amplitude,
github,
wish,
brex,
etsy,
chime,
shopify,
amd,
GoDaddy,
IBM,

Introduction: 00:00
Understanding the Problem: 01:16
Building Optimal Solution with Explanation: 02:35
Coding: 18:10
Рекомендации по теме
Комментарии
Автор

Java Code

class Solution {
public List<List<Integer>> combinationSum(int[] candidates, int target) {


List<List<Integer>> res = new ArrayList<List<Integer>>();
List<Integer> combination = new ArrayList<>();

backTrack(target, res, combination, 0, candidates);
return res;
}

public void backTrack(int target, List<List<Integer>> res, List<Integer> combination,
int start, int[] candidates){
if(target == 0){
res.add(new
}
else if(target <0){
return;
}

for(int i=start; i<candidates.length; i++){

backTrack(target-candidates[i], res, combination, i, candidates);

}
}
}

DestinationFAANG
visit shbcf.ru