[Music] hello everyone welcome back to another round of duty mock interviews i am jose and i'm tech leader touring i'm from montreal canada and at tutting i work with on the hiring team helping them to to hire the best engineers by helping with the vetting process i have more than 17 years of experience and and my expertise lies in javascript today will be i will be interviewing victor for the role of an experienced node. js developer okay let's hear from victor hello victor how are you doing and how has your day doing so far hi jesse i'm doing good how are you too i'm doing great so thanks for asking so could you please introduce yourself and tell me a little bit about your experience your past project and what kind of language framework have you been working with and then i can take from there yes i am victor i'm from nigeria i am a full stack developer i've been i'm developing for about six years now i started my um journey into the tech world by working as the backend developer i have started writing python and jungle framework at the time i was building deploying machine learning models to the web using django after two years down my career i joined a fintech company in the company i picked up javascript and celebrated new js and react i was responsible for building various financial apis and dashboard internal tools to help microwaves work um fast forward five years from then i have been working steady with javascript and nucleus and um consequently javascript and nudia's are my strengths thank you nice all right so you can see that you have working hard to be here today right so python jungle react. js and node.
js right so you'll never get out of job for sure i can't yeah all right um okay so i see you have a lot of experience with uh backhand front end python uh jungle node. js react. js this is quite a lot okay so first of all uh which one do you prefer wow yeah that's a tricky question for me but i would do well to answer it so i started writing python and i kind of fell in love with python however over the years i've built more and production applications using javascript and which is react so if i were building some fun projects just for myself i would uh maybe pick python but if i wanted to come up hit the ground fast and build something that works that will be deployed in production i would always reach out for node.
js react and javascript essentially so in a way i would say javascript that's a that's a smart answer because this position is for javascript right if you say python okay so you're not going okay i'm kidding i'm kids all right so all right so could you please tell me um let's see could you please tell me uh or describe uh a few projects or i mean the the best project that you have been that do you work with javascript for example all right so our site project i worked with i worked on why i was working in a fintech company so here here's the problem statement um the company has a source bank account and the company has a multiple destination bank account over time money comes into the company from the south bank account into the south bank account but then in order to help to perform transaction money has to move into the destinations bank account at specific time and in specific percentages so i was tax to build an api that would be controlled by a dashboard that i also built that would enable the users customize how much percentage of money would go from the south bank account to various um destination bank account and also they would also be able to control how frequently funds is deducted from the social county destination account so the project involved me writing um background jobs using new chess and also read this for caching and all that so it was a very fun project i went about sharing jobs and cleaning up jobs and all yeah so that's it nice nice good to mention that would mention red is node. js uh okay so let's get it start okay uh this is really interesting project and i see you have a great background okay uh let's go to the node. js questions okay all right um i would like to ask you okay for example uh node.
js for first first of all node. js is single thread the module application it's a single um javascript is a single threaded language however node. js allows javascript to be able to run however node.
js kind of augments the fact that javascript is single traded by providing an event so while javascript is single-traded you can run um you can perform concurrent operations using the js node. js and the event loop right and yes node. js and the event group so yeah okay great that's a good answer well what else uh if as you mentioned ojs is a single thread okay application uh it goes to one single core and stay there forever right until we reset it my question for you is how can we make node.
js uh or multi-threading or simulate multi-threading with node. js yes so um node. js comes with a a two um or called fork so which forks so general a fork is used to spawn shard processes in node.
js it is used to create a new instance of the v8 engine to run multiple workers to execute code so by creating a fork node. js can spread these operations via the multiple workers of the various cores of the matching of the host machine essentially yeah kind of yeah yeah no no that that's that's okay yeah i can't off that and uh um have you ever heard about v8 engine yes i have it's one of the javascript engines provided by google nice and why node. js uses v8 so um essentially um when um via engine is an opti is an open source engine written in c prospers and developed by google it runs in google chrome unlike other engines it is also utilized for um pokemon with js runtime so v8 was initially intended to improve the speed of javascript execution within browsers instead of employing an interpreter be it converts javascript code into more efficient machine codes to increase performance it turns javascript code into machine code during execution by utilizing just in time from compiler so um in order to run javascript on the server side with on the server side speed is essential and with v8 javascript reveals just in time compilation javascript can be run faster on the server side and that's why node.
js uses v8 cool thank you for this answer uh let's see let's see so you mentioned at the event loop node. js okay and could you explain me uh what is the event loop yes so the event move is what allows um node. js to perform non-blocking io operations so despite the fact that javascript is single traded usually okay by uploading operations to the system can whenever possible since most canals are multi-traded they can have multiple operations executed in the background when one of these operations completes the canal tells node.
js so that the appropriate callback can be added to the proper queue essentially the event loop is the mechanism through which node. js uses a single threaded language of javascript to still perform multiple operations that's it and i'm in the event with there are different phases i could go on and elaborate about it we have the timer yeah i'm good i'm good i'm good with this yeah this kind of questions just to know uh if you are familiarized with uh the engine with node. js you know yeah okay this one is a classic question okay classic node.
js question that you you'll be asking a lot in during the interview like this um my question is what do you understand about callbacks all right so callbacks are a way of a node. js a way of performing an operation a synchronous way so callbacks essential functions that are passed into um another function or any other asynchronous process to be called at the waiter time and that time is usually indeterminate um but um so the callbacks those functions are registered with event group and at a later time they will be caused nice and have you ever heard about callback health yeah callback hair is a problem that arises usually when developers try to implement asynchronous processes one after the other so um it's so there are a lot of ways to solve callback health um more recently you could use a sync await but the general strategy is modularization you can break up um callbacks into independent functions and another strategy is to use a contour through library that is like async but however more recently you can use the new ess feature async weight another way of reducing or eliminating callback here is to use a javascript generators with promises nice generators nice all right great answer all right so um let's see uh what kind of framework uh have been used with node. js yeah i'm familiar with a couple of frameworks with node.
js um i've used a work with express i've worked with kua i've also worked with nest gas that those are essentially the the ones i've worked very much with like and quick proficiency in nice okay great that's great what's the difference between express. js and nasjs for example so um express js is a framework on node. js just like nesscs however um express uh js is more level it gives you more um exposures to the uh on internal workings of um node.
js of node. js co-library and also it is not this unopinionated so whereas an sjs is a higher level framework which um can also be used with sjs or fastify um sjs is more opinionated and introduces advanced concepts like dependency injection and has some certain ideas opinion on how to how to structure your food um next years should be prioritized that should be used and where you want to build a very wide application and you want to achieve structure and the code that would be maintainable over time however if you want something quick and small i would go with express js okay great uh you mentioned uh dependency injection okay uh what's dependence injections so dependency injection is a mechanism that allows um they allow the framework to be able to identify certain tokens or services that have been pre-configured in the code and injected into other services in runtime so instead of developer manual writing manual code to instantiate objects and pass it to various functions the developer can more or less write the services and the functions and then the dependency injection engine would take appropriate classes and instantiate create an instance of it at the time when it needs it and so in that sense it makes the code a bit more declarative and instead of imperative so it's also a medium for um for allowing you to write more decoupled codes nice okay all right and let's see what do you understand about uh streaming in node. js streaming so streaming is a way of um managing data or or or passing or working with data that allows um data to be processed without having without being read completely into the memory for example if you have a watch collection of data it might not be pragmatic to read all the data into memory before processing it but when you employ streaming you can read the data shown by shunk and process small chunks at the time in that way you would can you can circumvent the memory constraint of the system so i could go and um so yeah notice node.
js many of the node. js core libraries like the event emitters are built around streams okay great i'm glad that you mentioned a ventilator so what are the ventimeter what do you understand about the ventimeters so event emitters are a way of um a way of writing i i okay in the situations you have used event meters you've been even editors have used it to write more decoupled codes so essentially you um the way it works there is an um there is animate is an event is dispatched and there is a listener function that is registered with that event so whenever an action happens and an event is dispatched um all the wasting us which are exact which are just functions registered to the event are executed so uh from a programmer's perspective they can allow you to write code that is decoupled let's say you want to communicate across services without having to import all the implementation detail of one service into another file you can use the emitters to communicate asynchronously and what's the difference between event emitters and publisher and subscribers design pattern so um event emit um the instagram there are more than their differences however what i would say is for published subscriber design person there needs to be an established topic in which all publishers will probably wish too then the subscriber subscribers would be registered on the same topic and listen for messages coming from uh from that topic that's my understanding but yeah and then also um the use cases kind of present some differences so um for which a subscriber pattern most times can be used across various services across the across http protocol whereby we have this publisher and one service um and they're subscribed by another service however event emitters their scope of communications is limited within the same local service so maybe you have one service in one file and you want to publish an event to other service another file so that's my understanding makes sense yeah makes sense all right so uh what kind of database are you familiar with node. js i mean not with node.
js at all uh what kind of things are you familiar with so yeah i've worked with um um sql and i've got mongodb however i was i would say i'm more familiar with mongodb than a postgresql with no chance so uh while working with prospects square with nodejs most of the time i've used the olms object relational mappers however and also why why working with mongol i use the mongoose odm object data mapper so for um in terms of proficiency mongodb is as we are more proficient at in your understanding what's the difference between mongodb and post series all right the major difference between mongodb and postgres is the fact that mongodb is however that postgres is a relational database meaning that it stores data in a structured form in tables that have rules and columns however mongodb is a non-emotional database oftentimes it is also called a nosql database um um there's some of the um differences also between the two come from the fact that um there's a standard query language for querying postgres that's why postgres is also for an sql um one sql database and whereas um mongodb allows uh stores this information in key data pay and i mean key value pairs so in summary postgres is evolutionary database that stores his information in tables in a more structured form mongodb stores this information in the key value pair which allows it doesn't have much of structure but it's more flexible i'm going to ask you a few questions uh uh related to sql database and non-sql database in the end okay but for now i'd like to ask you if you uh if do you have any experience with websockets yes i have some experience with websockets um maybe not in a full scale experience but i have built some projects with websockets yeah so i can attempt questions and websockets nice what's the difference between one application that use web sockets to communicate with the backend and one application that use restful apis to do the same so generally web sockets are used when you want to build real-time features on a server so usually rescue api works with the res request response cycle meaning that for a server to send information to the client the client has to first of all make a request but with websocket you kind of introduced a dual method of communication meaning the client can make a request to the server and the server at any time he has data can push data to the client without the client having to initiate requests so with that ability um a real-time application can be built and websocket enables this capability provides this ability to service great and do you have experience with graphql yes i've had some experience with graphql yes okay how would you describe graphql what's graphql so graphql can be i can describe or exemplify graphql by making some comparison with it and rest so essentially graphql was introduced to augment some of the deficiencies of rest framework so usually the restful framework um endpoints are defined ahead of time are pay routes that endpoint return are defined ahead of time and the response uh the chip of the response from a rescue api defined ahead of time with minimal flexibility but with graphql um you're provided an interface in which a client can query the server with very varied periods and can get varied response so in a situation where the client wants to just get enough data that it needs it will not be overwooded with too much data and when a client wants to request for maybe data involving various resources with a single endpoint and with a single query the server the client collect that request so essentially graphql um makes up for rescue api in terms of introducing flexibility of queries and also decreasing the amount of um information that is transferred by the network by allowing the client to specify exactly what he needs and what he doesn't need essentially right great all right so um you gotta come to the end okay before i ask you a few more questions i just like to give uh uh heads up for our fellow developers that are watching this video okay so if you are looking for jobs okay uh job opportunities i recommend you to go to turin website tutting. coms less jobs okay you can find jobs by your tech stack and once you find them so all you need to do is just create your contact if you don't have one okay and passed through the vetting process once you pass so uh you find a job as a victor as i did okay and then you start working 100 remotely from the country that you want okay any place in the world okay let's go let's just come back for victor but before that if you enjoyed this content just consider give us the big fat thumbs up and comment down below uh what is your tech stack okay and what kind of job are you looking for okay vito so welcome to the end okay i just have a few more questions for you um so uh how do you keep yourself up to date with node. js all right so um first of all i have um a medium account and i have um daily subscriptions so with eight years you can subscribe to some channels to give you some do daily doses of articles written in your favorite stack for me i subscribe to notejs um updates so every morning i check my email for the daily dues of node.
js i read somatic posts just to find out what's more recent then sometimes i occasionally go to the npm website and just browse for packages to see what is currently being developed by the various party community then um oftentimes i also take some courses of professional courses to improve my skills in nudges and then finally this is um this might sound obvious but i want to emphasize it just keep practicing and especially targeted practice and if i realize that i have some deficiencies or some struggles in a particular area of neutrals i go to the node. js documentation i try to implement projects that would task my skill on i might test my knowledge on such concepts so over time i get better at nodejs and then um there's always room for improvement in javascript because even though node. js is not exactly javascript but even though node.
js is more than javascript but stronger or better and javascript would definitely improve your skills in node.