[0:01]So your name is Sandeep Sarla K, right? Yep. So how much experience you have right now? Uh, like I have around 3.6 years of experience. So currently I'm working as an SDE2 in an Mumbai based startup. So startup is into the Fintech credit analysis part. So there I there I'm working on an order tracking application, uh, which I have built from the scratch. Uh, and uh, me, so I basically won that particular application over there. So me along with uh under me there are uh three junior engineers. So we have built that system on the scratch. So yes that I worked with Infosys uh for around two years. Uh there I worked for a European telecom client uh as a backend engineer majorly like uh where I was handling the middleware layer for Austria country. Uh the APIs simple REST APIs and all. And with respect to tech stacks, uh like Infosys it was purely Java uh and MySQL DB and Spring Boot we have used. Uh but coming to the startup where I worked, uh I have used uh Java Spring Boot uh then MongoDB uh and AWS uh we have worked in and also a bit of React uh as a yeah the UI component which I have. You have mentioned Python as well in your. Yeah I have sorry I forgot about that. Yeah I have developed uh some services in Python using Flask and some major library a kind of in-house libraries to parse the image and all to get the text. Okay. So I can ask collective both question or you only comfortable in Java. Uh yeah I'm more comfortable in Java compared to. Okay, okay, great, great. So Java side uh you know Java 8 and uh add features, you know? Yeah uh yeah Java 8 release major features like streams uh lambda functions and like default methods and all. So in which the streams uh is the one where we can uh like whatever the collection we use, we can stream line into an uh input of object and we can apply additional filters or map it map it into some other form and I mean finally collect it into some other uh uh a list or some other end result. Uh so this actually uh uh eases the reduces the number of number of uh lines of code for whatever the operation and it uh it it it it presents our code in a better way. And compared to lambda function I mean uh coming back to lambda function lambda function is used to uh operate like I mean uh instead of writing the whole syntax of the functions and all it's it's kind of an uh generic uh uh statement what it does like if this is the input then what will be the operation which needs to be followed. So this can be this lambda can function can be used inside the stream as well like the in the filter methods and all. And yeah and one more feature like default method which I would like to explain is something like in interfaces like previously uh the method had to be overridden whenever we implementing an interface. But with the include of default methods there is an provision to provide an default implementation like if the if if the client class does not implement the uh does not override the method. So yeah I think yeah these are the major things and yeah then there are some uh date APIs and all like have. Okay. So you you also familiar with multithreading? Yeah uh I know the fundamentals and I have. I will ask to fundamental not time just going to do. Yeah sure. So you know what is difference between thread and process? Yeah uh so like thread is the smallest unit of a process.
[4:26]So like I mean uh a process can have multi threads to process has a main thread always and if if it required we can I mean if if there is any process and if there is any task which could be done uh like the uh parallelly by context switching then we can further divide it into multiple threads and we will be doing that. So and uh threads will be using the shared memories and all and uh but yeah process cannot be so let's say if if if I'm deploying an application in an EC2 server or something that is a process. Like some of my Java application or something and inside that process there is a main thread and there could be multiple other threads whatever the develop one and like if I if I deploy one more process like one more application let's say I deployed order service and I also deployed uh let's say uh customer service in one port and the other port then the those are nothing but the two process running in the server and inside the process there will be multiple threads. Okay. So what are advantage of multithreading? Uh yeah multi-threading uh as I said like uh let's say if if there is an there are two some operations which does not which is not dependent on each other. Uh there is no need of uh waiting of option I mean uh operation one to complete to execute operation two then we can execute it with different threads so that uh uh so that the time is saved and we could improve the efficiency of the program and yeah that's the main advantage of. So what are the life cycle of thread means what kind of state is required to complete the life cycle of thread? Yeah I guess I think it would be starting with the new state kind of state like I mean when the thread and when we like I mean if we go back like if he execute the dot start or something. So that would be move to the active state and where in the like I mean like if the CPU is free that would be in the running state and like if if it's waiting for a resource or something or let's say if a particular object is locked by some other thread then it would be moved into the waiting state or blocked state like I mean if if it will be idle for that particular time till uh till that resource is released from other other thread and finally like once all the execution is done I think the it will move to the terminate uh terminated state where like the thread is destroyed or something. Yeah I think these are the main I could remember but yeah they could be. Okay. So you know what is difference between sleep and wait method? Uh, okay I I'm I'm quite not sure this is the addiction but I think let's say if I am waiting for an object or something like I can the Java provides the method like for example an object is being used for the synchronization then I can I can write object dot weight, right? So whatever the time that particular thread will wait for accessing that particular object. Now if I say sleep and I if I mention particular sometime so irrespective of object getting or not it will sleep for that particular time. So whereas this uh wait uh operation will get released if that particular object is released. So using using notify all or notify the thread will be notified that this is released so then you can continue your execution or something like that. You know uh sometimes you will get the interrupt exception right? In multithreading environment. Yeah. Okay. So how to resolve by using join method or using sleep or resume method how to resolve this interrupt exception interrupt means when two threads are parallely uh trying to process the block. Inside the block to execution in that cases both threads are going to interrupted. Okay, okay. Uh maybe I mean one one method I mean I could think of is like synchronized block we can put that code into synchronized block so that one thread is accessing at a time but uh we can also I mean uh that is one way and the other way could be something like uh I'm not sure this could be done but yeah the synchronized I have experience but the other this one maybe we can sleep it make make the thread pause or sleep for some minute and then resume it after uh something like that or but yeah I'm quite not sure on that. Okay okay no problem so just I'm moving to next question regarding to the other part of Java. So Java how many types of memory use for initial to finish the execution initial means compile to execution end how many types of memory use by Java. Okay as far as I know like majorly there are two types of memory like the stack memory and the heap memory so all the like the temporary method execution or the class loading and the what do we say the I mean. But but you know suppose you are using compilation time Java use to native library.
[10:04]Okay. Native library. Native library you know suppose you are writing code in Java file. But during the compilation compiler have written in C C++ right. Okay. So compiler because of here need to be the native library means Java to C++ then it will start the compile uh C++ to Java how to compile it. Yeah uh I think that that conversion and everything is uh taken care I mean the platform which I mean independence is taken by by JVM the Java virtual machine which converts the byte code into the whatever the OS uh respective code like I mean which the machine understands the CPU understands. So that is taken care of by JVM and while compiling for the execution of the program like I think majorly two memories are used the stack and the heap that's what I was trying to explain. So stack and heap it is used for only the execution, right? Yeah. But uh other also have memory just like method area native native uh area memory allocations some caching mechanism. A lot of memory is there. Okay. I think uh okay no problem but majorly use to uh stack and heap. So you know uh permament generation and uh meta space you know about that? Permgen in shortcut name is a permgen and meta space. Uh meta space I have heard of where we are can load the all the metadata about the classes I mean the something like that the libraries and all but permanent generation I I haven't heard of. No perm perm gen memory allocation it is a part of suppose you are writing some code and executing but in that scenario your program is going to stack out of memory or something.
[12:15]So this is part of permgen. Okay. Yeah I heard. Meta space is different thing because of this is this part is resolved in Java 8 because of Java meta space is nothing just is a flexible as for the required memory will allocate. This is the different that's why I'm asking you. So you know I will ask from the O what do you think about abstraction and encapsulation? Okay so yeah these are the pillars of object oriented programming so I mean one let me just little about encapsulation so encapsulation is used to bind the data like and their particular method using which we can protect the access towards the data. Like we can we can monitor I mean we can restrict who can access the data and how can access the data. So this is achieved in Java using access modifiers like private protected public and all and coming to the abstraction part it is majorly used to hide the major implementation of the uh method or whatever the method like I mean uh I it only shows the client like what is actually required. Let's say for example I mean uh let's say uh this is achieved using the interface or the abstraction class and like uh for example let's say we have a method. Oh no dear interface and abstraction is different abstract class is a different thing. No no I'm talking about the principle of abstraction is achieved using. Abstraction is not achieved through these two things. How do you achieve because of abstract class no have object interface no have object so how do you achieve abstraction? Yeah that's what I'm trying to complete uh so basically like I mean what using this what it does is like it provide the template like this is the method name let's say for example fetch from database or something like that or or the users or something like that. Now a particular method will be uh what uh implement or extend this particular method and write the implementation so that particular implementation is hidden from our actual client user. So the client user just knows that this there is a method and that is used to fetch the data. Oh that's it like I mean which way it is implemented the actual the implementation process is hidden from the our client so that's way the abstraction is achieved like I mean the the internal working is hidden the only the the name of the method is exposed to our client. Okay.



