×

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 30 TypeScript Interview Questions for 2024

1) What is TypeScript? TypeScript is an object-oriented and compiled language. TypeScript is also known as a set of tools. TypeScript is used for application-scale development. 2) What are the features of TypeScript? Features of...

4 minutes read.

Top 15 Java Multithreading Interview Questions for 2024

1) What is Multithreading in Java ? It is a process of executing multiple threads simultaneously. It is used to achieve multitasking. It is mostly used in animation and games etc. 2) What are...

4 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 15 Ext Js Interview Question for 2024

1) What is Ext Js? Ext Js refers to Extended JavaScript. Ext JS is a JavaScript framework used to built interactive cross platform web application. 2) What are the features of Ext...

3 minutes read.

Top 15 MATLAB Interview Questions for 2024

1) What is MATLAB? MATLAB (matrix laboratory) is fourth-generation programming language. It allows matrix manipulations, implementations of algorithm and many more. 2) Who developed MATLAB? MATLAB is developed by MathWorks. 3) In which language...

2 minutes read.

Top 15 T-SQL(Transact-SQL) Interview Questions for 2024

1) What is T-SQL? T-SQL stands for Transact Structured Query Language. T-SQL is the extension of SQL functionality supported by Microsoft SQL Server and Sybase ASE. 2) What are the features of...

3 minutes read.

Top 20 Java Programming Coding Interview Questions for 2024

Coding is an integral part of any programming language. It is the most important phase of an interview. Interviewee checks the capability of thinking of any particular. I think one...

13 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 20 C Programming | Coding Interview Questions for 2024

Most Frequently asked C programming | Coding Interview Questions and answer for Fresher C is a powerful high-level programming language.  It is a fast, portable and available for all platforms. C...

15 minutes read.

Top 15 JSP Interview Questions for 2024

1) What is JSP? It is a technology which is used to create web application like Servlet technology. It provides more functionality than Servlet. It consists of HTML and JSP tags. 2) What are...

3 minutes read.

Top 16 Arduino Interview Questions for 2024

1) What is Arduino? Arduino is an open source electronic platform. It is based on easy-to-use hardware and software. It able to read input signal. It is used to write and...

2 minutes read.

Polymer.js Interview Questions

1) What is Polymer.js? Polymer.js is an open source JavaScript library. It is developed by Google. It is used to develop web applications for using of web components like HTML. 2) Describe...

3 minutes read.

Top 15 iOS (iPhone, iPad) Interview Questions for 2024

Top 20 Most Frequently asked iOS Interview Questions and Answers 1) What is iOS? iOS is a mobile operating system developed by Apple Inc. iOS offers iPhone and iPad application development using...

3 minutes read.

Top 25 jQuery Interview Questions for 2024

Most Frequently asked jQuery Interview Questions and Answers for Fresher and Experienced 1) Define Find and Children Method? In DOM tree if you have to find all the method we use Find...

4 minutes read.

Top 15 VBA Interview Questions for 2024

1) What is VBA? VBA stands for Visual Basic Application. It is an event-driven programming language. It is mainly used with Microsoft Office applications such as MS -Excel, MS-Word and MS-Access. 2)...

3 minutes read.

Top 19 Google Maps Interview Questions for 2024

1) What is Google Maps? Google Maps is a web-based service developed by Google. It contains geographical information and provides routes and information to the client. 2) What are the features provided...

5 minutes read.

Top 30 DBMS Interview Questions for 2024

1) What is DBMS? DBMS (Data Base Management System) is a technology for managing data of database i.e. Create, Update, Delete, Alter. 2) What is a Database System? It is defined as collection...

4 minutes read.

Top 14 Materialize CSS Framework Interview Questions for 2024

1) What is Materialize? Materialize is a CSS framework that contains library file. It is created with CSS, JavaScript and HTML. It helps to create attractive, reliable and functional web pages...

7 minutes read.

Top 30 PyTorch Interview Questions and Answers

Q1: What is PyTorch? Answer: PyTorch is a machine learning library for the programming language Python, based on Torch library, used for application such as natural language processing. It is free...

9 minutes read.

Top 30 Less Interview Questions for 2024

1) What is Less? Less is a dynamic style sheet language that can be compiled in to CSS (Cascading style Sheet). It runs on client side and server side. It is...

4 minutes read.