Live Mock DSA | GeeksforGeeks
Key Takeaways
Live mock DSA interview using GeeksforGeeks' interview prep course
Full Transcript
foreign [Music] [Music] [Applause] [Music] foreign are you sure this course is just for 2499 yes and you know this is the only course with this expertise across the world no way yes way [Music] don't delay enroll now Geeks learning together [Music] hi hi are you sure you can prepare for product based companies through this course yes sitting at home no way yes way don't delay enroll now Jake's learning together yes hey uh what do you mean by a self-based course well the course material is available in the form of video lectures and there are multiple practice problems that come along as well so you can access all of it anywhere anytime and they are available to you for Lifetime no way oh yes way don't delay and enroll now Geeks learning together foreign good evening everyone welcome to the another session of Life mock DSA interview where we conduct interviews with our candidates very pleased to see you all here so let me quickly introduce myself first my name is suniti and I'm a mentor here at Geeks for geeks so let me add our today's candidate hi Raman hello everyone how are you I'm fine ma'am all right uh so welcome to this interview session so uh can you introduce yourself to us okay uh everyone my name is Raman I'm from third year passing my B Tech from the purnima group of institution I am currently uh living in Jaipur and I am currently doing flutter as my uh as my Android development and I'm I'm doing some DSA questions foreign thanks for the wonderful introduction so let me quickly explain you how we are going to proceed uh Google dock link has been shared with you right so I will be writing down the question there yeah and then you need to explain your approach and you can write a pseudo code as well and then once when we are sorted on that part I will share the gfg practice portals link with you and then you can code it there all right okay so can you please share your screen yeah sure man just uh wait a second I think I'm screening is visible I think so yes your screen is visible uh can you open the dock yes um I think this is so let me write down the first question is I don't know uh maybe you can just look at the question first like uh it is not that difficult question like it's an easy level question so maybe you can give a try um I'm actually uh from uh I think uh I I've done I just started my DSA in like uh one month ago so I did not reach at that previous part knowledge only all right uh okay so let me ask you some next question like okay just give me a moment yep okay all right so that is your question I'm given an array we will need to find the equilibrium point okay so the real important is such that so much all the elements the product is equal to some of all the elements after it okay uh let me help you with the test case for example if it is one three five two two so in this case the equilibrium Position will be at position 3 oh output that you have to fill this three output will be 3 because uh like I'll see this is the third position right we have five years so some of the elements before five that is one plus three that is giving us four right and some of values after five that's two plus two uh that is also uh giving us four right so that's why we are saying that the element at position five is equilibrium position right so you need to find out that in an array that is given to you okay yes I can do this thing like the yeah um first element to last foreign foreign foreign pattern okay like uh your one pointer is at the first position and your another pointer is at the last position right last position yes so so initially uh your pointer is having one and two right yes ma'am okay so up one and two per equals index minus one foreign foreign foreign we will get an answer to um foreign position s uh like what do you mean by Central position a center position midpoint sorry midpoint like midpoint though so much uh yes and uh what what you're saying all right uh apologies for that I guess there is some network issues from my end okay Adam and continue what you were saying yeah like you were saying that uh you will find out the center position so uh Librium Point need not to okay yes it can be any element before or after it okay like the approach you said that uh you will check uh if the first pointer is equal to the second pointer minus one or not like that approach should work fine because in that case we can check it if uh yes we have travels to the first half and the second half of the array so that can be used uh can you write down this Unicode for your approach okay man uh uh first foreign foreign statements right okay yeah you can just write the codes yes yeah it is J minus n minus I don't know right this is out right just a second yeah sure yeah till then everyone as I can see all of you almost shared the correct code so that's really nice uh yeah prefix of approach is the correct thing that we are going to do here and Dave approach will take n Square that's correct and also like if you all want to you know uh join these sessions then there is a Google form Link in the description so you all can fill it foreign like even if it is just fill out once I mean don't self reject right so just keep on practicing and uh just try to fill it out and do the practice like you know you should be able to solve at least two three easy to mid-level questions in a time span of 60 minutes so that is the criteria uh yes ma'am yes I'm back actually you know some homie shows oh yes sir so uh uh okay so my scan the egg left some music means the area left side go left some is equals to zero and your right side is open some calculate currently is equals to zero okay so uh okay okay okay we have okay map your first point remember [Applause] or J is equals to zero zero says zip okay J plus plus is foreign yes okay it's uh what is the time complexity for this code uh time complexity all right okay so uh can you think of any approach which will run in a linear time complexity um major oh okay uh can you tell me why this conclusion because it is it is really not necessary that you will get your answer before and by two uh there is no any such Factor okay yeah yeah cannot you know all right okay okay I'll just give you a hint because as this is a n Square approach so this is not the most optimal one right yes so yeah let me just give you a hint uh you can you know create an array where you can store the sum of all the elements still a point Have you heard of this prefix something yes ma'am yes ma'am I have heard about it yes so you can create a prefix some array right and then you can start iterating your array from the first point right okay after creating the prefix sum and uh when you will start iterating from the first point what or maybe you know you can just keep on subtracting your first element and inside some another variable you can keep on adding your last element right okay and maybe then you can check if it is working or not like uh this is uh you can use this prefix sum approach right so just try for that you are able to figure it out oh man uh you are saying hmm Vietnam prefix some approach here okay so like foreign [Music] okay um can you please explain again like prefix some yes I was gonna prefix sum is like uh when you are at first element I'll show you what output it will generate like say the array is this one three five six two two right so what prefix I'm just going with you is one four nine right okay 15 17 19. so oh yeah are you able to figure out what we're exactly doing like till yes so now can you create it you need to I mean accumulate the sum till a particular index all right okay okay yeah okay I I understood I understand okay um I will do in you know Java style like how I generally use it okay so subscribers like into front foreign [Music] is fine and then you can use an another variable but another array is not required okay yes okay so uh and I is equals to zero say I less than uh less than equal to array Dot length minus 1 and I press this foreign of I because that's some of I minus 1 just now foreign yeah all right that's okay okay so now once when you have created this uh prefix sum okay this is what we call a prefix summary so what now what you can do is or you can run another loop right first of all you can create a variable okay like uh yeah current sum or whatever it is like some you have already used right yes yeah so uh now what you can do is while you are traversing the array from first point till the last point you can uh from the current sum value that we have right you can subtract okay rather than creating this array you uh just write a variable there okay like uh don't create it as an array just write int sum an you you will be able to get it uh I'll just tell you what we can do is first of all find out the sum of the entire array okay foreign yeah so first of all what you need to do is you need to find out the sum of the entire array what whatever is the total sum okay then you can start the traversing and while traversing like you will have two variables the entire sum variable and a new variable okay so from the entire some variable keep on subtracting the current element okay and add the value of the current element in the current sum you can use some variable that we have so in that case what will happen One By One The Elements will get deleted and one by one they will get added as well in a new variable so if at any point both of these variables become equal you can say that that is an equilibrium first of all find out the total sum okay okay that will be an easy approach uh okay so first of all I'll okay some okay so uh end sum is equal to array of I okay I can okay okay sum is equals to zero to three minutes okay [Applause] foreign [Music] length minus 1 I plus plus just a second and us or yes yes and if the mirror left somehow foreign current index okay and um plus is equals to error of I is missing and answer foreign foreign foreign okay okay so class solution okay a public sector um actually many gfg portal could be used okay I got it I got it long area you are having a score of 60 there yes when I use the care but I'm not familiar so that's why I shifted to you know sorry Elite code okay man so if sum is equals to zero foreign just a declaration and I is equals to zero say I'll less than you'll be mirror and any halfway second and I think okay sum is equals to plus is okay I is foreign [Music] foreign foreign foreign uh you need to return I plus 1 because as you can see we are not returning the and also is okay uh let me just you know where is I hope this will work just familiar okay okay so I plus one sorry because it is one waste indexing actually that's why yes okay okay okay yeah uh you can submit it yep [Music] done great all right uh so that seems fine to me let us now move to our next question okay yes oh shall I close okay no you need not to close anything right now oh man the portal sorry okay so let me write down the second question that is uh map uh okay you write it uh river is given um and edit of integers representing price of tones okay okay so an array of integers is given to you which represents the price of the toys and you need to find the maximum number of toys okay okay man yeah so yeah so you need to find out the maximum number of toys that you can buy with a given amount K okay K is also given to you okay man yeah so let me help you with the test case yes let us say the array that is given to you is this okay and these are the prices of the choice so the maximum number of uh and the value of K let us say that is given to you is 50 okay so the match twice that you can buy with amount 50 is phone no actually you need to like if you will buy one toy again and again so you know you will have the same kind of a toy but we need to have a different kind of a toy all right so you can buy one toy only once all right okay ma'am yeah so uh this is a test case and let me help you with another test case as well yes [Applause] stories uh can you tell me how many toys you can buy if you have amount hundred with you um exactly so the output will be three yes okay so yeah this is the question you can start with your approach okay so uh just a second one let me just you know uh grasp this okay okay the maximum number of Toys yes okay so um okay so um uh let's say is and costs is equals to this is [Music] something like this one 5 10 12 00 and 1000. I hope your yoga [Music] okay one one is remaining um [Music] I less than n Matlock ARR dot length minus 1 error less than equal to cos dot length minus 1 and I press this is foreign [Music] [Music] foreign foreign [Music] foreign uh eight seconds sum is equals to sum Plus no matter index of I okay all right uh what is the time complexity of the code ma'am Big O of n okay okay uh so here you have used sorting function right yes so the ram complexity of sorting function will and login and login time complexity all right so if the Sorting is of time complexity and long and so what will be the type of complexity of the overall code I'm uh actually uh is Plus and so uh um thousand log outline what is greater n is greater or n log n is greater just a second and login I'm sorry big of n is greater yeah big of n is greater investment uh why actually in N log n you are multi see login will give you a positive value right yes sir yeah so if you are multiplying a positive value with n so won't that be greater than simple and uh no one actually the thing is division device uh sorry dividers for example for example five times log five so we comparatively come here like a generally generally preferred time complexity and foreign okay let me write down certain things and let us see if you are having an integer a okay and another integer is a multiplied by some positive number okay okay so which one will be greater uh a multiplied by positive number obviously all right so we have n we have n multiplied by some positive number remember I got your point I got your point is the login value here will be considered whenever cumulative time complexity no it actually what happens when you write down the code all right so whatever is the highest time complexity that is taken as the total time complexity of the port inside uh the code that you have written we have two time complexities right one is n and one is n login for the code okay okay yeah yeah so that is there uh okay let me share the questioning with you yes ma'am yes so are you here for this time complexity thing yes friend yes ma'am I I clearly understand yeah okay and for this sorting algorithm do you know which sorting algorithm is used by this sort function uh ma'am actually I think quick shot should be used because uh do quick short get time perplexity and login and what is the time complexity for merge sort come on uh I don't know actually when I merge socket I'm complexity okay that is actually oh yes yes I okay foreign nowhere it is [Music] sorry Eric yes and I is equals to zero I less than equal to AR Dot length minus 1 I have testers foreign foreign let's run this compilation error okay okay sum is equal to okay uh sorry I actually you know Harry should be here okay done done your output submit all right complicated okay great so that was about the second question uh you did pretty well in this all right Raman uh let us now okay so like Raman first of all I would like to know this from you like what is the level of DSA knowledge that you have right now uh man uh you can uh like binary search linear search sorting a sorting till quick so uh sorry cyclic sort how much would you rate yourself on the scale of 1 to 10 like uh five because I have uh you know many things to learn still many things like trees and other sorting also all right or not an issue so you know we all are learning right now okay so okay let us now move to the feedback part what I would say is like for the first question okay so uh like I was giving that tree question to you and then I just got to know that you are not very much comfortable with that so I changed the question so the first thing is that it might happen that you know in our interviews we are not as lucky as such that you know we'll get the questions in which we are comfortable with so this might happen so okay you are in your beginner phase so it was right like you know we yeah we were able to change the question and all that stuff but in real life scenario uh this might not happen right so yeah and then like you wrote down the code that is correct uh you were able to write down the N Square approach and then for the linear approach you needed some hints but after the hints you were able to write down the code so that's fine all right in the second question as well uh there were uh no hints required you were able to write down the question all by yourself you solved it completely just one thing you were not able to uh figure out time complexity correctly at the first go okay uh okay Mom yeah so that is one thing so uh taking into consideration that you are beginner in this field so on that basis if I would say that you performed well but uh like you know uh rating you on like the normal level uh like how the real interviews go on that basis I would say that maybe some things that you can work on is that first of all your problem solving skills okay you should be practicing that of course you will do so you should be practicing more and more questions you should be very clear about the time complexities and space complexities okay that part should be very clear to you so make sure uh whatever question you do after doing that question try to figure out the time complexity and the space complexity of the world I still think schedule time complexity and star analog and Hoagie I still think um complexity and star and Logan honey Yes actually uh the time complexity for the entire code is n plus n log n and not n into n log n okay when we do multiplication is that when there is a loop inside a loop or when there if this sort function has been inside a linear Loop right this n into n log n that time complexity will be there when you have used the sort function after doing a linear traversal of the array okay like uh let me show you an example suppose if you have written the code like for an is equal to 0 I is less than an i plus plus okay and then when you are writing sort array dot begin array Dot and okay in this case the TC would have been n into n log n why okay okay first of all we are traversing n times that's why n and for each traversal we are doing the Sorting right so that's why n into n log n in this case it would have been this but the code that you have written inside it the Sorting function is taking place separately it is not inside any Loop so the entire time complexity of your code will be n plus n log n okay okay so which uh yeah so which at the end asymptotically you can write it as n log n for like larger values of n it will be n log n will be greater than n so we always take the larger values so that's why you will be writing the complete time complexity to be n log n so yes yes okay so I would suggest you that whatever question you solve make sure that you are figuring out the TCS and essays of that question okay yes and for all the inbuilt functions that you are using make sure that you know that what is happening behind the screens what algorithms are actually being implemented okay yes ma'am and uh also like for the Sorting thing you said that you will consider it as for constant time because it is handled by Java Library so okay uh though it is handled by Java library but as it is inside your code so your code will be using the entire time complexity for that approach for that sort of approach okay yeah so uh are you clear for the time complexity of this yeah okay and uh one thing more that you know while interviews uh it is preferable if you just kind of have uh you should try to be uh you know like a little professional I mean a little professionalism is always appreciated right I mean you don't yeah you can create your interviewer as a friend like you know you can discuss your approaches and then you can let them about what you're thinking communication skills all those things should be there but uh the professionalism should also be there okay so um yeah these are something just try to build up your uh logical skills and that you can do with practice okay and get familiar with the practice portals get familiar with the IDS that we have okay yes yeah the practice portal of gfg is actually very much sufficient for whatever practices you need actually uh there is well curated list of all the sheets all right there are different sheets there so we have well curated list there are sorted by company and sorted by difficulty level sorted by submission like every kind of thing is there so may make sure you are practicing it and next thing is that make sure you are very much informed about PCS and SCS and make sure you are maintaining professionalism while interviewing okay yes yeah so uh that is all from my side anything from your side ah no man the experience was great I all right so thanks Raman for joining us uh we were pleased to have you and we hope that this session would help you as well in your preparation Journey all the best thank you all right guys so we had Raman with us and uh uh there were certain feedbacks that I have shared so make sure you all are also considering those feedbacks to have a good interview experience and also if any of you is interested to take part in these interview sessions then make sure that you are filling out the form that is there in the description of this video all right and all of you can share your interview experiences as well the form is again in the description all right so um that was all about today's session I hope all of you liked it if there is any feedback any suggestions make sure you are writing it down in our chat section and see you all in our next upcoming session still then keep up hard work keep on practicing bye everyone
Original Description
Watch this mock interview to evaluate your strengths & weaknesses alike. A great way for self-examination, make sure to formulate your tactics before your next interview!
In this webinar, we have Raman Tank, who will be interviewed by Suniti, Mentor at GeeksforGeeks.
For Complete Interview Prep, visit -https://practice.geeksforgeeks.org/courses/complete-interview-preparation?utm_source=youtube&utm_medium=courseteam_main_desc&utm_campaign=live_mock_dsa
------------------------------------------------------------------------------------------------------------------
Fill these forms to share your webinars with us:
📝 Live Mock
https://forms.gle/jtkeXRjPxnMvYa1D6
📝 Interview Experience
https://forms.gle/uLjwWXE5fsY5P3Kx9
------------------------------------------------------------------------------------------------------------------
Follow On Our Other Social Media Handles:
📱 Twitter: https://twitter.com/geeksforgeeks
📝 LinkedIn: https://www.linkedin.com/company/geeksforgeeks
🌐 Facebook: https://www.facebook.com/geeksforgeeks.org
📷 Instagram: https://www.instagram.com/geeks_for_geeks
👽 Reddit: https://www.reddit.com/user/geeksforgeeks
💬 Telegram: https://t.me/s/geeksforgeeks_official
Also, Subscribe if you haven't already! :)
#codingpreparation #coding #techincalround #datastructures #MockInterview #InterviewPreparation #LIVE
Watch on YouTube ↗
(saves to browser)
Sign in to unlock AI tutor explanation · ⚡30
Playlist
Uploads from GeeksforGeeks · GeeksforGeeks · 0 of 60
← Previous
Next →
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
How I got into Walmart | Shailesh Sharma
GeeksforGeeks
Upgrade yourself In 29 Days | GeeksforGeeks
GeeksforGeeks
Learn AWS Fundamentals For Free
GeeksforGeeks
Conversation With Young Achievers | Meet the winners of Bi-Wizard Coding Contest | GeeksforGeeks
GeeksforGeeks
Meet The Winners Of Bi-Wizard Coding Contests | GeeksforGeeks
GeeksforGeeks
Interview Prep Strategies | PayPal
GeeksforGeeks
OLX Interview Preparation Strategies | Hukam Singh
GeeksforGeeks
Meet Some More Winners Of Bi-Wizard Coding Contests | GeeksforGeeks
GeeksforGeeks
Live Mock DSA
GeeksforGeeks
Microsoft Azure For Absolute Beginners
GeeksforGeeks
Python for Data Science | Data Science Master Bootcamp | Arpit Jain
GeeksforGeeks
Getting Started with Data Analysis | Data Science Master Bootcamp | Ashish Jangra
GeeksforGeeks
How to prepare theory subjects for SDE interviews | Geeks Summer Carnival 2022
GeeksforGeeks
Get Your Tickets To The Geeks Summer Carnival | GeeksforGeeks
GeeksforGeeks
TED Talk Data Analysis Project | Data Science Master Bootcamp | Ashish Jangra
GeeksforGeeks
How I Secured AIR 9 in GATE'22 | Tushar
GeeksforGeeks
Learn Java Backend Development | Geeks Summer Carnival | GeeksforGeeks
GeeksforGeeks
How to Recognize which Data Structure to use in a question | Geeks Summer Carnival | GeeksforGeeks
GeeksforGeeks
Learn Data Structures and Algorithms | GeeksforGeeks
GeeksforGeeks
Interview experience at Flipkart | GeeksforGeeks
GeeksforGeeks
Lets Prepare for GATE'23 the Right Way | Sakshi Singhal | GeekSummerCarnival
GeeksforGeeks
Highest Paying Jobs in 2022 | Ishan Sharma | Geeks Summer Carnival 2022 | GeeksforGeeks
GeeksforGeeks
Geeks Summer Carnival 2022 | 5th April- 11th April | GeeksforGeeks
GeeksforGeeks
Preparing for SDE interviews | Soham Mukherjee | Geeks Summer Carnival 2022 | GeeksforGeeks
GeeksforGeeks
Full Stack Development with React & Node | Utkarsh Malik | Geeks Summer Carnival | GeeksforGeeks
GeeksforGeeks
Introduction to Open Source and Roadmap to GSOC 2022 | Geeks Summer Carnival 2022 | GeeksforGeeks
GeeksforGeeks
Web Scraping in Action | Geeks Summer Carnival 2022 | GeeksforGeeks
GeeksforGeeks
Getting Hired at BITCS via GfG Job Portal | Get Hired With GeeksforGeeks
GeeksforGeeks
How to build a faster landing Page | Geeks Summer Carnival 2022 | GeeksforGeeks
GeeksforGeeks
Geeks Summer Carnival | 5th To 11th April, 2022 | GeeksforGeeks
GeeksforGeeks
How to get ideas for Startup | Geeks Summer Carnival 2022 | GeeksforGeeks
GeeksforGeeks
Journey from Tier 3 to JusPay | GeeksforGeeks
GeeksforGeeks
Geeks Summer Carnival 2022 | GeeksforGeeks
GeeksforGeeks
Dispelling Myths and Pre conceptions of Programming Languages
GeeksforGeeks
Must Do System Design Questions
GeeksforGeeks
Understanding Sorting Techniques in an hour | Keerti Purswani | Geeks Summer Carnival
GeeksforGeeks
Get Hired at NEC | Job-A-Thon 8
GeeksforGeeks
Journey from Tier 3 college to Microsoft | GeeksforGeeks
GeeksforGeeks
Get Hired with GeeksforGeeks at SuperK | Job A Thon 8
GeeksforGeeks
GeeksforGeeks: Redesigned
GeeksforGeeks
From Tier 3 to cracking multiple interviews | GeeksforGeeks
GeeksforGeeks
Live Mock DSA
GeeksforGeeks
Youtube Data Analysis | Ashish Jangra | GeeksforGeeks
GeeksforGeeks
DSA Self-Paced Course Preview | Sandeep Jain | GeeksforGeeks
GeeksforGeeks
GATE Live Classes | Prepare for GATE CS 2023 | GeeksforGeeks
GeeksforGeeks
Journey from JIIT to Adobe
GeeksforGeeks
Life Is Unfair Ft. Shonty badmash | LIVE Discord Session | A GeeksforGeeks Exclusive
GeeksforGeeks
Interview Experience at Google | Tech Dose
GeeksforGeeks
Live Mock DSA
GeeksforGeeks
Interview Experience @ Amazon | GeeksforGeeks
GeeksforGeeks
My journey through the tech world from India to US | Vidushi | GeeksforGeeks
GeeksforGeeks
Complete Interview Preparation Course | GeeksforGeeks
GeeksforGeeks
Live Mock DSA
GeeksforGeeks
Getting Hired at FiftyFive Technologies | Job-a-thon 9.0
GeeksforGeeks
GFG Karlo, Ho Jayega | GeeksforGeeks ft. Khaleel Ahmed
GeeksforGeeks
How I got job offers from 2 big companies : Arcesium & Microsoft | GeeksforGeeks
GeeksforGeeks
LINUX for Beginners | GFG x Itversity
GeeksforGeeks
My interview experience at Walmart | GeeksforGeeks
GeeksforGeeks
Get Hired at Speckyfox
GeeksforGeeks
Live Mock DSA
GeeksforGeeks
Related Reads
📰
📰
📰
📰
Designing High-Availability Identity Systems Processing Billions of API Calls
Hackernoon
Graphify Setup in 20 Minutes: What Works, What Breaks, What’s Not Free
Medium · Programming
What if your software could explain its own outages?
Medium · Python
What if your software could explain its own outages?
Medium · LLM
🎓
Tutor Explanation
DeepCamp AI