×

Backbone.js Interview Questions

1) What is Backbone.js?

Backbone.js is a JavaScript framework or library. It is a client-side framework which helps in creating single page application in organized manner i.e. structured layout.

2) Backbone.js is written in which language ?

It is written in JavaScript also it has soft dependence on jQuery and hard dependence on UnderscoreJS.

3) Give some history about Backbone.js.

It was released on 13 October,2010 and developed by Jeremy Ashkenas .

4) Enlist the main component of Backbone.js.

  • Model
  • View
  • Controller
  • Router
  • Event

5) Describe Architecture of Backbone.js?

It follows the MVC Architecture:
  • Model - It helps to retrieve code from the server.
  • View - It is a HTML representation.
  • Controller - It saves and writes JavaScript application with its logic.

6) Describe the condition when can we use Backbone.js?

  • When there exist lots of jQuery/JavaScript code then Backbone.js is used to make it simpler and structured.
  • We can use when developing single page web-application.
  • To develop fast application having cleaner and more maintainable code.

7) Describe Backbone.js Events?

Backbone.js Events are the modules which helps the object to bind and trigger the custom events. These events can be called by desired name of our choice.

8) Enlist the method that can manipulate Backbone.js events.

  • On
  • Off
  • Trigger
  • Once
  • Listento
  • Stoplistening
  • Listentoonce

9) Enlist all built-in events in Backbone.js.

  • "add"(model, collection, options)
  • "remove"(model, collection, options)
  • "reset"(collection, options)
  • "sort"(collection, options)
  • "change"(model, options)
  • "change:[attribute]"(model, value, options)
  • "destroy"(model, collection, options)
  • "request"(model_or_collection, xhr, options)
  • "sync"(model_or_collection, resp, options)
  • "error"(model_or_collection, resp, options)

10) What is known as "Heart Of JavaScript Application" in Backbone.js?

Models of Backbone.js are the most important part of building Backbone.js Application due to which it is also known as Heart of JavaScript Application.

11) Define Collection in Backbone.js?

Backbone.js collection is described as ordered set of models. It provides loading and saving of new models to the server. A helper function is created which perform aggregation and computation for a list of models.

12) Enlist the files required to setup Backbone.js.

Three files are required:
  1. jQuery
  2. Backbone
  3. Underscore

13) Give the method that can manipulate Backbone.js collection.

  • Extend
  • Model
  • Initialize
  • toJSON
  • sync
  • Add etc.

14) What does Router in Backbone.js do?

It is used for routing client side application and connects them to their respective events and actions. Also, for an AJAX heavy applications it can be used to change the URL fragment of an application in order to provide bookmark-able and sharable URL's.

15) Explain Backbone.js sync?

It is a function in Backbone.js which is called repeatedly. Backbone.js sync read or save a model to the server and also persist the state of the model to the server.

16) Enlist the method that can manipulate Backbone.js sync.

  • Backbone.emulateHTTP
  • Backbone.emulatejson
  • Backbone.AJAX

17) Explain Backbone.js View.

Backbone.js View represents how your data looks like and model’s data to the user. It can be embedded into any JavaScript Template Library.

18) Define the term Modelbinder.

It is a Class in Backbone.js which is used to make the synchronization process of views and model together.

19) Give Configuration option available in Backbone.js .

  • InitialCopyDirection
  • modelSetOptions
  • change Triggers
  • boundAttribute
  • suppressThrows
  • converter

20) Define model.cid?

It is a special property of models, the cid or client id is automatically assigned to all models when they are first created. It works as an Unique Identifier.

21) What is the function of escape ?

It gets the current value of an attribute from the model but returns the HTML-escaped version of a model’s attribute. It is helpful in preventing XSS attacks, if you are interpolating data from the model into HTML.

22) What is the use of setElement ?

setElement is a function which is used when Backbone view has to be applied to a different DOM element.

23) Explain History in Backbone.js.

Backbone.History is used to keep track of the navigation history of different routes. It is also used to match the appropriate route and callbacks to handle events.

24) What is Template?

Template is used for the view. It is the HTML DOM elements for any View.

24) What is Utility?

Backbone.js Utility class define the following two methods:
  • Backbone.noConflict: This method returns the Backbone object back to its original value. We can also use a local instance of Backbone by using method Backbone.noConflict().
  • Backbone.$: This method allows user to use the particular jquery.

25) What is Converter?

Converter function helps to copy models attribute to a html attribute and vise versa.

26) What is ModelBinder in Backbone.js?

ModelBinder allows to define scope when you create your bindings using jQuery. We can also define scoping with jQuery selectors if the views are complex.

27) What is Memory Leaks in Backbone.js Application?

A memory leak is a gradual loss of available computer memory. It occurs when a program repeatedly fails to return memory it has obtained for temporary use.

28) What is model.attributes ?

The attributes property is the internal hash containing the model’s state, usually a form of the JSON object representing the model data on the server.

29) What is Push State ?

It allow to navigate to URLs without actually needing a page to refresh.

30) Explain Backbone.Model?

A model is a representation of any component use in application. Therefore, a model can be represented as following: Data + Logic = Model

Related Topics

Top 15 SQL Server Interview Question for 2024

1) Describe SQL Server? SQL server is a DataBase Management System developed by Microsoft. It was first introduced in year 2008 since, then many version has been introduced such as :...

2 minutes read.

Top 50 ReactJS Interview Questions for 2024

Top 50 Frequently asked ReactJS Interview Questions Q-1. What is React? Ans-1 React is a front-end JavaScript library which is developed by Facebook in 2011. It follows the component-based approach and allows us to...

15 minutes read.

Top 29 Phalcon Framework Interview Questions for 2024

1) What is Phalcon? Phalcon is an open source framework based on the MVC (Model-View-Controller) pattern. It is the combination of PHP and C language. It is developed by Andres Gutierrez...

6 minutes read.

Top 30 Web2py Framework Interview Questions for 2024

1) What is Web2py Framework? Web2py is an open source web application framework. It is written in the Python programming language. It allows web developers to design and develop dynamic web...

7 minutes read.

Top 15 Bootstrap Interview Questions for 2024

1) Explain what is Bootstrap? It is a Framework which is used for building the web application with minimal effort. Bootstrap is also used for developing responsive, mobile-first web sites. 2) What...

10 minutes read.

Top 16 Moo Tools Interview Questions for 2024

1) What is Moo Tools? MooTools stands for My Object-Oriented Tools. It is a lightweight and object-oriented JavaScript framework. It is used to create dynamic web page. It is developed by Valerio...

5 minutes read.

Top 28 Scala Interview Questions for 2024

1) What is Scala? Scala is a functional and object-oriented programming language. It is used to develop web application, mobile application, enterprise application, desktop based application etc. Everything in Scala is in object...

4 minutes read.

Top 30 Magento Interview Questions for 2024

1) What is Magento? Magento is an open-source content management system. It is used to create e-commerce websites. It is developed by Varien ,Inc, a US private company headquartered in Culver City, California. It...

5 minutes read.

Top 15 ASP.NET MVC Framework Interview Questions for 2024

1) What is ASP.NET MVC Framework? ASP.NET MVC framework is a software architecture pattern for developing web applications. It is used to split the application's implementation logic into three components: models,...

4 minutes read.

Top 30 CSS Interview Questions for 2024

1) Define the process where block elements can be centered with css. It can be centered by using margin-left and margin-right properties we can centered the block level elements. 2) Name the...

4 minutes read.

Top 15 ES6 Interview Questions for 2024

Commonly Asked ES6 Interview Questions and Answers 1) What is ES6? ES6 is a scripting language specification standardized. It is used to enable client-side scripting. The specification is influenced by programming languages (Self, Python, Perl,...

2 minutes read.

Top 15 Haskell Interview Questions for 2024

1) What is Haskell? Haskell is a functional programming language. It is based on mathematical functions. This programming language is more intelligent than other popular programming languages. 2) Who is the developer of...

2 minutes read.

Top 30 Zend Framework Interview Questions for 2024

1) What is Zend Framework? Zend is an open source, object-oriented web application framework. It is implemented in PHP 5. It was developed in 3 March 2006. 2) What is the use...

6 minutes read.

Top 15 CSS Buttons Interview Questions for 2024

1) What is CSS buttons? CSS buttons is used to create awesome button. It provides huge collection of CSS library files. 2) What are the CSS libraries to create buttons? There are following...

5 minutes read.

Top 30 CodeIgniter interview Questions for 2024

1) What is CodeIgniter? CodeIgniter is an open source PHP framework. It is used to develop web applications and websites. It is loosely based on MVC pattern and easy to use...

4 minutes read.

Top 15 Hadoop Interview Questions for 2024

1) What is Hadoop? Hadoop is a framework which is used to store and process Big Data. It is a distributed computing platform and helps in analyzing Big Data. 2) What are the...

2 minutes read.

Top 25 Oracle DBA Interview Question for 2024

1) What is an Oracle Instance? Database instance is a set of memory structures that manages database file. When an instance is started Oracle database allocate memory area called SGA (System...

4 minutes read.

Top 14 Web icon Interview Questions for 2024

1) What is Web Icon? Web Icon is a symbol that is used to represent a specific action or a capability on a webpage. It is used in documents as well...

5 minutes read.

WebSockets Interview Questions

1) What is Web Sockets? Web Sockets is a two way communication between the clients and the servers. Here, the clients and servers both the parties can communicate and exchange data...

3 minutes read.

Top 15 Data structure & Algorithm Interview Questions for 2024

1) What is Data Structure? Data structure is a way of storing, collecting and organizing data into the main memory. It makes data access more efficient and increase performance. Array, List, Queue...

3 minutes read.