Javatpoint Logo
Javatpoint Logo
Backbone.js Interview Questions

Backbone.js Interview Questions

A list of top frequently asked Backbone.js interview questions and answers are given below.

1) Explain Backbone.js?

Backbone.js is a light weighted Framework based on JavaScript. It is used to develop the client side applications which basically run on a web browser. Developing client side applications in Backbone.js is pretty easy and consumes lesser amount of time. It supports Model-View-Controller architecture.

2) In which language, Backbone.js is written?

backbone.js is written in JavaScript.

3) What was the initial release date of Backbone.js?

Backbone.js was initially released on October, 13, 2010.

4) Which is the latest stable version of Backbone.js and what is its released date?

The latest stable version of Backbone.js is 1.2.2 and it is released on August, 19, 2015.

5) What are the main components of Backbone.js?

Main components of Backbone.js:

  • Model
  • View
  • Collection
  • Router
  • Event class object

6) Explain the Architecture of Backbone.js

Backbone.js supports Model-View-Controller architecture that allows developers to separate business logic and GUI logic.

  • Model : It consists of data and the logic of the data retrieval from the server.
  • View : It consists of the code which is responsible for the end user interface i.e. the way in which the application is presented to the user.
  • Controller: It is the main application logic which controls the behaviour of the application. It is a part of the code which acts as a bridge between Model and View.

7) When do you require Backbone.js?

Backbone.js is required in following conditions:

  • When you are developing a web application that requires a lot of JavaScript.
  • It is required when you want to give structure to your code, if your application needs to be scalable.
  • Backbone is useful when a web application has to work with jQuery to traverse the DOM or give animations.

8) What is Collection in Backbone.js?

Collection can be defined as an ordered set of modules. In Backbone.js, there is a collection class which provides some useful methods to deal with the collections. We can extend the collection class in order to provide some additional functionalities.

9) Which are the three js files that are required to setup Backbone.js?

Following are the three js files that you require to setup Backbone.js:

  • jQuery
  • Backbone
  • Underscore

10) What is the use of Backbone.js router?

Backbone.js routers are used to route the application's URL to some particular actions and events. At least one route must be present for every defined router.

11) Describe Backbone events?

Backbone.js event can be defined as the module which can be mixed with any object. There are following methods which are used to manipulate Backbone.js events,

  1. On
  2. Off
  3. trigger
  4. Once
  5. listento
  6. stoplistening
  7. listentoonce

12) What is a View in Backbone.js?

View is the important part of Backbone.js architecture. In a Backbone.js application, view is responsible for the end user interface. View defines the way in which the application will be looked to the user. View is also responsible for listening to the events and reacting to them accordingly.

13) What is Modelbinder in Backbone.js?

Model Binder is a class which is used to bind the model and the view together. The binding is done in order to archive synchronization.

14) Mention some most powerful functionalities of Modelbinder?

Some Most powerful functionalities of modelbinder are

  1. It allows the developer to define the scope when binding is created using J-Query.
  2. In some of the cases, we can rely on the default scoping rules which are based on name attribute of HTML.
  3. The scoping rules can be redefined if the views are complex.

15) What are the advantages of Backbone.js?

Advantages of Backbone.js:

  • You can develop a web application with Backbone.js by using JavaScript with the minimal set of data-structuring (models & collections) and user interface (views & URLs).
  • It is best for developing MVC like web applications, single page web applications or complex JavaScript web applications in an organized and structured manner without JavaScript code mixing with HTML.
  • It provides API with lot of functions.
  • It provides a key value binding and custom events.
  • It facilitates you to abstract your data into models and your DOM application into views and bind the two together using events.

16) What is a Converter in Backbone.js?

Converter is a function which is used to convert JavaScript object to a model. It is invoked when the transition is made between an HTML element and the model's attribute.

17) Mention the case where you can use unbinding function in Backbone.js?

Unbinding function is used to remove the bindings on the model.

18) What are the configuration options available in Backbone.js?

There are the following configuration options available in Backbone.js.

  1. modelSetOptions
  2. boundAttributes
  3. supressThrows
  4. converter
  5. change Triggers
  6. InitialCopyDirection

19) What are the functionalities of parse in Backbone.js?

The data, which is returned from the server in response to a fetch or store operation, is called parse. It is used to return the model's data by passing into response object.

20) What is the function of setElement?

The Backbone.js setElement method is used to apply backbone view to a different DOM element.