Home >> Interviews Q & A >> Firebase Interview Questions

Firebase Interview Questions

Firebase Interview Questions: Firebase is a platform for building highly scalable and secure mobile and web application. It offers Hosting, Authentication and Real time database etc
Firebase Interview Questions
Q: What is Firebase?

Firebase is a mobile and web application development platform developed by Firebase, Inc. in 2011, then acquired by Google in 2014.

  1. Firebase is a platform which can power your app's backend, including
    • Realtime Database
    • Authentication
    • Hosting
  2. Firebase enables you to build cross-platform native mobile and web apps with our Android, iOS, and JavaScript SDKs.
  3. You can also connect Firebase to your existing backend using our server-side libraries or our REST API.
You may also like - React.js Interview Questions
Q: Who is the founder of Firebase?

Founders are James Tamplin, Andrew Lee, It was founded in september 2011

Q: What are the advantages of Firebase?
  1. It is very simple and user friendly.
  2. No need for complicated configuration.
  3. Firebase offers simple control dashboard.
  4. Offers number of useful services.
  5. The data is real-time, which means that every change will automatically update connected clients.
Q: What are the full forms of FCM and GCM in Firebase?

FCM: FCM stands for Firebase Cloud Messaging.

GCM: GCM stands for Google Cloud Messaging .

Q: What are the features of Firebase?
  1. Hosting
    − Firebase Hosting provides fast and secure hosting for your web apps and your static and dynamic content.
  2. Authentication
    1. Firebase Authentication provides backend services, easy-to-use SDKs, and ready-made UI libraries to authenticate users to your app.
    2. It supports authentication using passwords, phone numbers, popular federated identity providers like Google, Facebook and Twitter, and more.
  3. Real-time Database
    1. The Firebase Realtime Database is a cloud-hosted NoSQL database that lets you store and sync data between your users in realtime.
    2. Firebase automatically updates connected clients and store and sync data in real-time across all connected clients and also representing JSON objects or data

    Note: Try Cloud Firestore, the latest realtime, scalable NoSQL database from Firebase and Google Cloud Platform.

  4. Push notifications(FCM/GCM)
    − Firebase Cloud Messaging(FCM) is the new version of GCM. It inherits the reliable and scalable GCM infrastructure, plus new features! If you are integrating messaging in a new app, start with FCM.
  5. Firebase Analytics
    − Google Analytics for Firebase is a free app measurement solution that provides insight on app usage and user engagement. provides free, unlimited reporting on up to 500 distinct events.
  6. Firebase Storage
    − Firebase Storage lets you upload and read raw files to and from the Cloud Storage.
  7. Firebase Test Lab for Android
    − Firebase Test Lab is a cloud-based app-testing infrastructure. you can test your Android or iOS app across a wide variety of devices and device configurations, and see the results—including logs, videos, and screenshots—in the Firebase console.
Q: What are the difference between Cloud Firestore and Realtime Database?
  1. Firebase offers two cloud-based, client-accessible database that support realtime data syncing
  2. Cloud Firestore offers additional functionality, performance, and scalability on an infrastructure designed to support more powerful features in future releases
Key Realtime Database Cloud Firestore
Realtime and offline support Offline support for mobile clients on iOS and Android only. Offline support for iOS, Android, and web clients.
Querying
  1. You can only sort or filter on a property, not sort and filter on a property, in a single query.
  2. Queries are deep by default: They always return the entire subtree.
  1. You can chain filters and combine filtering and sorting on a property in a single query.
  2. Queries are indexed by default: Query performance is proportional to the size of your result set, not your data set
Writes and transactions
  1. Write data as an individual operation.
  2. Transactions in the native SDKs require a completion callback.
  1. Batch operations and complete them atomically.
  2. Transactions automatically repeat until they're completed.
Reliability and performance
  1. Realtime Database is a mature product.
  2. Databases are limited to zonal availability in a single region.
  1. Cloud Firestore is currently in beta.
  2. When Cloud Firestore graduates from beta, it will have stronger reliability than Realtime Database.
Scalability
  1. Scaling requires sharding.
  2. Scale to around 100,000 concurrent connections and 1,000 writes/second in a single database. Scaling beyond that requires sharding your data across multiple databases.
  1. Scaling will be automatic.
  2. Scales completely automatically (after beta), meaning you don't need to shard your data across multiple instances..
Security
  1. Read and write rules cascade.
  2. You need to validate data separately using the validate rule.
  1. Rules don't cascade unless you use a wildcard.
  2. Data validation happens automatically.
Pricing Charges only for bandwidth and storage, but at a higher rate. Charges primarily on operations performed in your database (read, write, delete) and, at a lower rate, bandwidth and storage.
You may also like - Node.js Interview Questions
Q: What are the types of Events in Firebase?

There are different types of event available in the Firebase:

  1. child_added − This event type will be triggered once for every player and every time a new player is added to our data.
  2. child_changed − This event type is triggered when the data has changed.
  3. child_removed − This event will be triggered once every time a child is removed.
Q: How to authenticate with firebase anonymously using JavaScript?
Authenticate with Firebase anonymously:

When a signed-out user uses an app feature that requires authentication with Firebase, sign in the user anonymously by completing the following steps:

1. Call the signInAnonymously method:
firebase.auth().signInAnonymously().catch(function(error) {
  // Handle Errors here.
  var errorCode = error.code;
  var errorMessage = error.message;
  // ...
});
2. If the signInAnonymously method completes without error, the observer registered in the onAuthStateChanged will trigger and you can get the anonymous user's account data from the User object:
firebase.auth().onAuthStateChanged(function(user) {
  if (user) {
    // User is signed in.
    var isAnonymous = user.isAnonymous;
    var uid = user.uid;
    // ...
  } else {
    // User is signed out.
    // ...
  }
  // ...
});

Ref - for more details visit Firebase Official Documentation

Q: How to Host Your Apps on Firebase Server?

Firebase Hosting gives you a fast, secure, and reliable way to host your app's static assets (like HTML, CSS, JavaScript, and media files) and serve your dynamic content.

1 – Install firebase globally:
npm install -g firebase-tools
2 – Initialize Firebase App:
firebase login
3 – Goto the Root folder of the app and Run:
firebase init
4 – Deploy Firebase App:
firebase deploy

Ref - for more details visit Firebase Official Documentation

Q: What are the limitations of Firebase?
  1. Costs: Firebase free plan is limited to 50 Connections and 100 MB of storage.
  2. Hosted solution: Firebase is a hosted solution, so You don’t host the data, Firebase does. You don’t have root access to the location where your data is stored etc

Full Stack Tutorials

Author @FullStackTutorials | View all Articles