good interview, and that was a very nice question u asked the intern and since im also learning i tried to solve it as well ;D here is my implementation of the answers to to the question using recursion in javascript //sample data const items = [ { id: 1, name: "Item 1", children: [ { id: 11, name: "item 11", children: [ { id: 22, name: "item 22" }, { id: 23, name: "item 23" }, ], }, { id: 12, name: "item 12" }, { id: 13, name: "item 13" }, ], }, { id: 2, name: "Item 2", }, { id: 3, name: "Item 3", }, ]; //my solution function extractAllObjects(array) { let result = []; function traverse(items) { for (let item of items) { result.push(item); if (item.children) { traverse(item.children); } } } traverse(array); return result; } const allItems = extractAllObjects(items); console.log(allItems);
@@psrvlog5555 e kiyanem ayye mn js kalin use karalama na ... mata data structures and algorithm , probablity and statistic wage ewa awuaaj na ... digatama code karan giyoth set weida wade hariyatama ...
Aiye, mee AI kathandara nisaa api field ekee thanak hadaganna igenaganna oona technologies wenas wewida? thawa duratath C wage languages, SQL, REACT wagee deewal igenaganna ooneda? ehema naththam AI gana igenaganna oone weewida ee deewal athaaralaa?
Great concept! These videos will be very helpful for the students.
All the best 🙌
1 ස්ට් කමෙන්ට් ,,, ඔය වගේ විඩ්යෝ ගේන්න අයියේ දිගටම
very informative .keep it up
Prasad ! Excellent video! Keep educate and inspire people!
Nice stuff sir. Thank you for giving us the knowledge about how can we face to interviews
Thank you sir for sharing this video for us ❤
Me videos sehenna watinwa sir
Nice sir I'm also SE Student this video is very important itink❤
Data Structure and algorithms මතකත් නෑ.ගිය සෙම් එකේ කරේ.මේ සෙම් එකේ හිත හිත ඉන්නෙ ඇයි Data structure and algorithms ඉගැන්නුවේ කියලා
Data structures and Algorithms නැතුව programming කියලා එකක් නෑ
Thnxxxx brother
Good Work 🔥
Thanx
Ane loku pinak aiye oya magewage video dana ekama.❤
My Sql වල කිව්ව එරර්,සිකුරිටි ගැන පොඩ්ඩක් කියන්න පුළුවන් ද? ඩේට බේස් ගැන මේ දවස් වල කරනවා.
OWASP top 10 kiyala search karala balanna
meka supiriyak
good job bro 😍
Nice video
good interview, and that was a very nice question u asked the intern and since im also learning i tried to solve it as well ;D
here is my implementation of the answers to to the question using recursion in javascript
//sample data
const items = [
{
id: 1,
name: "Item 1",
children: [
{
id: 11,
name: "item 11",
children: [
{ id: 22, name: "item 22" },
{ id: 23, name: "item 23" },
],
},
{ id: 12, name: "item 12" },
{ id: 13, name: "item 13" },
],
},
{
id: 2,
name: "Item 2",
},
{
id: 3,
name: "Item 3",
},
];
//my solution
function extractAllObjects(array) {
let result = [];
function traverse(items) {
for (let item of items) {
result.push(item);
if (item.children) {
traverse(item.children);
}
}
}
traverse(array);
return result;
}
const allItems = extractAllObjects(items);
console.log(allItems);
//output looks like this
[
{ id: 1, name: 'Item 1', children: [ [Object], [Object], [Object] ] },
{ id: 11, name: 'item 11', children: [ [Object], [Object] ] },
{ id: 22, name: 'item 22' },
{ id: 23, name: 'item 23' },
{ id: 12, name: 'item 12' },
{ id: 13, name: 'item 13' },
{ id: 2, name: 'Item 2' },
{ id: 3, name: 'Item 3' }
]
Good try... now try to solve [Object]
Ayye mm ayyage mern video set ea baluwa .. java script gana loku danumak nathuwa baluwe ... mn AL maths karala physical select una... maths wala logical pathatha tikak tjiyana handa mn software degree ekak karanna awa private campus ekak.. eth mern video set eke mata samahara logical parth therenne nane .. mokadda karanna ina meka hada ganna .. mn danata coading set na wage handa degree eka iwara wela data science walain msc ekak karala e aththata yanna hithan innawa .. mokadda hoda ayye ... coading digatama karan giyoth logical parat therenne nathi weida ?
Data science walath logics thiyanawa... logical thinking amaru nam QA or BA side ekata yanna balanna
@@psrvlog5555 e kiyanem ayye mn js kalin use karalama na ... mata data structures and algorithm , probablity and statistic wage ewa awuaaj na ... digatama code karan giyoth set weida wade hariyatama ...
@@Ashen_220 oyage kamaththa thamai important... kamaththa thiyanawa nam allaganna puluwan
Aiye, mee AI kathandara nisaa api field ekee thanak hadaganna igenaganna oona technologies wenas wewida? thawa duratath C wage languages, SQL, REACT wagee deewal igenaganna ooneda? ehema naththam AI gana igenaganna oone weewida ee deewal athaaralaa?
දැනට industry එකේ demand එක තියන සාමාන්ය languages frameworks master කරන්න... AI වලින් බලපෑමක් වුණත් අද හෙට එක පාරට ම උඩ යට මාරු වෙන්න තියන chance එක අඩුයි... මේක පැහැදිලි කරලා මම වීඩියෝ එකක් කරන්නම්
@@psrvlog5555 hari aiyee ❤️
sir job ekak gannakota aya degree eka aran thiyenne government uni ekakinda pvt uni ekakinda kiyana eka balapanavada?
Na...
Ayye issarahata 2040 vage veddi AI nisa Software Engineer kenekvena eka vadak nadda? Cyber Security Engineer kenek vena eka hodada?
Reply please♡
මේ ගැන මම වීඩියෝ එකක් කරන්නම්
@@psrvlog5555 ❤
oya AL krn kenkd
Na mepara O/L
how can I find out a internship. Actually I'm looking for a Internship in these days.
Try LinkedIn. That's the best way to go
Thanks sir..have a whatsup group with u,group chats
Whatsapp 0713655352
❤
.net interview ekakuth danna sir
Ok
promo sm 💃
Me candidate select una kenekda?
Yes
Me candidate intern select unada
Yes
ayye podi dewal tikak dana ganna thiyenawa interview gana ayyata mail ekak dannam man subject eka kohomada danna ona?
Mock interview ekakata join wenna nam "Mock Interview" kiyala danna, naththam oyata kamathi ekak danna
Sinhalen illanna barida interview
එහෙම අමාරුයි
@@psrvlog5555 english කතා කරන්න අමරුයි අය්යා මම දැනට spring boot , anguler , mysql (full stack ) එක ඉගෙන ගන්න ගමන් ඉන්නෙ intern කෙනෙක්ට පොඩි හරි chance එකක් දෙන්න නැද්ද අයියා සින්හලෙන් oop concept හොදට explain කරන්න පුලුවන්
@@NimeshSajithkumara interview එකේදි try කරලා බලන්න... සමහරවිට ගොඩ දාගන්න පුලුවන් වෙයි
english walinda
@@NimeshSajithkumara sinhalen