MERN Stack Interview Questions and Answers | MERN Stack Interview 2023 | Simplilearn

01:20:12
https://www.youtube.com/watch?v=j6jWMxlquEI

Resumo

TLDRThe video explores the MERN stack, consisting of MongoDB, Express.js, React.js, and Node.js, highlighting its efficiency in building scalable and responsive web applications. It delves into the basics and advanced aspects of each technology, offering insights into industry-relevant interview questions. MongoDB's advantages include flexibility, scalability, and high performance, while Node.js is celebrated for its speed and event-driven architecture. React.js uses JSX for a seamless integration of JavaScript and HTML, improving code readability and debugging. Express.js, part of Node.js, enables swift API development. Practical applications discussed include MongoDB's use cases such as IoT, mobile applications, and large-scale data management, emphasizing its utility in managing vast datasets and processing them effectively.

Conclusões

  • 🚀 MERN stack is efficient for developing scalable web applications.
  • 📚 MongoDB provides flexibility and scalability with its document-based structure.
  • 🖥️ React.js uses JSX, making code easier to read and debug.
  • 🔄 Virtual DOM in React updates only changed elements, enhancing performance.
  • 💻 Node.js is fast and event-driven, suitable for real-time applications.
  • 🔧 Express.js is vital for building quick and robust APIs.
  • 📈 MongoDB excels in handling large volumes of unstructured data.
  • 📱 MERN stack supports both front-end (React.js) and back-end (Node.js, Express.js) development.
  • 💡 Understanding MERN can significantly benefit those pursuing full stack development roles.
  • 🔍 Regular study and practice of interview questions can enhance job prospects.

Linha do tempo

  • 00:00:00 - 00:05:00

    The video introduces the MEAN stack as a popular web development stack comprising MongoDB, Express, React, and Node.js, and outlines the basic roles of each technology (MongoDB for databases, Express for backend, React for frontend, and Node.js for server-side runtime). It highlights how these technologies together create highly scalable web applications.

  • 00:05:00 - 00:10:00

    It informs viewers about an upcoming segment on frequently asked MEAN stack interview questions. It advises subscribing for updates and suggests a coding bootcamp for immersive learning. The bootcamp covers Java technologies, while also mentioning other topics like Angular, JSPs, and MongoDB.

  • 00:10:00 - 00:15:00

    The presenter explains JSX (JavaScript Syntax Extension) used in React.js to bind JavaScript and HTML, simplifying code structure. The concept of the virtual DOM in React, which allows for efficient page updates by only altering changed elements, is introduced. React extensions like Flux and React Native for mobile apps are mentioned.

  • 00:15:00 - 00:20:00

    The speaker discusses React components, dividing complex UIs into reusable chunks. They detail "state" in React as a way to track data changes over time, initialized in constructors, allowing pages to render based on current data states. Higher-order components and pure components, which help with reuse and shallow comparison respectively, are also described.

  • 00:20:00 - 00:25:00

    React routing is introduced as a means to manage URL paths and deliver components using React modules. The session transitions to a Node.js interview overview with beginner to advanced questions. Node.js is presented as a leading server-side platform due to its open-source, cross-platform JavaScript runtime allowing fast application development.

  • 00:25:00 - 00:30:00

    Node.js's foundation on the V8 engine, its high-speed asynchronous I/O operations, and its applications in web, distributed, and network applications are highlighted. The difference between frontend and backend development is explained, with examples of typical technologies used in each realm.

  • 00:30:00 - 00:35:00

    The section delves into npm (Node Package Manager), its role in managing online repositories and command line utilities. An overview of Node.js modules is given, explaining how these JavaScript libraries are utilized for server-side tasks, such as setting up a web server using HTTP.

  • 00:35:00 - 00:40:00

    Node.js's advantage over traditional back-end technologies like Java and PHP is discussed. Its speed, node package manager resources, suitability for real-time data applications, and ease of code synchronization between client and server due to JavaScript are noted as key benefits.

  • 00:40:00 - 00:45:00

    The information on Angular vs Node.js establishes Angular as a client-side framework and Node.js as a server-side one. Databases commonly used with Node.js, particularly MongoDB and MySQL, are discussed, with MongoDB being preferred for its scalability with large data sets.

  • 00:45:00 - 00:50:00

    The segment covers popular Node.js libraries like Express.js for quick API development and Mongoose for database connectivity. The pros (fast processing, extensive package availability) and cons (complex callback structure, CPU-intensive operations) of Node.js are examined, with solutions like cloud scaling proposed.

  • 00:50:00 - 00:55:00

    Commands relevant to Node.js, particularly for importing external libraries using the "require" function, are elaborated upon. The transition to intermediate Node.js questions includes explanations of event-driven programming, how event loops, emitters, and API functions operate, highlighting synchronous vs asynchronous programming.

  • 00:55:00 - 01:00:00

    The video explains Node.js's package.json file's role as a project metadata holder and using URL modules for utility enhancement. Express.js is detailed as a framework facilitating web app creation in Node.js, streams in Node.js accomplish ongoing data reads/writes, and dependency management is outlined.

  • 01:00:00 - 01:05:00

    Synchronous/non-blocking APIs in Node.js scale applications effectively by allowing data to be processed without blocking operations. Examples of using async functionality and module exports to encapsulate code for shared use are also covered.

  • 01:05:00 - 01:10:00

    MongoDB is introduced as a key NoSQL database, with emphasis on its document-based storage structure, scalability, and schema flexibility. Common MongoDB interview questions focus on its architecture, alternative NoSQL databases, and distinctions from SQL databases.

  • 01:10:00 - 01:15:00

    Details on MongoDB's data models (embedded and reference), how indexing expedites query operations, replication and sharding for data availability, and the advantages of MongoDB's flexible schema are provided. Practical questions hone in on tasks like document insertion and handling large files.

  • 01:15:00 - 01:20:12

    MongoDB's role in highly available systems, aspects like capped collections for performance, GridFS for large file storage, and aggregation techniques like map-reduce are discussed. The video wraps with typical real-world MongoDB applications and resources for further learning.

Mostrar mais

Mapa mental

Mind Map

Perguntas frequentes

  • What is the MERN stack?

    MERN stack is a web development technology stack consisting of MongoDB, Express.js, React.js, and Node.js.

  • What is MongoDB used for in the MERN stack?

    MongoDB is used as the database in the MERN stack.

  • What does Express.js provide in the MERN stack?

    Express.js provides the backend framework in the MERN stack.

  • What role does React.js play in the MERN stack?

    React.js is used for handling the front-end in the MERN stack.

  • What is Node.js used for in the MERN stack?

    Node.js is used as the server-side runtime environment in the MERN stack.

  • What are some advantages of using MongoDB?

    MongoDB offers flexibility, scalability, high availability, high performance, and a flexible schema design.

  • How does the virtual DOM improve React performance?

    The virtual DOM updates only the objects that have changed, rather than the entire DOM, improving performance.

  • What is JSX in React.js?

    JSX is a syntax extension for JavaScript that allows HTML to be written within React.js code.

  • What are some key features of Node.js?

    Node.js is known for being fast, event-driven, and uses JavaScript for both client and server-side scripting.

  • What are the different data models in MongoDB?

    MongoDB has embedded and reference data models for structuring data.

Ver mais resumos de vídeos

Obtenha acesso instantâneo a resumos gratuitos de vídeos do YouTube com tecnologia de IA!
Legendas
en
Rolagem automática:
  • 00:00:01
    foreign
  • 00:00:09
    stack is a popular web development stick
  • 00:00:12
    that includes four different
  • 00:00:13
    Technologies mongodb crashes reactors
  • 00:00:17
    and node.js mongodb is used for the
  • 00:00:21
    database express.js provides the
  • 00:00:23
    back-end framework react.js handles the
  • 00:00:25
    front and node.js is used as the
  • 00:00:28
    server-side runtime environment
  • 00:00:30
    so this stack allows for creation of
  • 00:00:32
    Highly scalable efficient and responsive
  • 00:00:35
    web application
  • 00:00:36
    hello everyone and welcome to Simply
  • 00:00:38
    learns YouTube channel today we'll take
  • 00:00:41
    you through the most frequently Asked
  • 00:00:43
    interview questions in Moon stack web
  • 00:00:45
    development in this video tutorial we'll
  • 00:00:48
    cover all the Technologies related to
  • 00:00:51
    Moon stack but before we begin let me
  • 00:00:54
    tell you guys that we have regular
  • 00:00:55
    updates on multiple Technologies so if
  • 00:00:58
    you are a tech geek in a container Sun
  • 00:01:00
    for the latest technological trends then
  • 00:01:02
    consider getting subscribed to our
  • 00:01:04
    YouTube channel and press that Bell icon
  • 00:01:06
    to never miss any updates from Simply
  • 00:01:09
    low for those interested in a
  • 00:01:11
    comprehensive coding bootcamp we highly
  • 00:01:13
    recommend the Caltech coding bootcamp
  • 00:01:15
    with this program you can learn to code
  • 00:01:17
    and become a full stack developer in
  • 00:01:20
    just six months this state-of-the-art
  • 00:01:22
    bootcamp will fully immerse you in
  • 00:01:24
    accelerated coding training helping you
  • 00:01:27
    become a valued software engineer ready
  • 00:01:29
    to take on any challenges in the
  • 00:01:31
    industry
  • 00:01:32
    during this boot camp you will Master
  • 00:01:34
    both front-end and back-end Java
  • 00:01:37
    Technologies starting with the basics
  • 00:01:39
    and progressing to the advanced aspects
  • 00:01:41
    of full stack web development
  • 00:01:44
    you'll also learn angular spring boot
  • 00:01:46
    web services jsps and mongodb to help
  • 00:01:50
    you launch your career as a full stack
  • 00:01:53
    developer
  • 00:01:54
    for those who are looking to deepen
  • 00:01:55
    their understanding of full stack web
  • 00:01:57
    development or simply want to become a
  • 00:02:00
    full stack developer in a shorter amount
  • 00:02:02
    of time a Caltech coding bootcamp is an
  • 00:02:05
    excellent option so without wasting any
  • 00:02:07
    more time let's hand over this session
  • 00:02:09
    to our training export the react is
  • 00:02:11
    interview questions
  • 00:02:12
    now as we know it react.js is as
  • 00:02:15
    important as like in other tools which
  • 00:02:18
    you've already has seen so what is the
  • 00:02:20
    jsx here jsx called JavaScript syntax
  • 00:02:23
    extension
  • 00:02:24
    okay so this syntax extension to the
  • 00:02:28
    JavaScript in reactors is in the way
  • 00:02:31
    how you express
  • 00:02:33
    to bind JS and HTML together to result a
  • 00:02:36
    j6
  • 00:02:38
    content so by using j6 you can write a
  • 00:02:41
    structure in the same file that contains
  • 00:02:44
    the JavaScript code that is something
  • 00:02:46
    more Innovative way because of that
  • 00:02:47
    react.js is creating a more buzz in a
  • 00:02:50
    market
  • 00:02:51
    so jsx actually helps making code more
  • 00:02:55
    easy to understand and debug and avoids
  • 00:02:57
    a lot of boilerplate code okay inside
  • 00:03:00
    the Dom structure
  • 00:03:01
    now the next thing is what is the
  • 00:03:03
    virtual Dom see the virtual Dom is
  • 00:03:05
    representing a Dom in a memory
  • 00:03:08
    okay that is called virtual Dom so
  • 00:03:11
    manipulating the real term is much more
  • 00:03:13
    slower and costly Affair okay because
  • 00:03:15
    you need to repaint the Dom over and
  • 00:03:18
    over the period of time when the user
  • 00:03:21
    changes few things so
  • 00:03:24
    when the state change virtual Dom
  • 00:03:26
    changes and only the objects which are
  • 00:03:28
    in real term
  • 00:03:29
    okay
  • 00:03:30
    update instead of updating the entire
  • 00:03:33
    object so that makes your page to be
  • 00:03:34
    load far more faster
  • 00:03:36
    okay so in Virtual Dom what happens this
  • 00:03:38
    is the real Dom this is a virtual Dom so
  • 00:03:40
    the orange color portions which you're
  • 00:03:42
    seeing that is basically the changes
  • 00:03:43
    which has been made okay these are
  • 00:03:46
    called Changed object okay so virtual
  • 00:03:49
    Dom is basically compare it's to the
  • 00:03:51
    previous state and understand which area
  • 00:03:54
    it needs to send for the updates and
  • 00:03:56
    avoid the other areas
  • 00:03:58
    okay that's what this virtual Dom really
  • 00:04:01
    works
  • 00:04:03
    so what are react extension react
  • 00:04:05
    extensions are many like you talk about
  • 00:04:07
    like in flux it is a third party tool
  • 00:04:09
    which is responsible to attach
  • 00:04:12
    the State Management feature to talk
  • 00:04:14
    about react native which is responsible
  • 00:04:16
    to develop the hybrid mobile
  • 00:04:17
    applications
  • 00:04:18
    in JavaScript so these are two very
  • 00:04:21
    popular and there are many more which
  • 00:04:23
    are available okay so like you talk
  • 00:04:27
    about
  • 00:04:29
    architectural support you talk about
  • 00:04:31
    server side rendering okay so Redux and
  • 00:04:34
    there are lot many other tools are also
  • 00:04:35
    available
  • 00:04:36
    so what is an event in react and how
  • 00:04:39
    you're going to create that so react is
  • 00:04:40
    basically offering the ideas of handing
  • 00:04:44
    the event very fairly easy so let me
  • 00:04:48
    talk about clicking anything you talk
  • 00:04:50
    about taking your mouse somewhere so
  • 00:04:53
    these kind of options generate an event
  • 00:04:55
    so for that we typically say alert and
  • 00:04:59
    you click on this render you click on
  • 00:05:01
    this button in a curly braces you call
  • 00:05:03
    the function to trigger to event
  • 00:05:06
    now what are the components in react
  • 00:05:09
    so friends react components are nothing
  • 00:05:11
    but a call View
  • 00:05:13
    okay like a complex view can be divided
  • 00:05:16
    into the smaller portions
  • 00:05:18
    a complex UI can be distributed further
  • 00:05:21
    to create more better and reusable views
  • 00:05:25
    clear so it splits the user interface
  • 00:05:29
    into the independent pieces of code
  • 00:05:30
    which can be developed and joins
  • 00:05:34
    later on okay so that's how you define
  • 00:05:37
    the component in and react so in angular
  • 00:05:41
    and react in both the areas the word
  • 00:05:44
    component is very much used so the
  • 00:05:46
    component meaning is very simple you
  • 00:05:48
    talk about a view
  • 00:05:51
    so what is the state in a react so state
  • 00:05:53
    is react is nothing but is the one which
  • 00:05:57
    identify what was and what is now okay
  • 00:06:02
    if it stores the value for the specific
  • 00:06:04
    period of time which changes and react
  • 00:06:07
    is basically detecting those
  • 00:06:09
    so it is changing because of some
  • 00:06:11
    actions either taken by the users or by
  • 00:06:14
    the applications okay so keep tracking
  • 00:06:16
    about all those States what it was there
  • 00:06:18
    like in I'm talking about an
  • 00:06:20
    incrementing encounter so that is also
  • 00:06:22
    the state a variable there okay so the
  • 00:06:25
    state object is always initialized in
  • 00:06:26
    the Constructor so it can contains the
  • 00:06:29
    multiple properties so this dot set
  • 00:06:31
    state is used to change the value of the
  • 00:06:33
    state object and set state is
  • 00:06:35
    responsible
  • 00:06:37
    to
  • 00:06:38
    perform the shallow merge between the
  • 00:06:40
    new state and the previous state
  • 00:06:43
    now the state holds the data that a
  • 00:06:47
    component renders to the web page
  • 00:06:49
    certainly because every time the state
  • 00:06:51
    changes so it needs to be stored
  • 00:06:53
    somewhere so this is how the state is
  • 00:06:56
    accessed as you can see this example
  • 00:06:57
    here
  • 00:06:58
    in the Constructor we are defining the
  • 00:07:00
    super props and the states has been
  • 00:07:02
    initialized and you're rendering the
  • 00:07:04
    states there are three different steps
  • 00:07:05
    are involved initialize the state rent
  • 00:07:08
    to the state and update the states
  • 00:07:12
    what is the higher order component and
  • 00:07:14
    pure component react higher components
  • 00:07:16
    are the component which are typically a
  • 00:07:19
    function okay that takes a component and
  • 00:07:21
    return a new component to you by
  • 00:07:23
    manipulating few things that basically
  • 00:07:26
    designed for the reusing
  • 00:07:28
    okay so the higher the components are
  • 00:07:30
    typically a function that takes a
  • 00:07:32
    component and return a new component
  • 00:07:34
    okay so to in order to perform some
  • 00:07:37
    reusability
  • 00:07:38
    a pure components are the components
  • 00:07:41
    okay is a variation of react component
  • 00:07:44
    that doesn't
  • 00:07:46
    that does a shallow comparison of props
  • 00:07:49
    and State
  • 00:07:51
    okay shell comparison basically checks
  • 00:07:54
    what the equality
  • 00:07:55
    are we clear now so that's what the main
  • 00:07:58
    job
  • 00:08:01
    going ahead what do we Implement and how
  • 00:08:03
    do you implement react routing so to
  • 00:08:05
    implement a react routing react routing
  • 00:08:07
    also comes with inbuild
  • 00:08:10
    react modules and that particular module
  • 00:08:14
    to import it so
  • 00:08:16
    here we Define the react modules by
  • 00:08:19
    offering the route path where you have a
  • 00:08:22
    call left hand side is the name and the
  • 00:08:25
    right hand side is a component which you
  • 00:08:27
    would like to deliver it now hello this
  • 00:08:30
    is Matthew and we're going to be going
  • 00:08:31
    through some of the simple questions
  • 00:08:33
    that you would be asked during a node.js
  • 00:08:36
    interview what we're going to do is
  • 00:08:38
    we're actually going to break out the
  • 00:08:40
    section into three key areas that'll be
  • 00:08:42
    beginner questions there will be an
  • 00:08:44
    intermediate questions and advanced
  • 00:08:46
    questions and the expectation is as you
  • 00:08:49
    go through this video is that these
  • 00:08:52
    questions could be pushed together as
  • 00:08:54
    you're going through the interview kind
  • 00:08:56
    of think of it like this is if you've
  • 00:08:58
    answered the beginner questions that you
  • 00:09:00
    would get asked at the beginning of the
  • 00:09:01
    interview with confidence and Surety
  • 00:09:03
    then the client is going to then jump to
  • 00:09:06
    those intermediate Advanced questions
  • 00:09:08
    quite quickly and they're looking for
  • 00:09:10
    people who can help them serve and solve
  • 00:09:12
    their problems at that more intermediate
  • 00:09:15
    and advanced level so let's just get
  • 00:09:16
    started so the first question you're
  • 00:09:18
    probably going to be asked is you know
  • 00:09:20
    you know what is node.js you know do you
  • 00:09:22
    know what it's for and essentially
  • 00:09:23
    node.js is one of the most popular if
  • 00:09:26
    not the most popular open source
  • 00:09:28
    cross-platform JavaScript programs and
  • 00:09:31
    it allows you to build out web
  • 00:09:33
    applications that run on the server it's
  • 00:09:37
    extremely flexible it allows you how to
  • 00:09:39
    implement a lot of solutions outside of
  • 00:09:41
    just the the core programming runtime
  • 00:09:44
    and it allows you to build Solutions
  • 00:09:46
    extremely quickly in an open source
  • 00:09:49
    mindset for devops
  • 00:09:52
    it is used essentially for creating
  • 00:09:54
    client-sized web applications we'll see
  • 00:09:57
    this later on and you may want to talk a
  • 00:09:59
    little bit about you know using
  • 00:10:00
    express.js and how you can build out
  • 00:10:03
    apis uh to work with node.js and
  • 00:10:06
    connecting to databases such as mongodb
  • 00:10:10
    and that is also really good for being
  • 00:10:12
    able to store a data intensive
  • 00:10:16
    applications that are asynchronous and
  • 00:10:18
    event driven in their model and this is
  • 00:10:21
    important when you're talking about
  • 00:10:23
    creating applications that can scale
  • 00:10:26
    rapidly
  • 00:10:28
    so you can then ask be asked you know
  • 00:10:30
    how does node.js work well node.js
  • 00:10:33
    itself is actually built on the V8
  • 00:10:36
    engine and the V8 JavaScript engine is
  • 00:10:38
    the same engine that runs JavaScript in
  • 00:10:41
    your Chrome web browser extremely fast
  • 00:10:45
    it allows for high output and
  • 00:10:48
    non-blocking through your i o input
  • 00:10:50
    outputs and is is single threaded event
  • 00:10:53
    blue
  • 00:10:55
    so you're going to be a man asked you
  • 00:10:57
    know where can you use node.js and and
  • 00:11:01
    the reality is the applications for
  • 00:11:03
    node.js keep expanding but there are
  • 00:11:05
    some core applications that you can work
  • 00:11:07
    with node.js right now so such as web
  • 00:11:10
    applications distributed system and
  • 00:11:12
    network applications uh probably
  • 00:11:14
    referencing the web applications is a
  • 00:11:17
    really good starting point because here
  • 00:11:19
    you can actually talk about maybe some
  • 00:11:21
    examples that you've done where you're
  • 00:11:22
    building out some of these web
  • 00:11:23
    applications uh indeed one of the things
  • 00:11:25
    that you want to be consistently doing
  • 00:11:27
    and peppering your answers with is
  • 00:11:30
    examples of work that you have done now
  • 00:11:33
    it doesn't matter if those examples are
  • 00:11:35
    purely experimental or training examples
  • 00:11:38
    that you've done the fact that you've
  • 00:11:40
    actually worked with node.js and created
  • 00:11:42
    a distributed system or a web
  • 00:11:44
    application is really valuable because
  • 00:11:47
    it shows that the person that you're
  • 00:11:49
    meeting with that you have knowledge and
  • 00:11:51
    understanding and practical experience
  • 00:11:54
    of applying the theory of working with
  • 00:11:57
    new Js with the practice of working with
  • 00:12:00
    node.js
  • 00:12:01
    so we asked about you know your answer
  • 00:12:04
    and essentially the io refers to the
  • 00:12:07
    transfer of data in and out of a system
  • 00:12:10
    and that's really it you know there's a
  • 00:12:12
    reason why Google calls that conference
  • 00:12:14
    IO it's the transfer of data in and out
  • 00:12:17
    of our brains at that conference the
  • 00:12:19
    application is same here it's about
  • 00:12:21
    moving data in and out of systems
  • 00:12:23
    through using node.js and that every um
  • 00:12:27
    event can be tracked and whether it's on
  • 00:12:30
    a physical device a network or files
  • 00:12:32
    within a system again it's input and
  • 00:12:34
    output
  • 00:12:36
    so let's go through and you know you're
  • 00:12:38
    going to be asked you know can you
  • 00:12:39
    explain the difference between front end
  • 00:12:41
    and back-end development and this is a
  • 00:12:43
    question that I can ask a lot when I'm
  • 00:12:47
    meeting with clients and you know people
  • 00:12:49
    get really confused about what is the
  • 00:12:51
    difference between front-end and
  • 00:12:52
    back-end development bottom line front
  • 00:12:54
    end is what gets resolved inside of your
  • 00:12:57
    web browser or the app on your mobile
  • 00:13:01
    device backend is what gets resolved
  • 00:13:04
    essentially um what we call the the back
  • 00:13:06
    office or server-side applications but
  • 00:13:09
    it's becoming more and more synonymous
  • 00:13:11
    for what gets run in the cloud
  • 00:13:14
    so web applications
  • 00:13:16
    um really get a lot of the functionality
  • 00:13:19
    of the web application gets run in the
  • 00:13:20
    front end and I think with CSS HTML5 uh
  • 00:13:24
    client-side JavaScript so we can get
  • 00:13:26
    right on the front end everything else
  • 00:13:27
    such as connecting to a database gets
  • 00:13:30
    run behind the scenes in the back end
  • 00:13:33
    and so you know anything that's going to
  • 00:13:36
    have like Graphics is going to be on the
  • 00:13:37
    front end uh apis are going to be run on
  • 00:13:40
    the back end and then just finally some
  • 00:13:43
    of the scripting languages are using on
  • 00:13:45
    the front end so HTML CSS JavaScript
  • 00:13:48
    those are all Common Core scripting
  • 00:13:51
    languages that you would use you can use
  • 00:13:53
    Frameworks such as angularjs and
  • 00:13:55
    react.js or view those would be a
  • 00:13:58
    front-end Frameworks uh back-end
  • 00:14:00
    Frameworks will include Java PHP Python
  • 00:14:04
    and node.js are some of the back-end
  • 00:14:06
    Technologies you'd also throw in their
  • 00:14:08
    dot net as well and it's just a whole
  • 00:14:12
    you know Litany of front-end and
  • 00:14:14
    back-end Technologies and Frameworks
  • 00:14:16
    that you can use and this is a actually
  • 00:14:18
    a good point to kind of explain the
  • 00:14:22
    experience you have outside of just
  • 00:14:23
    working with node.js but other
  • 00:14:25
    technologies that you've been working
  • 00:14:27
    with that potentially that the client is
  • 00:14:29
    also using
  • 00:14:31
    so another question you're going to be
  • 00:14:33
    asked when you're looking at node.js is
  • 00:14:35
    you know can you tell me about npm and
  • 00:14:37
    so when somebody asks you what is npm
  • 00:14:39
    the first thing you're going to respond
  • 00:14:40
    is do you mean node package manager and
  • 00:14:43
    the reason why you want to respond like
  • 00:14:45
    that is that you want to qualify that
  • 00:14:47
    question with understanding that you
  • 00:14:49
    know what they're talking about but you
  • 00:14:50
    want them to verify that and so node
  • 00:14:53
    packet manager is npm
  • 00:14:55
    and it's responsible for packaging all
  • 00:14:57
    of your modules that you're working with
  • 00:14:59
    in node.js and we have a whole series of
  • 00:15:02
    videos that we've done on node.js and
  • 00:15:05
    every single one of them includes
  • 00:15:07
    references to npm
  • 00:15:10
    so you're going to be asked you know so
  • 00:15:12
    okay you tell me um what it is you know
  • 00:15:14
    can you go into a little bit more um
  • 00:15:16
    details you know so you can provide two
  • 00:15:18
    main functionalities and so one of them
  • 00:15:21
    is being able to manage online
  • 00:15:23
    repositories or modules and packages
  • 00:15:26
    um so you can go to like
  • 00:15:28
    search.nodejs.org and you can find a
  • 00:15:30
    packages that you can install Into Your
  • 00:15:33
    solution such as express.js and it also
  • 00:15:37
    provides a command line utility that
  • 00:15:39
    allows you to manage your packages very
  • 00:15:42
    quickly through terminal window or
  • 00:15:44
    command line
  • 00:15:45
    I use vs code a lot Visual Studio code
  • 00:15:49
    and it has a command line utility built
  • 00:15:51
    right into it that allows me to interact
  • 00:15:53
    with npm
  • 00:15:55
    so what are some of the modules in
  • 00:15:57
    node.js and so you know modules
  • 00:16:01
    um in node.js they're essentially like
  • 00:16:03
    JavaScript libraries so you can think of
  • 00:16:06
    some of the JavaScript libraries that
  • 00:16:08
    you may have used the functionality is
  • 00:16:11
    somewhat the same but they're designed
  • 00:16:13
    for node.js and to run on the server and
  • 00:16:16
    there are ways in which you can go ahead
  • 00:16:17
    and create some of those modules so for
  • 00:16:21
    instance if we're creating a web server
  • 00:16:23
    you can actually use the require
  • 00:16:26
    commands to be able to require that the
  • 00:16:29
    server be there so the example we have
  • 00:16:32
    on the right hand side shows that we
  • 00:16:34
    really do need to have HTTP which is a
  • 00:16:37
    web server and we require that to be
  • 00:16:39
    installed and so that if you're running
  • 00:16:42
    that npm package it will actually
  • 00:16:45
    install the HTTP server and then you can
  • 00:16:48
    actually write some code to actually
  • 00:16:49
    then listen on the localhost port 2000
  • 00:16:54
    for where you'll be running your app
  • 00:16:55
    application
  • 00:16:57
    and there are just you know there's a
  • 00:16:59
    whole bunch of modules like I come with
  • 00:17:01
    node.js now right out of the gate and
  • 00:17:05
    here are some of the modules that you
  • 00:17:06
    have and we also referenced that just
  • 00:17:08
    earlier on HTTP is a core module for uh
  • 00:17:11
    running a web server uh you have a
  • 00:17:15
    utility function that is useful for
  • 00:17:17
    developers to assess features within
  • 00:17:20
    your node.js project you have a URL
  • 00:17:23
    module for any URL passing you'd be
  • 00:17:26
    doing
  • 00:17:26
    and you also have a stream which allows
  • 00:17:30
    you to be able to stream data in and out
  • 00:17:33
    of your system and be able to manage how
  • 00:17:35
    that's been worked and then zlib which
  • 00:17:37
    allows you to compress and decompress
  • 00:17:39
    files so that you can keep your storage
  • 00:17:42
    of files to a minimum
  • 00:17:45
    so a question you're going to be asked
  • 00:17:48
    is you know why is node.js being
  • 00:17:50
    preferred over back-end Technologies
  • 00:17:52
    such as Java and PHP and particularly
  • 00:17:55
    with gyro it's a very mature stable
  • 00:17:57
    language it's been around for more than
  • 00:17:58
    20 years you know PHP
  • 00:18:00
    um runs some of them the most powerful
  • 00:18:03
    and largest websites out there such as
  • 00:18:06
    Facebook so why would you use node.js
  • 00:18:09
    well the first response is kind of a
  • 00:18:12
    gimme but it is really fast and if you
  • 00:18:15
    watched any of the videos that we've
  • 00:18:18
    done on node.js building out Solutions
  • 00:18:20
    and developing the solutions you'll see
  • 00:18:23
    just how fast it is the second is the
  • 00:18:27
    really kind of the secret sauce with
  • 00:18:30
    node.js is the node package manager and
  • 00:18:33
    no package manager allows you to install
  • 00:18:36
    additional functionality such as Express
  • 00:18:40
    or as a database into your
  • 00:18:43
    solution really quick green and there's
  • 00:18:46
    over 50 000 bundles available for node
  • 00:18:49
    package manager
  • 00:18:51
    if you're building out a real-time
  • 00:18:54
    application that's data intensive and
  • 00:18:57
    you need to have apis quickly developed
  • 00:19:00
    then node.js is another great it's
  • 00:19:03
    really the great solution for you it
  • 00:19:05
    allows you to build out these Solutions
  • 00:19:07
    really quickly
  • 00:19:09
    and there is a easy synchronization
  • 00:19:12
    between the server and the client due to
  • 00:19:15
    the code base
  • 00:19:18
    and then finally because the structure
  • 00:19:21
    of node.js is Javascript if you are
  • 00:19:25
    making the pivot from being a front-end
  • 00:19:27
    web developer to node.js it's just going
  • 00:19:30
    to make it a lot easier for you to pick
  • 00:19:32
    up node.js because you have that common
  • 00:19:35
    language of JavaScript and on top of
  • 00:19:37
    that JavaScript is the world's most
  • 00:19:39
    popular scripting language
  • 00:19:42
    so let's talk about some of the
  • 00:19:44
    differences between angular node.js and
  • 00:19:47
    so and the reason why this question may
  • 00:19:49
    come up is the person interviewing you
  • 00:19:51
    is seeing whether or not you do know the
  • 00:19:54
    difference between a front-end framework
  • 00:19:57
    and a back-end framework and this is one
  • 00:20:00
    of those questions where you can go well
  • 00:20:02
    there are differences but the
  • 00:20:04
    differences are because they complement
  • 00:20:06
    each other so angular is a front-end
  • 00:20:08
    development framework whereas node.js is
  • 00:20:11
    a server side and framework are the
  • 00:20:14
    differences though between the actual
  • 00:20:15
    Frameworks themselves is that angular is
  • 00:20:17
    written in typescript which is a
  • 00:20:19
    modification of JavaScript node.js is
  • 00:20:22
    written in C and C plus plus
  • 00:20:24
    anger is used for building out single
  • 00:20:27
    play client-side web applications and so
  • 00:20:31
    that's a keyword there is client-side
  • 00:20:34
    whereas node.js is about building out
  • 00:20:37
    fast and scalable server-side Network
  • 00:20:40
    applications uh so uh again the two
  • 00:20:44
    complement each other
  • 00:20:46
    uh angular splits web applications into
  • 00:20:48
    the MVC and model view control
  • 00:20:50
    components whereas node.js generates a
  • 00:20:54
    lot of database crazy it does more than
  • 00:20:56
    that as well but you can think of
  • 00:20:58
    node.js as that glued to your database
  • 00:21:02
    let's talk a little bit about when
  • 00:21:04
    you're connecting to a database with
  • 00:21:06
    node.js and so you're going to probably
  • 00:21:08
    be asking what is the most popular
  • 00:21:11
    database used with node.js and there are
  • 00:21:15
    a couple mongodb is largely the most
  • 00:21:18
    popular nosql cross-platform database
  • 00:21:21
    MySQL is also very popular and that's a
  • 00:21:24
    more traditional relational database
  • 00:21:27
    you would go with mongodb for really
  • 00:21:30
    more modern solutions when you're
  • 00:21:33
    looking at creating an application
  • 00:21:34
    that's going to really scale into just
  • 00:21:37
    managing masses and masses of data that
  • 00:21:42
    has to be created red updated and
  • 00:21:46
    deleted very very quickly
  • 00:21:50
    for some of the other popular libraries
  • 00:21:53
    that you use for node.js express.js is a
  • 00:21:56
    very popular one and I really like
  • 00:21:58
    working with express.js allows me to
  • 00:22:00
    build out web applications really
  • 00:22:02
    quickly more importantly it allows me to
  • 00:22:05
    build out apis very quickly and which
  • 00:22:08
    you know apis are essentially web
  • 00:22:10
    applications themselves but being able
  • 00:22:12
    to do that very quickly with a framework
  • 00:22:14
    like express.js is very useful uh
  • 00:22:17
    Mongoose is an application that makes
  • 00:22:19
    connecting to a database really
  • 00:22:22
    easy so here is an example of express.js
  • 00:22:26
    which is a in itself really a flexible
  • 00:22:28
    but a solution that you can do lots with
  • 00:22:31
    and Mongoose which is a more focused
  • 00:22:34
    solution which allows you know to you
  • 00:22:37
    make it easier to connect to your
  • 00:22:39
    databases
  • 00:22:41
    so you know what are the pros and cons
  • 00:22:43
    of working with node.js there's lots of
  • 00:22:46
    ways we explain this earlier on that you
  • 00:22:47
    can actually build out applications that
  • 00:22:50
    run on the cloud why would you you know
  • 00:22:53
    what's uh the pros and cons so a pro is
  • 00:22:56
    that node.js is extremely faster
  • 00:23:00
    processing thing an event based model uh
  • 00:23:03
    it really is fast I can't is if you have
  • 00:23:06
    something that is a very heavy
  • 00:23:08
    computational task it's not so good at
  • 00:23:11
    that now I will caveat that this is that
  • 00:23:14
    node.js is getting better all the time
  • 00:23:17
    and so you might have to be provide an
  • 00:23:20
    example of what a very heavy
  • 00:23:22
    computational task is and that may be uh
  • 00:23:25
    calculating a risk on an insurance
  • 00:23:28
    application against many many variables
  • 00:23:32
    that maybe something that's seen as
  • 00:23:34
    computationally very heavy but what you
  • 00:23:36
    can do in that example is you can then
  • 00:23:38
    offload the task to another Solution
  • 00:23:42
    that's designed for it and use apis to
  • 00:23:44
    pass the data back and forth
  • 00:23:46
    Pro JavaScript is used for building out
  • 00:23:50
    your applications with node.js great
  • 00:23:53
    lots of people know JavaScript
  • 00:23:56
    a restriction and again this is evolving
  • 00:23:59
    as JavaScript itself evolves is that
  • 00:24:02
    when you do a callback you may end up
  • 00:24:05
    doing lots of nested callbacks
  • 00:24:07
    um if you're doing something that's very
  • 00:24:09
    complicated again another way around the
  • 00:24:12
    con and so this is one of the things
  • 00:24:13
    that I always look for is if you have a
  • 00:24:16
    blocker or a barrier
  • 00:24:18
    how do you get around that barrier and
  • 00:24:21
    so for instance when you're talking uh
  • 00:24:23
    to your recruiter
  • 00:24:25
    you can say look the reason why I use
  • 00:24:27
    node.js is that it's fast it's event but
  • 00:24:29
    it's driven I can use JavaScript there
  • 00:24:32
    are some challenges and but what I do to
  • 00:24:35
    get around those challenges are and
  • 00:24:36
    that's where you can say that you know
  • 00:24:38
    you may run the complex script off and
  • 00:24:41
    you may write that in net or Java or PHP
  • 00:24:45
    and then use an API to do the response
  • 00:24:48
    back into node.js so you get the
  • 00:24:50
    benefits of Both Worlds but minimize the
  • 00:24:53
    investment in having to manage a complex
  • 00:24:56
    environment such as Java versus a
  • 00:24:59
    relatively simple environment with
  • 00:25:01
    node.js the node package manager makes
  • 00:25:04
    it extremely easy to access just an
  • 00:25:07
    awful lot of functionality with over 50
  • 00:25:11
    000 packages there's a package for that
  • 00:25:13
    so from being able to have a tool that
  • 00:25:18
    creates unique identifiers that you
  • 00:25:20
    might need to have for generating
  • 00:25:22
    content that gets posted into a database
  • 00:25:24
    through to being able to connect to
  • 00:25:27
    databases through you know to running so
  • 00:25:30
    many different solutions and the npm
  • 00:25:32
    package manager with its access to so
  • 00:25:34
    many different packages makes it great
  • 00:25:36
    for
  • 00:25:38
    um getting access to all that content
  • 00:25:39
    now Khan is working with relational
  • 00:25:43
    databases with node.js isn't as easy as
  • 00:25:46
    a nosql database now you can do it and
  • 00:25:50
    there are ways around that and what I
  • 00:25:53
    would do when this question comes up is
  • 00:25:55
    always kind of pivot to say hey this is
  • 00:25:58
    how you can actually then get around
  • 00:26:00
    building out that application
  • 00:26:05
    designed for streaming huge amounts of
  • 00:26:07
    data in and out a con is that node.js is
  • 00:26:11
    single threaded and so it can be CPU
  • 00:26:13
    intensive but again there are ways
  • 00:26:15
    around that and a good way around that
  • 00:26:17
    is scaling Your solution and elastic
  • 00:26:20
    environments such as the cloud
  • 00:26:22
    so what is the command used to import an
  • 00:26:25
    external library and so to import an
  • 00:26:28
    external Library the command is the
  • 00:26:30
    require command so an example we have
  • 00:26:33
    here is uh you can assign a variable and
  • 00:26:36
    the variable is going to be for HTTP and
  • 00:26:38
    you're going to then require the HTTP
  • 00:26:41
    service and that means that the
  • 00:26:44
    application itself won't run unless the
  • 00:26:46
    external Library the HTTP library is
  • 00:26:49
    installed
  • 00:26:50
    okay so those were our introductory uh
  • 00:26:53
    questions for node.js this kind of pivot
  • 00:26:55
    and take a look at the intermediate
  • 00:26:58
    questions that you would be asked
  • 00:27:00
    so what does event driven programming
  • 00:27:03
    mean so event driven programming means
  • 00:27:06
    that if something happens something else
  • 00:27:08
    will happen in response so for instance
  • 00:27:10
    if you click a mouse that Mouse click is
  • 00:27:13
    an event that means something has to
  • 00:27:15
    respond to that event just think of it
  • 00:27:18
    as cause and effect it's just the basic
  • 00:27:20
    motion of physics so that's what event
  • 00:27:23
    driven programming means
  • 00:27:25
    you also look at it as a callback
  • 00:27:28
    function so that when an element is
  • 00:27:31
    executed something will happen in
  • 00:27:33
    response
  • 00:27:35
    so what is an event Loop in node.js so
  • 00:27:39
    an event Loop in node.js is when you do
  • 00:27:41
    an asynchronous call and what that
  • 00:27:45
    essentially means is that you are
  • 00:27:47
    sending out data and then a non-blocking
  • 00:27:50
    input output from node.js is pulling
  • 00:27:54
    data back in
  • 00:27:56
    what is an event emitter in node.js so
  • 00:28:01
    an event meta has really two areas of
  • 00:28:03
    focus one is that it manages uh the
  • 00:28:06
    classes that hold all the objects uh
  • 00:28:08
    within your event and we have an example
  • 00:28:11
    of this on the right hand side and then
  • 00:28:14
    whenever an event actually is thrown the
  • 00:28:17
    functions are then called on that event
  • 00:28:19
    synchronously so for instance we have in
  • 00:28:22
    our example on the right hand side we
  • 00:28:25
    create an event and then we have the
  • 00:28:28
    functions and that executed in a series
  • 00:28:31
    from that event
  • 00:28:34
    so let's talk about the API functions in
  • 00:28:37
    node.js so there are two types one is an
  • 00:28:40
    asynchronous non-blocking function and
  • 00:28:43
    the second is a synchronous blocking
  • 00:28:46
    function and the difference between the
  • 00:28:47
    two of them is asynchronous is that
  • 00:28:49
    there is no structure to the order if I
  • 00:28:52
    have the API is resolved synchronous
  • 00:28:56
    means that when the feedback from the
  • 00:28:58
    API is received you have to execute the
  • 00:29:01
    response in a series for how the
  • 00:29:05
    response is sent to you
  • 00:29:07
    so what is a package Json file so the
  • 00:29:12
    package Json file is at the heart of our
  • 00:29:15
    node.js package when we actually will
  • 00:29:18
    initialize a solution a folder to be in
  • 00:29:21
    node.js package
  • 00:29:24
    you'll find that the package itself
  • 00:29:25
    holds all of the metadata that's
  • 00:29:28
    particular to the project you're working
  • 00:29:30
    on such as project name version
  • 00:29:33
    requirements it is you have to have it
  • 00:29:35
    installed in the root of the directory
  • 00:29:37
    for the project and again look at any of
  • 00:29:42
    the videos that we have on nodejs we do
  • 00:29:44
    have demonstrations within those videos
  • 00:29:47
    that actually then go through and break
  • 00:29:49
    out how to create that root package and
  • 00:29:54
    you'll see how you can actually then go
  • 00:29:55
    ahead and update the instructions or the
  • 00:29:58
    metadata within the package so here we
  • 00:30:01
    have an example of what that metadata
  • 00:30:03
    looks like so again this kind of
  • 00:30:05
    continues that question of what is a
  • 00:30:07
    packet Json file and you may be asked
  • 00:30:09
    you know what is the metadata and why is
  • 00:30:12
    it important and the metadata is a basic
  • 00:30:16
    Json collection of pairing of key
  • 00:30:21
    details such as name version description
  • 00:30:23
    and then and the custom version that you
  • 00:30:26
    put so for instance under name you could
  • 00:30:29
    create a name for your project there
  • 00:30:30
    can't be any spaces what is the version
  • 00:30:33
    and the description and what is the main
  • 00:30:36
    or starting path and for the solution
  • 00:30:39
    typically that would be index.js but it
  • 00:30:42
    could be anything.js but index.js is
  • 00:30:46
    typical simply because
  • 00:30:48
    index.html is the starting point for a
  • 00:30:51
    typical web application
  • 00:30:53
    so how would you use a URL module in
  • 00:30:57
    node.js
  • 00:30:59
    so with a URL module what it allows you
  • 00:31:01
    to do is really two things one is that
  • 00:31:03
    it provides the resolution passing of a
  • 00:31:07
    URLs for Utilities in your application
  • 00:31:10
    and then it allows you to extend your
  • 00:31:14
    module with built-in Solutions and split
  • 00:31:17
    up the web address into a readable
  • 00:31:19
    format
  • 00:31:20
    so in this example we have the URL and
  • 00:31:25
    the response it would would give for
  • 00:31:28
    that URL which will then be a year and
  • 00:31:32
    month and it'll be in a readable format
  • 00:31:35
    so they would read out as 2020 and then
  • 00:31:39
    the month
  • 00:31:41
    so what is express.js and you've heard
  • 00:31:44
    me mentioned this a couple of times in
  • 00:31:45
    the video and we actually have a
  • 00:31:46
    separate video on express.js
  • 00:31:49
    um I would express.js is a web
  • 00:31:51
    application framework that allows you to
  • 00:31:52
    build out Web Solutions for both mobile
  • 00:31:56
    and traditional desktop right inside of
  • 00:32:00
    node.js so it's very easy to use
  • 00:32:03
    being able to install and web.js is as
  • 00:32:06
    simple as requiring Express to be
  • 00:32:08
    installed in the example that we have
  • 00:32:10
    here on the screen it's a full solution
  • 00:32:13
    of showing how to actually build out a
  • 00:32:16
    solution with web.js so in this example
  • 00:32:19
    you start off the first two lines
  • 00:32:22
    required Express to be installed and the
  • 00:32:25
    store comes from node packet manager
  • 00:32:27
    then we have a simple application that
  • 00:32:29
    will then send to the browser window a
  • 00:32:33
    hello world message confirming that
  • 00:32:35
    Express is up and running and then the
  • 00:32:39
    third block of content starting with
  • 00:32:40
    vars server actually will Define the
  • 00:32:44
    port where your application is going to
  • 00:32:46
    run so in this instance the port is
  • 00:32:49
    going to run on localhost and the port
  • 00:32:54
    will be Port 8081 and so you can
  • 00:32:57
    actually go to localhost colon 8081 and
  • 00:33:00
    when you do that that will trigger the
  • 00:33:02
    Apple application that will forward up
  • 00:33:05
    the message hello world and it's all
  • 00:33:07
    coming from express.js
  • 00:33:10
    so what are streams in node.js so
  • 00:33:14
    streams are objects that allow you to
  • 00:33:17
    read and write data continuously back
  • 00:33:20
    and forth within your application and
  • 00:33:22
    there's really four different types of
  • 00:33:24
    streams there's readable writable duplex
  • 00:33:27
    and transform
  • 00:33:31
    the readable one stream through which
  • 00:33:33
    data can be read
  • 00:33:35
    the writable streams that you can
  • 00:33:37
    actually write to a duplex is a stream
  • 00:33:40
    where it is both readable and writable
  • 00:33:44
    and transform our streams that can be
  • 00:33:47
    manipulated the data while it is being
  • 00:33:50
    read or written
  • 00:33:53
    so how do you update and delete a
  • 00:33:56
    dependency so say for instance we want
  • 00:33:59
    to install something like Express so if
  • 00:34:02
    you wanted to install Express what you
  • 00:34:04
    would do is you would just write them
  • 00:34:06
    inside of your project you want to go to
  • 00:34:09
    terminal window and write in the command
  • 00:34:12
    npm install Express
  • 00:34:15
    if you want to update the dependencies
  • 00:34:19
    within your node package manager to
  • 00:34:21
    update all of them all you have to do is
  • 00:34:23
    write the command npm update all
  • 00:34:26
    dependencies
  • 00:34:27
    and then if you want to explicitly
  • 00:34:29
    uninstall a dependency such as
  • 00:34:32
    express.js that's using the uninstall
  • 00:34:35
    command and so that would again be going
  • 00:34:38
    to terminal window and you would type
  • 00:34:40
    npm uninstall Express
  • 00:34:43
    and again it's really easy to create a
  • 00:34:46
    simple server in node.js that will run a
  • 00:34:49
    simple command the HTTP service is
  • 00:34:52
    actually built into node.js you don't
  • 00:34:55
    need to use express.js I typically use
  • 00:34:57
    express.js when I want to do a web
  • 00:34:59
    server because typically what I find is
  • 00:35:01
    that I will want to go and do something
  • 00:35:03
    more complicated but if you want to do
  • 00:35:04
    something that illustrates just the core
  • 00:35:07
    functionality within node.js you can
  • 00:35:09
    actually just require the core HTTP
  • 00:35:12
    service that actually comes as part of
  • 00:35:14
    node.js and then you can actually then
  • 00:35:16
    go ahead and tell it to create a service
  • 00:35:20
    and then to write in plain text I
  • 00:35:25
    command or text string such as in this
  • 00:35:28
    case it'll be hello world and that would
  • 00:35:30
    pop out and then the final line is to
  • 00:35:33
    then listen that if you go to a web
  • 00:35:36
    browser that's on
  • 00:35:39
    port127.0.01 or localhost and go to Port
  • 00:35:43
    colon 8080 once you actually go to that
  • 00:35:47
    that will trigger this application and
  • 00:35:48
    you'll get the text hello world pop up
  • 00:35:51
    on your screen
  • 00:35:52
    so explain synchronous and non-blocking
  • 00:35:55
    apis in node.js
  • 00:35:58
    so all the apis in node.js are
  • 00:36:03
    asynchronous which means that they are
  • 00:36:04
    non-blocking which means you can run
  • 00:36:06
    them continuously and scale around that
  • 00:36:10
    which is just fantastic it's one of the
  • 00:36:12
    reasons why node.js can scale so fast
  • 00:36:14
    and the eighth means that the apis can
  • 00:36:17
    return data send data after it's been
  • 00:36:19
    called and really increase the
  • 00:36:22
    efficiency of events as they are
  • 00:36:24
    triggered Within node.js
  • 00:36:27
    so how do you implement async and you
  • 00:36:30
    know JS and so the example that we have
  • 00:36:32
    on the left hand side allows us to
  • 00:36:35
    trigger async and it's using the async
  • 00:36:38
    function and as you can see in this
  • 00:36:40
    example it's actually something that can
  • 00:36:42
    be done very quickly in this example
  • 00:36:44
    we're actually making a command to logo
  • 00:36:47
    host and an app that's running on Port
  • 00:36:50
    3000 and then depending on what we get
  • 00:36:54
    if there's an error message and then
  • 00:36:56
    we'll have error message go to the
  • 00:36:58
    console log which is the terminal window
  • 00:37:00
    and if we get a response to an
  • 00:37:03
    application then we'll actually get a
  • 00:37:06
    positive response which would be fetched
  • 00:37:08
    response so again very quick and easy
  • 00:37:12
    that you use the async function to be
  • 00:37:15
    able to build out and you to get your
  • 00:37:18
    asynchronous code
  • 00:37:21
    so what is the purpose of module exports
  • 00:37:24
    so a module export is a way to
  • 00:37:27
    encapsulate your the entire code for a
  • 00:37:30
    solution in a single package and a
  • 00:37:32
    single file and then you can then share
  • 00:37:35
    that with other developers so you're all
  • 00:37:38
    working from the same environment
  • 00:37:41
    so what is a callback function in
  • 00:37:44
    node.js a callback function is
  • 00:37:46
    essentially that once you run and you've
  • 00:37:49
    triggered an event mongodb has
  • 00:37:51
    consistently been ranked as one of the
  • 00:37:53
    top five nosql database Management
  • 00:37:54
    Systems so if you're someone who's
  • 00:37:56
    applying for a position in database
  • 00:37:58
    management roles you will almost
  • 00:37:59
    certainly be working with mongodb at
  • 00:38:01
    some point now whether you are upgrading
  • 00:38:03
    your skills or interviewing for a
  • 00:38:05
    database management position using
  • 00:38:06
    mongodb it's a good idea to be familiar
  • 00:38:09
    with the most frequently Asked mongodb
  • 00:38:11
    interview questions and answers in the
  • 00:38:13
    latter case it is beneficial for you to
  • 00:38:15
    prepare for the interview so that you
  • 00:38:17
    are not God off guard even if you are
  • 00:38:19
    just interested in learning about
  • 00:38:20
    mongodb for the sake of upskilling keep
  • 00:38:23
    in mind that acquiring this kind of
  • 00:38:25
    knowledge may lead you to looking for a
  • 00:38:27
    better job which means you'll be facing
  • 00:38:29
    an interview sooner on that note hey
  • 00:38:31
    everyone welcome to simple Channel I
  • 00:38:34
    hope you guys are doing good and staying
  • 00:38:36
    safe in this tutorial we'll be
  • 00:38:38
    discussing some specially curated
  • 00:38:39
    mongodb interview questions that you
  • 00:38:41
    must Master to crack your next interview
  • 00:38:43
    so without any further Ado let's get
  • 00:38:46
    started with today's topic well but
  • 00:38:48
    before we begin if you're new to the
  • 00:38:49
    channel and haven't subscribed already
  • 00:38:51
    consider getting subscribed to our
  • 00:38:52
    Channel simply code to stay updated with
  • 00:38:54
    all the latest tech content and hit that
  • 00:38:56
    Bell icon to never miss an update from
  • 00:38:58
    us so let's get started with today's
  • 00:39:00
    tutorial so firstly let us discuss the
  • 00:39:02
    agenda now this mongodb interview
  • 00:39:04
    question is intended to give you a
  • 00:39:06
    general idea of the types of interview
  • 00:39:08
    questions you might face now we'll be
  • 00:39:10
    covering some theoretical as well as
  • 00:39:12
    practical questions in this tutorial now
  • 00:39:14
    typically recruiters begin with simple
  • 00:39:16
    questions and gradually increase the
  • 00:39:18
    difficulty level so in this mongodb
  • 00:39:20
    interview questions tutorial we'll start
  • 00:39:22
    with the basics and the progress to more
  • 00:39:25
    complex questions now before we begin
  • 00:39:27
    with the types of questions that are
  • 00:39:28
    being asked here's a simple and quick
  • 00:39:31
    tip for everyone who is watching this
  • 00:39:33
    video now make sure you have the never
  • 00:39:35
    give up attitude I know it's that time
  • 00:39:37
    of the year where placements are going
  • 00:39:39
    in a rampant way but and I know you
  • 00:39:42
    might be giving interviews uh regularly
  • 00:39:45
    and what if you uh didn't get an offer
  • 00:39:48
    in one of the interviews from that so
  • 00:39:50
    make sure you have that attitude of
  • 00:39:52
    never give up and prepare for your next
  • 00:39:54
    interview and whenever you're giving an
  • 00:39:55
    interview make sure you are interactive
  • 00:39:57
    being interactive is one of the most
  • 00:39:59
    best or best way you can say in order to
  • 00:40:02
    get uh you know hired by the recruiter
  • 00:40:04
    so make sure you're conversing properly
  • 00:40:06
    with the interviewer while asking the
  • 00:40:08
    questions and finally behave
  • 00:40:09
    professionally which is another key
  • 00:40:12
    aspect while giving an interview so let
  • 00:40:14
    us now discuss the first question which
  • 00:40:16
    is the basic question which will be
  • 00:40:18
    asked which is explain what is mongodb
  • 00:40:20
    and its features so this is how you can
  • 00:40:23
    answer mongodb is basically an open
  • 00:40:25
    source cross platform nosql document
  • 00:40:27
    oriented database management system now
  • 00:40:30
    noise sculpin can be utilized as a
  • 00:40:33
    substitute for traditional relational
  • 00:40:34
    databases like SQL and MySQL which is
  • 00:40:38
    dependent on the SQL language right so
  • 00:40:40
    if you want to work with large data sets
  • 00:40:43
    of distributed data then nosql databases
  • 00:40:45
    may be quite supportive which are used
  • 00:40:47
    to store large volumes of data in the
  • 00:40:50
    form of documents which will offer the
  • 00:40:52
    developers the flexibility to work with
  • 00:40:54
    the evolving data models as there is no
  • 00:40:56
    fixed schema in this now relational
  • 00:40:58
    databases such as MySQL and Oracle store
  • 00:41:01
    data in tables and rows right they are
  • 00:41:04
    based on a branch of a theory known as
  • 00:41:06
    relational databases now these
  • 00:41:08
    relational databases are structured and
  • 00:41:10
    tables can be linked with each other via
  • 00:41:12
    a foreign key which is a property of
  • 00:41:15
    relational database which is asset
  • 00:41:17
    property which is being Satisfied by the
  • 00:41:19
    relational database but whereas the
  • 00:41:22
    mongodb being a documented oriented
  • 00:41:25
    database it can handle only that sort of
  • 00:41:28
    information and store as well as
  • 00:41:30
    retrieve information from these
  • 00:41:31
    documents only it provides the
  • 00:41:33
    flexibility as well as scalability that
  • 00:41:35
    you want with the querying and indexing
  • 00:41:37
    according to your requirement this
  • 00:41:39
    mongodb basically is based on json-like
  • 00:41:42
    documents where we store all the
  • 00:41:43
    information in that so this is how you
  • 00:41:45
    can answer the question which is what is
  • 00:41:47
    mongodb and its features
  • 00:41:50
    well the next question is what are some
  • 00:41:53
    alternative nosql databases to mongodb
  • 00:41:56
    now we have various Alternatives from
  • 00:41:58
    mongodb such as Cassandra Apache
  • 00:42:00
    Cassandra is a free and open source
  • 00:42:03
    distributed nosql database management
  • 00:42:05
    system which is again similar to that of
  • 00:42:07
    mongodb to handle large amounts of
  • 00:42:09
    unstructured data across the servers
  • 00:42:12
    providing High availability with no
  • 00:42:14
    single point of failure Apache Cassandra
  • 00:42:17
    is a database which can be a right
  • 00:42:19
    choice when you need scalability and
  • 00:42:21
    also High availability without
  • 00:42:22
    compromising performance next we have
  • 00:42:25
    redis redis is actually another uh
  • 00:42:28
    popular nosql database which is an open
  • 00:42:30
    source which is implemented as a
  • 00:42:33
    distributed key value store with
  • 00:42:34
    optional durability it can be also used
  • 00:42:37
    as a catchy Adam message broker also we
  • 00:42:40
    have other types other popular noise
  • 00:42:42
    databases like Amazon Dyno dynamodb
  • 00:42:45
    Apache headspace and neo4j now HPS again
  • 00:42:48
    is an open source non-relational uh
  • 00:42:50
    distributed database guys it is
  • 00:42:52
    generally written in JavaScript and it
  • 00:42:54
    is also developed as part of the Apache
  • 00:42:56
    software foundation so these are some of
  • 00:42:59
    the examples and can be used in
  • 00:43:01
    alternative to mongodb
  • 00:43:03
    all right let us now move to the next
  • 00:43:05
    question which is what type of nosql
  • 00:43:08
    database is mongodb now in general we
  • 00:43:11
    have four different types of categories
  • 00:43:13
    when we talk about in which category
  • 00:43:15
    mongodb comes under so basically we have
  • 00:43:17
    key value column based document database
  • 00:43:20
    and graph database now when I talk about
  • 00:43:23
    key value these database store data as
  • 00:43:25
    an index key and value pairs this
  • 00:43:28
    database is stored data in a schema-less
  • 00:43:30
    way example of a key value data store
  • 00:43:33
    include Cassandra redis dynamodb and Etc
  • 00:43:36
    next we have column based now column
  • 00:43:39
    based or column store type of database
  • 00:43:41
    is the one where these databases are
  • 00:43:44
    designed to store data as Columns of
  • 00:43:46
    data rather than as rows as data if it
  • 00:43:49
    stores in a row type of data it becomes
  • 00:43:51
    a traditional which is not a noise
  • 00:43:53
    database right so again example of a
  • 00:43:56
    column store databases are hbase even
  • 00:43:58
    Cassandra comes under the column based
  • 00:44:01
    as well next we have the document data
  • 00:44:03
    database which is actually the type of
  • 00:44:06
    nosql database that we are looking for
  • 00:44:07
    which is mongodb now document databases
  • 00:44:10
    had designed to store documents with
  • 00:44:12
    each document having a unique key and
  • 00:44:15
    popular document databases are couch
  • 00:44:17
    base and mongodb and finally we also
  • 00:44:19
    have a graph type of database where they
  • 00:44:22
    are based on graph Theory so these
  • 00:44:24
    databases are basically designed for
  • 00:44:26
    data which needs to be represented as
  • 00:44:28
    graphs so the data that is present in
  • 00:44:31
    this sort of database is interconnected
  • 00:44:33
    with multiple number of relationship
  • 00:44:36
    between them in in the form of graphs
  • 00:44:38
    and trees and a popular graph database
  • 00:44:41
    is neo4j as well as big data so this is
  • 00:44:45
    what mongodb is and it comes under the
  • 00:44:48
    document database type of noise scale
  • 00:44:50
    database the next question is how does
  • 00:44:53
    mongodb store data now data in mongodb
  • 00:44:56
    is stored in based on documents or the
  • 00:44:58
    Json style data structures documents
  • 00:45:01
    contain one or more fields and each
  • 00:45:04
    field contains a value of a specific
  • 00:45:06
    data type so mongodb stores data records
  • 00:45:09
    as documents which are in the form of
  • 00:45:11
    based on documents which are gathered
  • 00:45:13
    together in collections so these
  • 00:45:16
    documents as we said earlier has a sub
  • 00:45:19
    specific data types including let's say
  • 00:45:21
    arrays normal General data and these
  • 00:45:24
    documents tend to share a similar
  • 00:45:26
    structure which are organized as
  • 00:45:28
    collection so you can say a group of
  • 00:45:30
    documents are kept in a collection it
  • 00:45:33
    may be helpful to think of documents as
  • 00:45:34
    in a comparison to the rows in a
  • 00:45:37
    relational database so fields are
  • 00:45:39
    similar to columns and collections are
  • 00:45:41
    similar to tables in mySQL database
  • 00:45:44
    which is again a no it's a relational
  • 00:45:46
    database so this is how mongodb stores
  • 00:45:48
    data the next question is mongodb is a
  • 00:45:52
    schemailers database if yes how do you
  • 00:45:55
    create schema in mongodb now the scheme
  • 00:45:57
    of a data base describes the structure
  • 00:45:59
    of the data to be stored right in a
  • 00:46:01
    relational database the schema defines
  • 00:46:03
    its tables its fields in each table and
  • 00:46:07
    the relationship between each field and
  • 00:46:09
    each table so if you take SQL as an
  • 00:46:12
    example which is a schema based database
  • 00:46:15
    right so in schema is defined by the
  • 00:46:16
    tables and the fields that is the
  • 00:46:19
    columns and rows that are present in it
  • 00:46:20
    and the relation between them
  • 00:46:23
    on the other hand we have mongodb now in
  • 00:46:26
    documented oriented databases like
  • 00:46:28
    mongodb data is stored in collections of
  • 00:46:31
    key value pairs now given that Json is a
  • 00:46:34
    schema free data structure and that
  • 00:46:36
    mongodb depends on it it would be more
  • 00:46:38
    accurate to say that it has a
  • 00:46:40
    dynamically typed data so whenever you
  • 00:46:42
    create an insert a document to create a
  • 00:46:45
    schema it will automatically create one
  • 00:46:47
    for you so whenever a document is added
  • 00:46:49
    the database will automatically create
  • 00:46:51
    the corresponding collection
  • 00:46:53
    the next question is how is mongodb
  • 00:46:56
    different from SQL and better than MySQL
  • 00:46:58
    now mongodb is again a documented
  • 00:47:01
    oriented nosql database which is used to
  • 00:47:03
    store high volume of data and which
  • 00:47:05
    needs to process your huge data in a
  • 00:47:08
    quick session now it is a database that
  • 00:47:10
    came into picture around the mid 2000s
  • 00:47:13
    and it is again considered into the
  • 00:47:15
    category of a nosql database whereas
  • 00:47:17
    when you take SQL SQL is a programming
  • 00:47:20
    language used to communicate with and
  • 00:47:22
    manipulate relational databases for
  • 00:47:24
    example MySQL now there are quite
  • 00:47:28
    differences between both of these
  • 00:47:30
    databases basis right being being one as
  • 00:47:33
    a relational database the other being
  • 00:47:34
    relational and non-relational database
  • 00:47:37
    there are quite differences between them
  • 00:47:38
    so for example if you take the structure
  • 00:47:40
    in SQL data is represented in tables
  • 00:47:43
    whereas the data is represented in
  • 00:47:44
    documents and this further documents are
  • 00:47:46
    stored in collections now schema again
  • 00:47:49
    SQL has a predefined schema so whenever
  • 00:47:51
    you are creating a table you need to
  • 00:47:53
    predefine its schema whereas mongodb
  • 00:47:56
    does not have the implications of
  • 00:47:58
    specifying any schema before working on
  • 00:48:00
    it so it has basically a dynamic schema
  • 00:48:02
    next we have this scalability the data
  • 00:48:05
    in SQL can be vertically scalable and
  • 00:48:07
    when it comes to mongodb both horizontal
  • 00:48:10
    and vertical scalable of scaling of data
  • 00:48:12
    is possible when I talk about
  • 00:48:14
    transactions SQL also supports Atomic
  • 00:48:16
    operations and follows asset properties
  • 00:48:18
    whereas Bongo DB does not have proper
  • 00:48:21
    support for transactions and it follows
  • 00:48:23
    cap theorem and finally the type of
  • 00:48:25
    operations now some operations that we
  • 00:48:29
    perform in relational databases like SQL
  • 00:48:32
    for example SQL supports join operation
  • 00:48:34
    whereas we don't have the same sort of
  • 00:48:37
    join operation and mongodb so in this
  • 00:48:40
    way mongodb is different from SQL and in
  • 00:48:43
    some ways it is better than MySQL in
  • 00:48:46
    terms of processing a lot of
  • 00:48:47
    unstructured data and also has certain
  • 00:48:49
    features like replication sharding and
  • 00:48:53
    mapreduce and some of more critical
  • 00:48:55
    features that are not present in MySQL
  • 00:48:58
    well the next question is what are the
  • 00:49:00
    different data models in mongodb now
  • 00:49:03
    data models are categorized into two
  • 00:49:05
    types the first one is embedded data
  • 00:49:07
    model the next one is referent data
  • 00:49:09
    model now if I talk about Emirate data
  • 00:49:11
    model embedded documents capture
  • 00:49:13
    relationship between data by storing
  • 00:49:15
    related data in a single document
  • 00:49:17
    structure whereas reference data models
  • 00:49:20
    store the relationship between data by
  • 00:49:23
    including any links or references from
  • 00:49:25
    one document to another
  • 00:49:27
    moving on to the next question the next
  • 00:49:29
    question is how does indexing Works in
  • 00:49:32
    mongodb now a good indexing strategy be
  • 00:49:35
    it a relational database or a nosql
  • 00:49:38
    database it is essential for ensuring
  • 00:49:40
    that your database returns your results
  • 00:49:42
    as quickly as possible now mongodb
  • 00:49:45
    indexing is a special data structure on
  • 00:49:47
    which the index is created to hold the
  • 00:49:49
    data of a specific fields in a document
  • 00:49:52
    now in the absence of indexing in
  • 00:49:54
    mongodb there is a need to scan every
  • 00:49:56
    collection which is basically a
  • 00:49:58
    collection scan so mongodb indexes make
  • 00:50:01
    it unnecessary to perform a collection
  • 00:50:03
    scan which involves looking through
  • 00:50:05
    every document in collection from
  • 00:50:07
    matches to your query it also provides
  • 00:50:09
    effective indexing strategy now any
  • 00:50:11
    collection in mongodb can have one or
  • 00:50:14
    more indexes and those indexes can be
  • 00:50:16
    made on one or more multiple Fields And
  • 00:50:18
    even through throughout a mongodb
  • 00:50:20
    database so you need a good indexing
  • 00:50:22
    strategy to quickly add let's say
  • 00:50:24
    effectively access the data you required
  • 00:50:27
    from it and it also provide search
  • 00:50:28
    efficiency now indexing is a necessary
  • 00:50:31
    operation in mongodb which will bring
  • 00:50:33
    search efficiency in various execution
  • 00:50:36
    of statements so this is how indexing
  • 00:50:38
    Works in mongodb
  • 00:50:41
    so moving on to the next question what
  • 00:50:43
    is mongodb replication and sharding now
  • 00:50:46
    if I talk about replication replication
  • 00:50:48
    means duplicating the same data across
  • 00:50:51
    multiple mongodb servers so the main use
  • 00:50:53
    of replication is the data is available
  • 00:50:56
    at an instant way that is high
  • 00:50:58
    availability of data and it also
  • 00:51:00
    supports data redundancy and multiple
  • 00:51:03
    copies of of the data are being saved
  • 00:51:06
    across servers and also it provides data
  • 00:51:09
    recovery and backup options as well so
  • 00:51:12
    in a nutshell you can say that database
  • 00:51:13
    replication is the process of copying
  • 00:51:16
    data from one database in one server to
  • 00:51:20
    another database in another server
  • 00:51:22
    ensuring that the same data is available
  • 00:51:24
    on more than one mongodb server so again
  • 00:51:28
    the main purpose of using replication is
  • 00:51:30
    data redundancy and high availability so
  • 00:51:33
    by keeping data several copies or
  • 00:51:35
    replica stored on physically separate
  • 00:51:37
    servers it will ensure that the data is
  • 00:51:40
    protected and it is also accessible
  • 00:51:43
    whenever we need and also by generating
  • 00:51:45
    multiple copies of your data replication
  • 00:51:47
    enables you to increase data
  • 00:51:49
    availability which is also another
  • 00:51:50
    important factor this is especially
  • 00:51:52
    helpful if a server fails so in that
  • 00:51:55
    case you can use the replication and
  • 00:51:57
    finally you can also recover the data
  • 00:52:00
    that is lost due to any uninterrupted or
  • 00:52:02
    any hardware failure issues
  • 00:52:05
    now if I talk about sharding sharding is
  • 00:52:08
    also similar to that of replication but
  • 00:52:10
    it is a method of Distributing data
  • 00:52:12
    across multiple databases and mongodb
  • 00:52:15
    supports this deployment of data with
  • 00:52:18
    having large data sets and high
  • 00:52:20
    throughput via sharding
  • 00:52:22
    so let's take an example so you can give
  • 00:52:24
    an example to the recruiter like this
  • 00:52:27
    let's say I have a database having 2
  • 00:52:29
    million users and it has a capacity
  • 00:52:31
    which is 2 million records now what I'm
  • 00:52:34
    doing is I'm basically Distributing the
  • 00:52:36
    data across multiple databases and I'm
  • 00:52:38
    storing different data in different
  • 00:52:41
    databases now we have two machines which
  • 00:52:43
    has one million user capacity and
  • 00:52:45
    another one million user capacity
  • 00:52:48
    so in this way you can add more and more
  • 00:52:51
    multiple databases in order to store
  • 00:52:53
    your data
  • 00:52:55
    so by adding more capacity to a single
  • 00:52:58
    server such as adding more memory and
  • 00:53:00
    processing units or adding more RAM on a
  • 00:53:02
    single server that can be done using
  • 00:53:05
    sharding
  • 00:53:06
    let us now to move on to the next
  • 00:53:08
    question which is explain horizontal and
  • 00:53:10
    vertical scaling now vertical scaling
  • 00:53:12
    refers to adding more resources like CPU
  • 00:53:15
    Ram or any hardware or hard drive disk
  • 00:53:19
    space to your server which is again a
  • 00:53:21
    database or an application server which
  • 00:53:23
    is done on demand on the other hand
  • 00:53:26
    horizontal scaling refers or involves
  • 00:53:28
    adding more processing units or physical
  • 00:53:30
    machines to your server or databases now
  • 00:53:33
    mongodb which is a nosql database
  • 00:53:36
    handles horizontal scaling through
  • 00:53:37
    sharding so in a nutshell you can say
  • 00:53:40
    that vertical scaling can be used in
  • 00:53:41
    order to increase or decrease the
  • 00:53:43
    capacity of existing Services whereas
  • 00:53:45
    horizontal scaling adds more resources
  • 00:53:47
    like virtual machines to your system to
  • 00:53:50
    spread out the workload across them the
  • 00:53:52
    next question is when should we embed
  • 00:53:54
    one document with another so you should
  • 00:53:56
    consider embedded document that is sub
  • 00:53:58
    document whenever you rely on these four
  • 00:54:02
    factors that is when the relationship is
  • 00:54:04
    one to few that is it can be one two one
  • 00:54:06
    too many but not one to one so for
  • 00:54:09
    unlimited use case you should start
  • 00:54:11
    considering separating sub documents
  • 00:54:13
    into another collection the next
  • 00:54:15
    situation is when retrieval is likely to
  • 00:54:17
    happen together which will improve the
  • 00:54:20
    performance in such case you can embed
  • 00:54:22
    one document with another the next
  • 00:54:24
    factor is when updates are likely to
  • 00:54:26
    happen at the same time you can use this
  • 00:54:29
    multi-document transaction by embedding
  • 00:54:31
    data model and finally when the field is
  • 00:54:34
    rarely updated in such case you can use
  • 00:54:37
    the embedded document
  • 00:54:39
    well let us now move on to the next
  • 00:54:40
    question which is what are replica cells
  • 00:54:43
    and explain primary and secondary
  • 00:54:45
    replica sets in mongodb the process of
  • 00:54:48
    replication as we discussed earlier is
  • 00:54:51
    done via using replica sets in simple
  • 00:54:54
    words it is a group of mongod processes
  • 00:54:57
    to keep the same data across different
  • 00:54:59
    servers now a replica set is basically a
  • 00:55:03
    collection of related mongodb nodes
  • 00:55:05
    which must have three notes at least now
  • 00:55:08
    one of them must be a primary and the
  • 00:55:10
    rest secondary ones and a replication
  • 00:55:12
    structure can have up to 50 nodes so the
  • 00:55:16
    main types of nodes that we have is
  • 00:55:18
    primary and the secondary or you can
  • 00:55:20
    call it them as primary and secondary
  • 00:55:22
    replica sets now when I talk about
  • 00:55:24
    primary replica set it is the primer is
  • 00:55:27
    the member in the replica set that
  • 00:55:29
    receives the write and read operations
  • 00:55:31
    but read operations can be pointed out
  • 00:55:33
    to secondary nodes changing the
  • 00:55:35
    configuration at the moment to perform
  • 00:55:37
    the query beside is the replica set can
  • 00:55:40
    have only one primary node at most and
  • 00:55:43
    talking about secondary the secondary is
  • 00:55:45
    the node where the data is replicated to
  • 00:55:48
    maintain a copy a replica set can have
  • 00:55:50
    one or more secondary nodes and the
  • 00:55:53
    clients cannot write data to secondary
  • 00:55:55
    ones only they can read from them and if
  • 00:55:58
    at all there is any failed node it works
  • 00:56:01
    as a secondary node again until it is
  • 00:56:03
    until a new primary node will be
  • 00:56:06
    replaced with that so this is what a
  • 00:56:09
    replica set means and the type of
  • 00:56:11
    replica set which is the primary and
  • 00:56:13
    secondary I hope you understood this
  • 00:56:15
    so moving on to the next question which
  • 00:56:17
    is what is the use of capped collections
  • 00:56:21
    now the size of collection in mongodb is
  • 00:56:23
    typically unrestricted right so the
  • 00:56:25
    collection increases its size as more
  • 00:56:27
    documents are being added to that now a
  • 00:56:30
    capped collection is a special type of
  • 00:56:32
    collection that has either a fixed
  • 00:56:34
    number of documents in a collection or
  • 00:56:36
    fixed number of elements so it creates
  • 00:56:39
    new documents by overriding the oldest
  • 00:56:42
    documents present in that collection so
  • 00:56:44
    collections can have maximum size or
  • 00:56:47
    document counts that prevent them from
  • 00:56:49
    growing beyond the maximum threshold
  • 00:56:51
    that is being allocated and all capped
  • 00:56:54
    collections must specify a maximum size
  • 00:56:56
    and may also specify a maximum document
  • 00:56:59
    count only now mongodb removes older
  • 00:57:02
    documents if a collection reaches the
  • 00:57:04
    maximum size limit before it reaches the
  • 00:57:06
    maximum document count so overall the
  • 00:57:09
    structure and functionality of a capped
  • 00:57:12
    collection supports high performance for
  • 00:57:14
    credit operations like create read and
  • 00:57:17
    delete so this is what cap collection
  • 00:57:20
    says and some of it characteristics and
  • 00:57:22
    why we use it
  • 00:57:24
    let us now move on to the next question
  • 00:57:25
    which is how can you store images videos
  • 00:57:28
    and other large files now we often need
  • 00:57:31
    to store files in our databases but
  • 00:57:33
    mongodb sometimes or it doesn't let you
  • 00:57:36
    store any file larger than 16 MB in a
  • 00:57:39
    normal document so what you have to do
  • 00:57:41
    instead mongodb has a functionality
  • 00:57:43
    specifically for storing large files and
  • 00:57:45
    it goes by the name gridfs yes you have
  • 00:57:48
    heard it right grid FS is a driver
  • 00:57:50
    specification for uploading and
  • 00:57:52
    retrieval of mongodb files which are
  • 00:57:54
    larger than 16 MP in order to store
  • 00:57:56
    images videos and other large files it
  • 00:58:00
    is one of the most popular
  • 00:58:01
    specifications and it it has a size
  • 00:58:04
    limit of more than 16 MB so you can
  • 00:58:07
    store images videos that have size more
  • 00:58:09
    than of 16 MB now chunks of files like
  • 00:58:13
    be it and audio it update of PDF file or
  • 00:58:16
    anything it is being streamed as a
  • 00:58:18
    chunks so these are streamed into the
  • 00:58:21
    database and each chunk is limited 255
  • 00:58:25
    KB in this size this means that the last
  • 00:58:28
    chunk is normally either equal to or
  • 00:58:30
    less than 255 KB so whenever you read
  • 00:58:32
    from grade FS the driver resembles all
  • 00:58:35
    the chunks as needed this means that you
  • 00:58:37
    can read sections of a file as per your
  • 00:58:40
    query range
  • 00:58:42
    so I hope you understood uh what is grid
  • 00:58:44
    fs and what is the process to store
  • 00:58:47
    images videos and other large files
  • 00:58:49
    which is of more than 16 MB so basically
  • 00:58:51
    the interviewer want to know that
  • 00:58:53
    whether you are not familiar with the
  • 00:58:55
    concept of grid FS so that is the reason
  • 00:58:58
    he might ask you this question so you
  • 00:59:00
    have to be well prepared for it
  • 00:59:02
    well the next question is explain
  • 00:59:03
    aggregation in mongodb mongodb
  • 00:59:06
    aggregation process the data records
  • 00:59:08
    during an aggregation operation and
  • 00:59:10
    returns a single competent result just
  • 00:59:13
    like any other operations that are
  • 00:59:15
    performed in a relational database
  • 00:59:16
    similar to that aggregation is also used
  • 00:59:18
    in order to act on a group of values
  • 00:59:21
    from multiple documents present in a
  • 00:59:23
    collection to perform operations for
  • 00:59:25
    this grouped values and return a single
  • 00:59:27
    competed results now it actually groups
  • 00:59:31
    multiple documents which applies an
  • 00:59:33
    aggregation operation and it is
  • 00:59:35
    basically returning as the particular
  • 00:59:37
    value that we want from that operation
  • 00:59:40
    now there are various ways on how you
  • 00:59:42
    can perform aggregation we have three
  • 00:59:44
    different ways of carrying the
  • 00:59:46
    aggregation process in mongodb the first
  • 00:59:48
    one is aggregation pipeline next we have
  • 00:59:51
    mapreduce and finally we have single
  • 00:59:53
    purpose aggregation so you can further
  • 00:59:56
    explain each of these aggregation uh
  • 00:59:58
    depending upon the interviewer's
  • 01:00:00
    preference so basically I will
  • 01:00:01
    irrigation process in mongodb is modeled
  • 01:00:04
    on the concepts of data processing
  • 01:00:06
    pipeline so multiple document enter the
  • 01:00:09
    pipeline and then these documents are
  • 01:00:11
    being transformed into the aggregated
  • 01:00:13
    results next we have the map reduce as
  • 01:00:16
    the name suggests it does to operation
  • 01:00:17
    which is mapping and then reducing that
  • 01:00:20
    operation so it will map each document
  • 01:00:23
    and process along with one or more
  • 01:00:25
    objects for each document and reduce
  • 01:00:28
    phase in which output of map operations
  • 01:00:31
    are being combined together and finally
  • 01:00:33
    we have single purpose aggregation
  • 01:00:35
    operation where these operations
  • 01:00:37
    aggregate all the documents from a
  • 01:00:39
    single collection in mongodb now even
  • 01:00:42
    though they provide a simple access to
  • 01:00:44
    the basic aggregation operations they
  • 01:00:47
    lack the flexibility that are being
  • 01:00:49
    provided by the aggregation Pipeline and
  • 01:00:51
    map reduce operation
  • 01:00:54
    so these are the three uh aggregation
  • 01:00:57
    pipeline method which they go through
  • 01:00:59
    first is basically the math stage which
  • 01:01:01
    will filter the records or the documents
  • 01:01:03
    we need to work with uh and next it
  • 01:01:06
    performs the group operation which
  • 01:01:08
    basically is the aggregation and finally
  • 01:01:10
    it will sort the data so it will sort
  • 01:01:12
    the resulting documents the way we
  • 01:01:14
    require that is an ascending and
  • 01:01:16
    descending order now just like uh any
  • 01:01:19
    other operations given by aggregation in
  • 01:01:21
    mongodb we also have five different
  • 01:01:23
    types of operations that we can perform
  • 01:01:25
    which is sum which will add up the
  • 01:01:28
    values of every document next we have
  • 01:01:30
    average which will complete the average
  • 01:01:31
    value of every document and we have Min
  • 01:01:34
    which returns a minimum value from a
  • 01:01:36
    document and we have Max which will
  • 01:01:38
    written the maximum value within a
  • 01:01:40
    collection and finally we have Push
  • 01:01:42
    which will add the value to an array in
  • 01:01:44
    the document moving on to the next
  • 01:01:46
    question what is mean by ID field in
  • 01:01:49
    mongodb ide is the field that uniquely
  • 01:01:52
    identifies a document present in the
  • 01:01:54
    mongod EB collection so when you are
  • 01:01:56
    trying to insert a new document into the
  • 01:01:58
    database mongodb will automatically
  • 01:02:02
    create a unique ID field which will have
  • 01:02:05
    a unique value to its name now by
  • 01:02:07
    default mongodb creates a unique index
  • 01:02:09
    for the ID field during the creation of
  • 01:02:12
    any collection and the ID field is
  • 01:02:14
    always the first field in the document
  • 01:02:16
    and if the server receives a document
  • 01:02:18
    that does not have any ID field first
  • 01:02:20
    then the server will move the field at
  • 01:02:22
    the beginning and also ID field can be
  • 01:02:25
    avoided in the document that you want to
  • 01:02:27
    return by setting the value of the ID
  • 01:02:29
    field as 0 in the query
  • 01:02:32
    so what are some utilities for backup
  • 01:02:34
    and restoring in mongodb now by default
  • 01:02:38
    mongodb shell does not include any
  • 01:02:40
    import export of data or even
  • 01:02:42
    duplication or retrieval of uh data from
  • 01:02:46
    other uh you know applications but
  • 01:02:48
    however mongodb provides the utilities
  • 01:02:51
    and database tools to take backup and
  • 01:02:54
    perform the restore operations now
  • 01:02:56
    mainly we have four type of backup and
  • 01:02:58
    restoring options which are import
  • 01:03:01
    export term and malware
  • 01:03:04
    restore so you can use one of these
  • 01:03:06
    utilities like Dom import export
  • 01:03:10
    and restore to move your data in and out
  • 01:03:13
    of your mongodb database now the most
  • 01:03:15
    commonly used are mongodum and
  • 01:03:18
    restore the mongodon utility creates a
  • 01:03:20
    binary backup you know of a mongodb
  • 01:03:22
    database the mongodom tool is the
  • 01:03:25
    preferred method of dumping data from
  • 01:03:27
    your Source mongodb deployment and if
  • 01:03:29
    you're trying uh to restore the data
  • 01:03:32
    that you have basically deleted or
  • 01:03:34
    dumped you can use the Monger register
  • 01:03:36
    in order to fetch back the data that you
  • 01:03:39
    have dumped
  • 01:03:42
    so the next question is can you explain
  • 01:03:44
    about mapreduce process in mongodb
  • 01:03:48
    mapreduce is basically a data processing
  • 01:03:51
    Paradigm for condensing large volumes of
  • 01:03:53
    data into useful aggregated results so
  • 01:03:57
    basically mongodb provides the map
  • 01:03:58
    reduce features for only aggregation
  • 01:04:00
    purposes and generally there are two
  • 01:04:03
    phases of the map reduce as you can see
  • 01:04:05
    in the name which is mapping and
  • 01:04:06
    reducing so in the first phase each
  • 01:04:09
    document is processed and emits common
  • 01:04:11
    and redundant part of the document to
  • 01:04:13
    pass a unique record for the next phase
  • 01:04:16
    and in the next phase all the unique
  • 01:04:18
    part gets together and aggregated to
  • 01:04:20
    produce a single result and finally we
  • 01:04:23
    have a query here we'll pass the query
  • 01:04:25
    to filter the resultant set so with the
  • 01:04:28
    help of map reduce user can perform
  • 01:04:30
    sorting filtering and document
  • 01:04:32
    modification as per their need
  • 01:04:35
    so moving on to the next question which
  • 01:04:37
    is how does mongodb Ensure High
  • 01:04:39
    availability of data
  • 01:04:42
    in general High availability refers to
  • 01:04:45
    the uh you know Improvement of a system
  • 01:04:47
    or any applications availability by
  • 01:04:49
    minimizing the downtime caused by
  • 01:04:51
    routine maintenance or any hardware
  • 01:04:54
    related uh you know issues so mongodb
  • 01:04:57
    automatically stores copy sets and
  • 01:04:59
    multiple copies of data distributed
  • 01:05:01
    across servers and data centers now in
  • 01:05:05
    general mongodb is one such database
  • 01:05:07
    which can provide High availability for
  • 01:05:09
    the users by using features like
  • 01:05:11
    replication and sharding now in
  • 01:05:13
    replication the replica sets help
  • 01:05:15
    prevent website downtime using native
  • 01:05:17
    duplication and automatic failures now
  • 01:05:20
    mongodb has a great support for high
  • 01:05:22
    availability without no thought through
  • 01:05:25
    replication set but replica set is not
  • 01:05:27
    enough for a production ready system
  • 01:05:29
    that is it requires a bit of planning in
  • 01:05:32
    order to deploy this so sometimes it
  • 01:05:35
    might be an issue but in most of the
  • 01:05:37
    cases if the system crashes or the
  • 01:05:39
    hardware or software faces any issues uh
  • 01:05:41
    you know ODB in the data mongodb helps
  • 01:05:44
    you recover and backup your data in the
  • 01:05:47
    system
  • 01:05:49
    so the next question is what is the role
  • 01:05:51
    of profiler in mongodb now so far we
  • 01:05:54
    have discussed some of the basic to
  • 01:05:56
    moderate uh level questions guys now
  • 01:05:58
    from here on you will find some
  • 01:06:00
    practical as well as you know advanced
  • 01:06:02
    level questions so you might need to
  • 01:06:05
    focus a little bit and even if you're
  • 01:06:07
    not confident and if you don't know the
  • 01:06:09
    answer which we are discussing now you
  • 01:06:11
    can directly tell to the recruiter of
  • 01:06:13
    the interviewer that you do not know the
  • 01:06:16
    answer but you hope that you have an
  • 01:06:17
    idea on this and you can work on that
  • 01:06:19
    and you can get back to him so again
  • 01:06:22
    let's get back to the question which is
  • 01:06:23
    what is the role of profiler in mongodb
  • 01:06:26
    now database profiler is used to collect
  • 01:06:28
    information regarding the queries which
  • 01:06:30
    are executed on an individual database
  • 01:06:32
    instance so basically this uh profiler
  • 01:06:36
    in mongodb database allows you to
  • 01:06:37
    collect performance data about
  • 01:06:39
    operations occurring on a mongodb
  • 01:06:42
    instance
  • 01:06:47
    the next question is can we use regular
  • 01:06:49
    expressions in mongodb now in SQL we do
  • 01:06:52
    have regular Expressions where we need
  • 01:06:54
    uh where we write a query to find
  • 01:06:57
    certain patterns that are present in our
  • 01:06:59
    database table right in a similar way
  • 01:07:02
    regular expressions are also used to
  • 01:07:04
    match patterns in a document just like
  • 01:07:06
    finding a pattern in an SQL tables so
  • 01:07:09
    regular expression basically provides
  • 01:07:11
    patterns a sequence of characters for
  • 01:07:13
    matching and defining a search pattern
  • 01:07:15
    and also retrieving an unidentified
  • 01:07:17
    field using a certain pattern becomes
  • 01:07:20
    easily within a document and querying a
  • 01:07:22
    database in order to find a smaller
  • 01:07:24
    subset of data within a collection we
  • 01:07:27
    can use regular expression so regex
  • 01:07:29
    operator in mongodb provides regular
  • 01:07:32
    expression capabilities from pattern
  • 01:07:34
    matching strings in the queries and the
  • 01:07:36
    syntax is followed as DB dot collection
  • 01:07:39
    name dot file mention the field name and
  • 01:07:42
    mention the reex keyword and mention the
  • 01:07:44
    pattern now the pattern can be of any uh
  • 01:07:48
    of your choice
  • 01:07:51
    so the next question is how do you
  • 01:07:53
    search for documents in which a specific
  • 01:07:55
    field has one or more values now you can
  • 01:07:58
    say this is a bit of practical question
  • 01:08:00
    guys the interviewer wants to know
  • 01:08:02
    whether you are not uh whether or not
  • 01:08:05
    you are comfortable and have an idea of
  • 01:08:08
    using various operators in mongodb so
  • 01:08:11
    you can use the DB dot collection file
  • 01:08:13
    operation and also use a query operator
  • 01:08:16
    which is dollar in in order to specify
  • 01:08:18
    the field and the values that you want
  • 01:08:20
    to retrieve or you want to search for
  • 01:08:22
    inert document so for example I have
  • 01:08:24
    given an example which says that in
  • 01:08:26
    order to return all employees whose
  • 01:08:29
    title is product manager or executive
  • 01:08:31
    director in such case the query would be
  • 01:08:34
    DB dot employees dot find mention the
  • 01:08:37
    field which is title mention the uh in
  • 01:08:39
    which is a query operator here mention
  • 01:08:41
    the product manager and executive
  • 01:08:43
    director which we are trying to find so
  • 01:08:45
    if there is any record or the person who
  • 01:08:49
    is associated associated with this title
  • 01:08:51
    of product manager or executive director
  • 01:08:54
    it will retrieve the record now we have
  • 01:08:56
    a person name whose first name is Rahul
  • 01:08:58
    and last name is Kumar whose ages 29 and
  • 01:09:01
    title is product manager so this is how
  • 01:09:04
    you can search for a document with a
  • 01:09:06
    specific field which has one or more
  • 01:09:08
    values
  • 01:09:11
    so the next question is which command
  • 01:09:13
    are used to insert single and multiple
  • 01:09:15
    documents into a collection now we
  • 01:09:18
    basically have two types of commands
  • 01:09:20
    which is DB dot collection dot insert1
  • 01:09:22
    which will insert a single document into
  • 01:09:24
    a mongodb collection and it returns a
  • 01:09:27
    document containing the inserted
  • 01:09:28
    documents ID field and next we have the
  • 01:09:31
    same uh command but the keyword changes
  • 01:09:35
    which is insert mini which is insert a
  • 01:09:37
    single or even multiple records uh into
  • 01:09:40
    a mongodb collection again it returns a
  • 01:09:43
    document containing each inserted
  • 01:09:45
    document's ID
  • 01:09:48
    well the next question is what is the
  • 01:09:50
    difference between
  • 01:09:51
    all and in operator in mongodb now both
  • 01:09:55
    all and in operator are used to filter
  • 01:09:57
    documents in a sub array based on a
  • 01:10:00
    conditional statement so but there are
  • 01:10:03
    some differences or subtle differences
  • 01:10:05
    between all and in operator now when I
  • 01:10:08
    talk about all operator all operator
  • 01:10:10
    retrieves all the documents which
  • 01:10:12
    contains a subset of the value we pass
  • 01:10:14
    and this subset might be in any order
  • 01:10:17
    but whereas in operator retrieves all
  • 01:10:20
    the documents which contains the either
  • 01:10:23
    of the values we pass
  • 01:10:25
    moving on what is the next question is
  • 01:10:28
    both rights and rates become faster when
  • 01:10:31
    you add more slaves to replica set as
  • 01:10:34
    the statement true or false explain the
  • 01:10:36
    reason well this statement is false now
  • 01:10:38
    a replica set can only have a primary uh
  • 01:10:42
    at any particular time that is having a
  • 01:10:44
    one master with other nodes the
  • 01:10:46
    secondary nodes being slaves so all
  • 01:10:49
    right operations are performed only on
  • 01:10:51
    the master node read operations on the
  • 01:10:53
    other hand can be performed on any
  • 01:10:55
    instance which can be a slave or a
  • 01:10:57
    master node so as a result adding more
  • 01:11:00
    slaves to a replica set accelerates only
  • 01:11:02
    reads operation and nods the and not the
  • 01:11:05
    rights operation so the statement is not
  • 01:11:09
    valid and it is a false statement we
  • 01:11:11
    cannot uh you know write and read both
  • 01:11:13
    uh operation when you add more slave to
  • 01:11:16
    replica set
  • 01:11:18
    the next question is what is Shard e and
  • 01:11:21
    mention the components of mongodb
  • 01:11:22
    sharded cluster now what is a short key
  • 01:11:25
    chart key is used by mongodb to
  • 01:11:27
    distribute the documents of a collection
  • 01:11:29
    across charts now on charting a mongodb
  • 01:11:32
    data set a Shard key is automatically
  • 01:11:35
    created by default so the short key can
  • 01:11:37
    be in the form of indexed field or
  • 01:11:39
    indexed compound fields that will be
  • 01:11:41
    used to distribute the data among the
  • 01:11:43
    shots generally The Shard key is used to
  • 01:11:46
    distribute the mongodb's collections
  • 01:11:48
    documents across all the shots where the
  • 01:11:50
    key consists of a single field or
  • 01:11:52
    multiple fields in every document now
  • 01:11:54
    the idea is to have multiple replica set
  • 01:11:57
    with multiple primaries which would
  • 01:11:59
    basically divide data and load it among
  • 01:12:01
    themselves and each of these replica set
  • 01:12:04
    is called as shard
  • 01:12:06
    chat basically has three components
  • 01:12:09
    which is basically Shard Mongoose and
  • 01:12:13
    config serger all this together
  • 01:12:15
    comprises of a mongodb sharded cluster
  • 01:12:19
    now when I talk about Shard what is a
  • 01:12:21
    Shard Shard contains a subset of the
  • 01:12:24
    sharded data okay A Shard is basically a
  • 01:12:28
    single mongodb server or a replica set
  • 01:12:30
    that stores a partition of the
  • 01:12:32
    application data that you have divided
  • 01:12:34
    now next we have the mongos Mongoose
  • 01:12:38
    router or the it is a router of
  • 01:12:40
    operations now because each chart
  • 01:12:42
    contains only part of the cluster data
  • 01:12:45
    you need something to root operations to
  • 01:12:47
    the appropriate charts that's where
  • 01:12:49
    mongos comes in the Mongoose process is
  • 01:12:52
    a router that directs all the reads
  • 01:12:54
    writes and commands to the appropriate
  • 01:12:57
    shard in this way mongos provides client
  • 01:13:00
    with a single point of contact with the
  • 01:13:02
    cluster and finally we have config
  • 01:13:04
    servers now Mongo's process are
  • 01:13:07
    basically a durable should be durable
  • 01:13:10
    that means it must be in a position to
  • 01:13:13
    store the metadata in order to properly
  • 01:13:16
    manage the cluster right which we have
  • 01:13:19
    formed with the short key so that's the
  • 01:13:21
    job of the config server this metadata
  • 01:13:24
    includes the cluster configuration the
  • 01:13:27
    location of each database collection and
  • 01:13:30
    the particular range of data there so
  • 01:13:32
    this is what basically shark Key is and
  • 01:13:35
    multiple components that are included in
  • 01:13:37
    the mongodb sharded cluster
  • 01:13:41
    so moving on to the next question which
  • 01:13:43
    is the joint plus is a key feature of
  • 01:13:45
    relational database systems what is the
  • 01:13:47
    mongodb equivalent if any and are there
  • 01:13:50
    any limitations now whenever we hear
  • 01:13:52
    about joints we have like different
  • 01:13:55
    operations like inner join after join
  • 01:13:58
    left join and uh you know cross join so
  • 01:14:02
    similarly we have a question here that
  • 01:14:04
    means if we talk about no SQL that means
  • 01:14:06
    we do not have no joints that means we
  • 01:14:08
    do have joints or we do not have joints
  • 01:14:10
    that's the main question but the thing
  • 01:14:12
    is we have a joint equivalent in mongodb
  • 01:14:15
    also which is the lookup operator which
  • 01:14:18
    is a significant disadvantages that is
  • 01:14:21
    it does not work in charted collection
  • 01:14:23
    right so it's worth noting that rather
  • 01:14:25
    than looking for a direct equivalent to
  • 01:14:27
    join mongodb developers often simply
  • 01:14:30
    denormalize the data and which
  • 01:14:33
    eliminates the need for a join you know
  • 01:14:35
    operation in a mongodb database so in a
  • 01:14:38
    nutshell you can say it performs an
  • 01:14:40
    outer join to a collection in the same
  • 01:14:43
    database to filter the documents from
  • 01:14:45
    The Joint collection for processing now
  • 01:14:47
    the lookup operator adds a new array
  • 01:14:50
    field to each input document and this
  • 01:14:52
    new array field contains the matching
  • 01:14:54
    documents from The Joint collection
  • 01:14:59
    so the next question is mention some
  • 01:15:00
    pros and cons of normalizing data in
  • 01:15:03
    mongodb database now normalizing data is
  • 01:15:06
    a key factor in relational database but
  • 01:15:08
    what about mongodb now updated documents
  • 01:15:11
    is fast for raw normalized data and it
  • 01:15:13
    is relatively so slower for denormalized
  • 01:15:16
    data well on the other hand reading
  • 01:15:18
    documents is fast in denormalized data
  • 01:15:20
    and slower for normalized data so
  • 01:15:23
    denormalized data is hard to keep in
  • 01:15:25
    sync and takes up more space so rdbms
  • 01:15:28
    generally have this organic support
  • 01:15:31
    for normalization and a lot of data to
  • 01:15:34
    be managed as a separate entity whereas
  • 01:15:36
    nosql dbmss like mongodb do not have
  • 01:15:40
    this active support for normalization
  • 01:15:44
    so the next question is what are the
  • 01:15:46
    advantages of using mongodb now there
  • 01:15:49
    are various advantages of using mongodb
  • 01:15:51
    for example it is an open source DB that
  • 01:15:54
    is it is ready readily available for
  • 01:15:56
    everyone to download and perform the
  • 01:15:58
    operations right away and it is also
  • 01:16:00
    easy to use the syntax is also user
  • 01:16:03
    friendly just like SQL it is also highly
  • 01:16:06
    flexible which allows you to store and
  • 01:16:08
    work on different data types and allows
  • 01:16:11
    you to store unstructured data of
  • 01:16:12
    different types in one or more documents
  • 01:16:14
    and the security is also a Paramount
  • 01:16:17
    Feature for any user right so mongodb
  • 01:16:19
    provides Advanced security features as
  • 01:16:22
    well and we also talked about high
  • 01:16:24
    availability in our previous question
  • 01:16:25
    and it also has reliable indexing for a
  • 01:16:28
    faster retrieval of data it has a
  • 01:16:30
    flexible schema design unlike the uh
  • 01:16:33
    predefined schema in relational
  • 01:16:35
    databases so this flexible or the
  • 01:16:38
    dynamic schema design allows you to meet
  • 01:16:40
    the ever-changing conditions of the Big
  • 01:16:42
    Data applications uh you know with the
  • 01:16:45
    vast amount of data that is being
  • 01:16:46
    incorporated into the documents you can
  • 01:16:49
    have a better Edge on the data if you're
  • 01:16:52
    working on large scale applications then
  • 01:16:54
    moment DB can be a great choice for you
  • 01:16:56
    with all this it also gives you high
  • 01:16:59
    performance which is another key feature
  • 01:17:01
    of mongodb and one of its greatest
  • 01:17:04
    advantage of a noiseql database
  • 01:17:06
    and that gives us the last question of
  • 01:17:09
    our interview question uh which is what
  • 01:17:12
    are some applications of mongodb now
  • 01:17:15
    mongodb being a nosql database is widely
  • 01:17:18
    popular in many uh sectors nowadays and
  • 01:17:21
    some of the major applications or
  • 01:17:23
    real-time use case of mongodb is it is
  • 01:17:26
    used in iot which is internet of things
  • 01:17:28
    with the world rapidly uh advancing in
  • 01:17:32
    uh you know in technology iot plays a
  • 01:17:34
    crucial role and it is important that we
  • 01:17:37
    uh as a user you know have these uh
  • 01:17:41
    intention to store that data and have
  • 01:17:44
    that data predicted in any sense now the
  • 01:17:46
    data is only getting larger and larger
  • 01:17:49
    and we also heard this phrase that data
  • 01:17:52
    is the new oil so with the coming in the
  • 01:17:54
    coming years the data is exceptionally
  • 01:17:56
    going to rise and we need mongodbs to
  • 01:17:59
    store this uh huge or huge volumes of
  • 01:18:02
    data into our uh databases right so it
  • 01:18:06
    is one of the applications of mongodb
  • 01:18:08
    and we also have mobile applications and
  • 01:18:10
    in order to perform real-time analysis
  • 01:18:12
    and we also have uh it is also used in
  • 01:18:15
    catalog management content management
  • 01:18:17
    and for product management and various
  • 01:18:20
    others sectors as well now companies
  • 01:18:23
    also like to use noise databases uh
  • 01:18:26
    because of its flexible uh design and
  • 01:18:30
    the need of you know storing data
  • 01:18:33
    without any uh predefined schema makes
  • 01:18:36
    it a best nosql database like companies
  • 01:18:41
    like eBay Shutterfly New York Times
  • 01:18:44
    Verizon and many other big companies use
  • 01:18:47
    uh mongodb nowadays and also the one of
  • 01:18:50
    the real life application or use cases
  • 01:18:54
    the best example you can give is aadhar
  • 01:18:56
    card which is India's unique
  • 01:18:58
    identification which is uh based on
  • 01:19:00
    identifying a person's you know identity
  • 01:19:04
    so the other uses mongodb to store this
  • 01:19:06
    massive amounts of demographic and
  • 01:19:08
    biography biometric data of over more
  • 01:19:11
    than 1.5 billion uh you Indian users so
  • 01:19:15
    other users mongodb in order to store
  • 01:19:17
    the images QR code details you know the
  • 01:19:21
    personal details of the user in its
  • 01:19:23
    database so these are some of the
  • 01:19:25
    applications of well that's a wrap on a
  • 01:19:27
    moon stack interview question we hope
  • 01:19:30
    you found this video informative and
  • 01:19:32
    helpful by now you should have a good
  • 01:19:34
    understanding of the different types of
  • 01:19:36
    interview questions frequently Asked in
  • 01:19:38
    month interviews
  • 01:19:40
    and if you are interested in learning
  • 01:19:41
    more about web development there are
  • 01:19:44
    plenty of resources available online you
  • 01:19:46
    can also check out our website for more
  • 01:19:48
    information on full stack web
  • 01:19:50
    development training courses and
  • 01:19:52
    certifications
  • 01:19:53
    thank you for watching and we'll see you
  • 01:19:56
    next time
  • 01:20:00
    hi there if you like this video
  • 01:20:03
    subscribe to the simply learned YouTube
  • 01:20:04
    channel and click here to watch similar
  • 01:20:07
    videos turn it up and get certified
  • 01:20:09
    click here
Etiquetas
  • MERN stack
  • MongoDB
  • Express.js
  • React.js
  • Node.js
  • web development
  • database management
  • full stack development
  • virtual DOM
  • JSX