Schedule a 30 minute appointment with a client advisor today. Start
Engineering, Design, Marketing, and More

Backbone.js interview questions

The most popular questions

Use our complementary questions and answers to filter and hire the best. Questions crowdsourced by our clients, answers by Punch. We provide these complementary questions to help our clients more quickly create tests for potential hires at their organizations.

Get a question answered
Punch offers four divisions of services: design, engineering, staffing, and demand

Interview questions for your next interview

Question
Explain what is Backbone.js?
Answer
Backbone.js is a JavaScript client-side (front end) framework, which helps to organize and manage your code and makes it simpler to develop single page applications. It allows you to structure JavaScript code in an MVC (Model, View, Controller) fashion
  • Model: It is a part of your code that inflates and retrieves the data
  • View: It is the HTML representation of this model
  • Controller: It enables you to save your javascript application via a hashbang URl
Question
Why you have to use Backbone.js? Advantages?
Answer
By using JavaScript with the minimal set of data-structuring (models & collections) and user interface (views & URLs) it enables you to develop a web application

Backbone.js is best useful to develop 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

Provides key value binding and custom events

API with tons of functions

Robust event handling

API connection over a RESTful JSON interface

Find developers today

Hire a Punch engineer

Punch offers four divisions of services: design, engineering, staffing, and demand. Our four divisions form the core of our People Forward Approach.

Contact us
Find developers today
Question
What are the three js files that are required to setup a working environment for Backbone.js?
Answer
You are required following three js files to setup a working environment for Backbone.js
  • jQuery
  • Backbone.js
  • Underscore
In your application put these files within js folder and use it in your index.html page.
Question
What is ModelBinder in Backbone.js?
Answer
The ModelBinder class is used to make synchronization process of views and models together.
Question
What is the most powerful capabilities of the ModelBinder?
Answer
The most powerful and useful capability of ModelBinder class is that ModelBinder allows you to define scope when you create your bindings using jQuery.

If your views are simple, you can rely on default scoping rules that are based off of the html “name” attribute.

You can define scoping with jQuery selectors if your views are complex.
Question
What is the difference between the properties “id” and “cid” on a model object?
Answer
The “id” property on a model is automatically assigned based on the “id” set in the model’s attributes hash. Ideally, this is the ID that you receive from the rest API for the resource that you are querying. On the other hand, “cid” is an ID temporarily assigned to each model and is useful until an actual ID is determined for the object. For example, a model pushed to a collection that has not yet been persisted can be addressed using “cid”, until it is saved in the database and an actual ID is generated for it.
Question
What is the function of parse in Backbone.js?
Answer
Whenever data of a model is returned by the server while fetching or storing, this data is called parse. It is called by Backbone whenever a collection's models are returned by server.
Question
Mention what are the typical problems you might face with the Backbone view code?
Answer
  • Application models do not change very often
  • Application pages are frequently refreshed from scratch from the server
  • Between different view models are not shared
Question
What is Backbone.sync used for?
Answer
When Backbone wants to save or read a model to the server it calls out a function called as Backbone.sync.
Question
In a Backbone View, what is the use of setElement?
Answer
setElement function is used when Backbone view has to be applied to a different DOM element.

Ask a question

Ask a question, and one of our engineers will answer it.

We keep our questions nice and simple to be useful for everyone, and we may not answer or publish every question.

Your number is stored privately and never shared.
By submitting a question, you agree to our terms.
Request sent. Thank you!
Send another one