I will watch interviews from now on instead of watching tutorials. Thank you for uploading it as a post. For freshers, its not just a post its a potential unlocker video. Really helpful for upscaling the base knowledge. Respect++
Don't take it hard solve like a puzzle just split up the problem and solve the splited problem in code and merge the problem and merge the code boom you got it... in merge string just split problem two concate alternate string so you can use loop for minimum length string after run balance extra string we will concate it to final result using substring method...
I guess Passing null will cause an error, because i guess react expects the dependency array to be an array or to none so Null won't be valid for it! The no dependency will cause it to run after every render and empty -once on mount
20:00 Merge String alternately let s1 = "Hello123456"; let s2 = "World"; let finalStr = ""; for (let i = 0; i < (s1.length > s2.length ? s1.length : s2.length); i++) { if (i < s1.length) finalStr += s1.charAt(i); if (i < s2.length) finalStr += s2.charAt(i); } console.log(finalStr);
" i < (s1.length > s2.length ? s1.length : s2.length)" bro instead of this can't we just write "i < (s1.length)", i already run it showing no error, please tell why you did that ??? thank you.
for the case when second string is longer than the first string. The logic of the for loop I wrote runs for the length of the largest string, so that all the characters from both the strings are traversed.
Bhai string marge wale question bhut aasan tha like 5 min me ho gya tha and bhut simple logic bhi tha, aapne kuch jada hi hard kar diya use or gor se deekho uska ans fir bhi glt hi aaya hai extra 'o' aaya hai usme , but bo bat hai ki thoda pressure environment ki bat ho jata hai, barna aap bhi bad me krke dekhte to badi aasani se ho jata
easy solution for merge string bro - const a = "Hello" const b = "World 1234" var ans = '' for(let i = 0; i < Math.max(a.length, b.length); i++){ if(i < a.length){ ans += a[i] } ans += b[i] } console.log(ans)
let arr = [[1, 2,[7,8]], [3, 4], [5, 6]] function flatArray(arr) { let res = [] for (let i = 0; i < arr.length; i++){ if (Array.isArray(arr[i])) { res.push(...flatArray(arr[i])) } else { res.push(arr[i]) } } return res } console.log(flatArray(arr));
After watching this interview I'm scared I'm in 1st year of college and this looks so hard furthermore it's for freshers and they are asking so many complicated questions
@@reactjsdeveloperinterview I just took addmission in computer science, so do I have enough time? And if yes then please please help me a bit I have so many questions to ask
Hello Sir, my name is Shekhar. I want to become a frontend developer, but I don't know which institute I should study in. Please tell me how and where to take classes.
To the Interviewer: You're testing the candidate for his basic concepts of JS deeply. I've learnt new things and I thank you for that. But, when they don't answer a question or give wrong answer. kindly explain him the answer. pls don't be like, it's not my headache, 'you figure it out later'
Hi, I hope you are doing good. After the interview, I ask every candidate whatever doubts he had regarding the questions asked in the interview or any queries regarding Frontend development personally. As I am taking the interview, it should feel like an interview and not question answer session. I may answer one or two questions here and there but not all the questions.
In JavaScript, the == operator performs type coercion when the types of the operands differ. Here’s what happens step-by-step: JavaScript sees that '1' (a string) and 1 (a number) are being compared. The == operator coerces the string '1' into the number 1. Now, both sides of the comparison are 1, so JavaScript evaluates '1' == 1 as true.So, console.log('1'==1) gives True as output
function merge(str1, str2) { let mergeStr = ""; for (var i = 0; i < (str1.length + str2.length); i++) { if (i < str1.length) mergeStr = mergeStr + str1[i]; if (i < str2.length) mergeStr = mergeStr + str2[i]; } console.log(mergeStr); }
2:17 what will function return function fun1() { return 2 } function fun2() { return 4 } let a = (fun1(), fun2()); console.log(a); The comma operator is used here: (fun1(), fun2()), The comma operator executes both functions, but only the result of the last expression is returned. In this case: 1. fun1() is called first and returns 2, but this result is ignored. 2. fun2() is called next and returns 4, which is the value assigned to 'a'.
This is what I believe would work... function sum(a, b) { if (b !== undefined) { // If the second argument is provided, return the sum directly return a + b; } else { // If only one argument is provided, return a function that takes the second argument return function(b) { return a + b; }; } }
In JavaScript, the == operator performs a comparison between two values after converting them to a common type. This process is known as type coercion. Because == doesn't check the data type(your answer goes here), it can sometimes lead to unexpected results.
var op = ' '; var a = 'HELLO'; var b = 'WORLD1234'; for(var i = 0; i < a.length || i < b.length; i++){ if (i < a.length){ op += a[i]; } if(i < b.length){ op += b[i]; } } console.log(op);
Check my code is this correct let str1 = "Hello"; let str2 = "World 1234" let out = "HWeolrllod 1234" function mergeString() { let res = ''; let combineLength = str1.length+str2.length; for(i=0; i
Thanks for the interview, Sir. I cracked a company last week
Congrats👏
@@reactjsdeveloperinterview Thank you Sir
@@AmirKhan-uh5vd which one bro
I will watch interviews from now on instead of watching tutorials.
Thank you for uploading it as a post.
For freshers, its not just a post its a potential unlocker video.
Really helpful for upscaling the base knowledge.
Respect++
It's not a real interview. It's a self interview but he delivered a good example interview.
how did you know that it wasn't a real interview?😅
@@aaishteru6709 Thanks got it 👍🏻
yeah, this is a practice interview
//Marge two string
let str1 = 'Hello'
let str2 = 'World'
//output = HWeolrllod;
let bag = '';
let i =0;j=0;
while(i
in the second condition use j
let str1 = 'Hello'
let str2 = 'World'
//output = HWeolrllod;
let ans="";
for(let i=0;i
No need two variables i and j, lmao. You just check if (str1[i] && str2[i]) are undefined then exit loop.
const str1 = 'hello'; const str2 = 'world';
let str = ''; let i = 0;
let str2new = ''; let str1new = '';
if (str1.length < str2.length) {
str2remain = str2.slice(str1.length);
let str2new = str2.slice(0, str1.length);
for (; i < str1.length; i++) {
str += str1[i];
str += str2new[i]
}
str += str2remain
} else if (str2.length < str1.length) {
str1remain = str1.slice(str2.length);
let str1new = str1.slice(0, str2.length);
for (; i < str2.length; i++) {
str += str2[i];
str += str1new[i]
}
str += str1remain
} else if (str1.length === str2.length) {
for (; i < str2.length; i++) {
str += str1[i];
str += str2[i];
}
};
console.log(str)
Bro.. the question of == and === came in the morning interview. Thanks 🤗
Dude why do we use === Tell me
@@gwwyy_ It checks if two operands are equal in the both value and in the type.
@@somaprakashrath1 ok bro thaku
@@gwwyy_ wlcm bro. And Be successful in your life ☺️
Where did you apply, lol I'm not getting any interview calls
Don't take it hard solve like a puzzle just split up the problem and solve the splited problem in code and merge the problem and merge the code boom you got it... in merge string just split problem two concate alternate string so you can use loop for minimum length string after run balance extra string we will concate it to final result using substring method...
const str1 = "abc2";
const str2 = "xyz13";
function addString(str1, str2) {
let minStr = Math.min(str1.length, str2.length);
let res = "";
for (let i = 0; i < minStr; i++) {
res += str1[i];
res += str2[i];
}
str1.length > str2.length
? (res += str1.substring(minStr, str1.length))
: (res += str2.substring(minStr, str2.length));
return res;
}
const res = addString(str1, str2);
console.log(res);
Student communication is Better then interviewer
const array = [1,[3,4],[6,[7,8]]]
const stack = [...array]
const res =[]
while(stack.length){
const pope = stack.pop();
if(Array.isArray(pope)){
stack.push(...pope)
}else{
res.push(pope)
}
}
console.log(res.reverse())
//Flat array
const arr=[[1,2],[2,3],[3,4]];
function arr1(arr){
let arr1=[]
for (let i=0;i
Fantastic interview! Really helpful...
I guess Passing null will cause an error, because i guess react expects the dependency array to be an array or to none so Null won't be valid for it! The no dependency will cause it to run after every render and empty -once on mount
20:00 Merge String alternately
let s1 = "Hello123456";
let s2 = "World";
let finalStr = "";
for (let i = 0; i < (s1.length > s2.length ? s1.length : s2.length); i++) {
if (i < s1.length) finalStr += s1.charAt(i);
if (i < s2.length) finalStr += s2.charAt(i);
}
console.log(finalStr);
function mergeAlternatively(str1, str2) {
let result = '';
const maxLength = Math.min(str1.length, str2.length);
for (let i = 0; i < maxLength; i++) {
result += str1[i] + str2[i];
}
return result;
}
const str1 = "hello";
const str2 = "world 1234";
const merged = mergeAlternatively(str1, str2);
console.log(merged);
Appreciated 👍🏻 @@James_Bond627
" i < (s1.length > s2.length ? s1.length : s2.length)" bro instead of this can't we just write "i < (s1.length)", i already run it showing no error, please tell why you did that ??? thank you.
for the case when second string is longer than the first string. The logic of the for loop I wrote runs for the length of the largest string, so that all the characters from both the strings are traversed.
It’s good but this is planned interview i think but this is good way to present himself
Bhai string marge wale question bhut aasan tha like 5 min me ho gya tha and bhut simple logic bhi tha, aapne kuch jada hi hard kar diya use or gor se deekho uska ans fir bhi glt hi aaya hai extra 'o' aaya hai usme , but bo bat hai ki thoda pressure environment ki bat ho jata hai, barna aap bhi bad me krke dekhte to badi aasani se ho jata
Okay bhai, Abbi toh practice kr rha hu
Okay bhai, Abbi toh practice kr rha hu
function mergeStrings(param1, param2) {
let mergeStr = "";
let maxlength = Math.max(param1.length, param2.length);
let suffix = "";
let sortlength = Math.min(param1.length, param2.length);
if (param1.length < param2.length) {
suffix = param2.slice(param1.length, param2.length);
} else {
suffix = param1.slice(param2.length, param1.length);
}
for (let i = 0; i < sortlength; i++) {
mergeStr = mergeStr.concat(param1[i], param2[i]);
}
if (suffix != "") {
mergeStr = mergeStr.concat(suffix);
}
return mergeStr;
}
let str1 = "hello";
let str2 = "worldABC";
Can you do an interview for Back End Developer
9/10 very good
I hope it was helpful.
Bhai meko dekh ke darr lag raha abb interview Dene se 😭😭
Dete time darne ka nahi bus dene ka
Interview
easy solution for merge string bro -
const a = "Hello"
const b = "World 1234"
var ans = ''
for(let i = 0; i < Math.max(a.length, b.length); i++){
if(i < a.length){
ans += a[i]
}
ans += b[i]
}
console.log(ans)
no this is mistake bro... you cannot have number
let arr = [[1, 2,[7,8]], [3, 4], [5, 6]]
function flatArray(arr) {
let res = []
for (let i = 0; i < arr.length; i++){
if (Array.isArray(arr[i])) {
res.push(...flatArray(arr[i]))
} else {
res.push(arr[i])
}
}
return res
}
console.log(flatArray(arr));
hey , how much lpa can we expect from this interview ????
finest one keep doning thankyou
Thanks for sharing. I love Ladakh. Good luck with your YT channel.
10:35 , it will give true
I'm really scared. What if don't come up with the answer in the interview😢
It's fine! You will only improve once you face such type of interviews.
Look - I wrote - the word "Function?" It don't - give any f(x) -- TTY-- you only!
After watching this interview I'm scared I'm in 1st year of college and this looks so hard furthermore it's for freshers and they are asking so many complicated questions
I can teach you
It's natural to feel like that! You have time in your hand. Just try to improve by 0.5% everyday.
@@reactjsdeveloperinterview I just took addmission in computer science, so do I have enough time? And if yes then please please help me a bit I have so many questions to ask
sir can u tell me how much java script do i have to do to before learning react
Thanks
const str1='hello';
const str2='world1234';
let str3='';
const Merge = () =>{
const min=Math.min(str1.length,str2.length)
console.log(min);
for(let i=0;istr2.length) {
str3+=str1.substring(min);
}
else{
str3+=str2.substring(min);
}
}
console.log(Merge(str1,str2))
console.log(str3);
Merge String alternatively 20:00
Hello Sir, my name is Shekhar. I want to become a frontend developer, but I don't know which institute I should study in. Please tell me how and where to take classes.
To the Interviewer: You're testing the candidate for his basic concepts of JS deeply. I've learnt new things and I thank you for that.
But, when they don't answer a question or give wrong answer. kindly explain him the answer. pls don't be like, it's not my headache, 'you figure it out later'
Hi,
I hope you are doing good. After the interview, I ask every candidate whatever doubts he had regarding the questions asked in the interview or any queries regarding Frontend development personally. As I am taking the interview, it should feel like an interview and not question answer session. I may answer one or two questions here and there but not all the questions.
Excellent
his voice is very loud and clear ,,,what is the headphones his using?
razer heaphones it is
I was using Razer BlackShark V2 X
While(true){
console.log('over hear..');
}
This interview was for freshers or experience?
Fresher
In JavaScript, the == operator performs type coercion when the types of the operands differ. Here’s what happens step-by-step:
JavaScript sees that '1' (a string) and 1 (a number) are being compared.
The == operator coerces the string '1' into the number 1.
Now, both sides of the comparison are 1, so JavaScript evaluates '1' == 1 as true.So, console.log('1'==1) gives True as output
function merge(str1, str2) {
let mergeStr = "";
for (var i = 0; i < (str1.length + str2.length); i++) {
if (i < str1.length)
mergeStr = mergeStr + str1[i];
if (i < str2.length)
mergeStr = mergeStr + str2[i];
}
console.log(mergeStr);
}
Can you provide the file that he is working on
const arr=[[1,2],[2,3],[3,4]];
function arr1(arr){
let arr1=[]
for (let i=0;i
Isn't the interview bit long 20 30 mins is enough
no according to this job market it is sufficient
What package they offered you?
Which keyboard he is using?
Redragon K617 Fizz
20:00
const str1 = "Hello";
const str2 = "World";
function merge2Strings() {
let arr1 = [...str1];
let arr2 = [...str2];
let i = 0;
let length = arr1.length > arr2.length ? arr1.length : arr2.length;
let res = "";
while(i < length) {
if(arr1[i]) res += arr1[i]
if(arr2[i]) res += arr2[i]
i++;
}
return res;
}
console.log(merge2Strings());
function merge(s1, s2) {
let s3 = ''
let i = 0
let j = 0
while (i < s1.length || j < s2.length) {
let p = s1[i++]
if(p != undefined) s3 += p
p = s2[j++]
if(p != undefined) s3 += p
}
return s3
}
Can this be also the answer cause i tried to be faster and did not optimize
hello sir i wnat know the ans of sum((2)(3))
sum(2,3)
Is frontend developer still good to learn now? If I start learning today will I get job?
Yes! Why not...Please go ahead if you have the passion for development...
Can anyone explain this? 44:52
Dolly Chai Wala Nothing Do this .😅😢
What was the package for this interview
₹101k
Salary??
Bhai fresher k liye Etna lamba interview kon karta h
Exactly max 30-35 minutes if all goes well..
What was the package for this job interviewed for?
50 cr
2:17 what will function return
function fun1() {
return 2
}
function fun2() {
return 4
}
let a = (fun1(), fun2());
console.log(a);
The comma operator is used here: (fun1(), fun2()), The comma operator executes both functions, but only the result of the last expression is returned.
In this case:
1. fun1() is called first and returns 2, but this result is ignored.
2. fun2() is called next and returns 4, which is the value assigned to 'a'.
47:05 Flatten Array without in built functions
const arr = [[1, 2], [3, 4], [5, 6], [7, 8], [9, 0]];
let resultArr = [];
function arrayFlatten(val) {
if (Array.isArray(val)) val.forEach(arrayFlatten);
else resultArr.push(val);
return resultArr;
}
console.log(arrayFlatten(arr));
How come ur allowed to wear headphones 😂
Omo 😂😂😂God help me
Guy 😂
Ye Fresher ke liye h 😳
Yes! I asked him few hard level questions because the candidate was able to answer simple to moderate level questions easily,
bro can you tell me the headphone model bro... really helpful.......
Razer BlackShark v2 i guess
@@J-hf8ng thanks bro... I find it using Amazon scanner.....
Razer BlackShark V2 X
What will be the package
If you selected after this level of fantastic interview???
Please reply
3lpa
2.15 lpa
2lpa
can someone explain 44:39 ?
Please someone explain this. I think the interviewer was just asking to provide another currying function?
This is what I believe would work...
function sum(a, b) {
if (b !== undefined) {
// If the second argument is provided, return the sum directly
return a + b;
} else {
// If only one argument is provided, return a function that takes the second argument
return function(b) {
return a + b;
};
}
}
Damn man its illogical to say that == not check data type just learn about type corecion.
In JavaScript, the == operator performs a comparison between two values after converting them to a common type. This process is known as type coercion. Because == doesn't check the data type(your answer goes here), it can sometimes lead to unexpected results.
@@GG_SYMBIOTE claps
@@aysuh-n3g not my words, from chatGPT, give it a shot, learning the difference
Sure, I'll learn that. I'd suggest you to check some of the explanations, how == and === works
its a fake interview bro
Get well soon!
Is that english ?
var op = ' ';
var a = 'HELLO';
var b = 'WORLD1234';
for(var i = 0; i < a.length || i < b.length; i++){
if (i < a.length){
op += a[i];
}
if(i < b.length){
op += b[i];
}
}
console.log(op);
amir bhai linkedin ID do apna
😢itne. Tagde laval pr. Interview hota hi ni fresher ka pgl
Hota hai bro 🙃
Check my code is this correct
let str1 = "Hello";
let str2 = "World 1234"
let out = "HWeolrllod 1234"
function mergeString() {
let res = '';
let combineLength = str1.length+str2.length;
for(i=0; i
/2''pxn rtv II vkx ant < ar br pjz < sfr ba rwch < int=cjx mol/
/~8x tmp rayz wb ar br pjs < rwch 2''pxn /
/ba HUD ~8x vw < ar br alien tyl chp < par rwch h6:h2> mol i.e. cnnon/
/+ pachf-stp + df=vkx ant - at ar br pjs - sfr cjx mol - alien zfr ba - 8x tmp rayz wb/
const str1 = "Hello"
const str2 = "Pkew"
console.log(str2.charAt(0))
const max = Math.max(str1.length,str2.length)
let res= ""
for(let i=0;i