Web App Development 2
1. What sequence of commands would you issue to upload and share your new source code in a GitHub repository? You can assume the added code won’t cause a conflict with existing code.
pull, commit, push, add
pull, add, commit, push
push, add, commit, pull
push, commit, add, pull
2. At a high-level, we have two kinds of architecture to consider in web application development: Information Architecture and System Architecture. Which of the follow statements best describes the role of Information Architecture. Information Architecture is concerned with:
The structural design of shared information; the searching and navigation of information; and logical design of the database.
The logical design of the database, the structural design of shared information, and the structural design of the application.
The art and science of shaping the information experiences; designing the wireframes, and building the interface.
The organization and labeling of information, the structure and nature of the application, and building the interface.
3. Building web applications involves an array of challenges and complexities, these include:
The composition of the development team, the immature and legacy technologies, and the low expectations of users.
The lack of an accepted development methodology, the hypertext structure, the homogeneous user populations.
The variety of devices, the simplicity of the HTTP protocol, and the composition of the development team.
The hypertext structure, the demand by users for instant availability, the variety of devices and the different web frameworks.
4. The responsibilities of the middleware include: (select option where all correctly apply):
handle incoming requests from clients, request data from a database, return an html/xml response to the client
handle incoming request from clients, request data from a database, return a html/xml response to the server
handle incoming requests from servers, request data from the client, return an html/xml response to the server
handle incoming requests from clients and servers, request data from server, return a html/xml response to the client and server.
5. When using HTTP, two methods are commonly used. Select the statement that best describes what each method does.
GET appends data to the URL as key-value pairs, POST sends data packaged part of the message
GET sends data packaged as part of the message, POST appends data to the URL as key-value pairs
POST appends data to the URL as key-value pairs, PUSH sends the data as part of the message
PUSH sends the data as part of the message, GET appends data to the URL key-value pairs
6. Asynchronous JavaScript and eXtensible Markup Language (also known as AJAX) is a useful combination of technologies, which enables the web app to: (select the statement that best applies).
make requests without reloading the page, to receive and work with data from the server, using any type data
make requests without reloading the page, to receive and work with data from the server, using only xml data
make requests by reloading the page, to receive and work with data from the server, using any type data
make requests by reloading the page, to receive and work with data from the server, using only xml data
7. Developing web applications typically involves developing distributed applications that run on web browsers. What are the problems and benefits associated with developing applications in such an environment?
low entry barrier to installation, application can be released often, requires session management, and there is no application container model.
control over client application version, easy to update the application, performance issues, and needs to handle a variety of browser/devices.
difficult to tamper with the application, requires session management, no access to local file system, and high barrier to installation.
control over the client application version, flexible user interface, low entry barrier to installation, and application can be released often.
8. Web Application Frameworks have both benefits and drawbacks, which of the following statements best enumerates the benefits and drawbacks:
steep learning curve, enables rapid development, typically poorly documented, and introduces code bloat
Enables rapid development, decreases code bloat, reduces boiler plate code and decreases performance
Enables rapid development, reduces boilerplate code, introduces code bloat, and increased performance
increases reliability, increased security, increased performance, and typically poorly documented
9. Most web application frameworks make use of the Model View Controller architecture (or some variant of). What are the advantages and disadvantages of the MVC architecture. Select the statement that best applies.
decreases the development overheads, requires knowledge of design patterns, provides reusable views, harder to maintain
provides reusable models, but not reusable views, requires knowledge of design patterns, debugging can be problematic
easier to maintain, decreases the development overheads, provides reusable views and models, requires knowledge of design patterns
easier to maintain, helps enforce logical separation of concerns, provides reusable models, debugging can be problematic
10. An N-Tier architecture creates a number of problems for developers, but also provides a number of benefits:
decreases the scalability, decreases the communication costs, and encapsulates the complexity
increases the scalability, increases the communication costs, and encapsulates the complexity
increases the scalability, increases the communication costs, and increases coupling
increases the scalability, decreases the communication costs, and increases coupling
11. CSS stands for:
Cascading Styling Sheet
Cascading Style Sheet
Cascade Style Sheet
Counterstrike Source Sheet
12. Which CSS selector applies to all h2 tags within a class called "yellow":
$yellow h2
h2 #yellow
yellow h2
.yellow h2
13. Which CSS selector applies to all div tags within the ID called "red":
$red div
div #red
red div
red blue
14. This question uses the following code: p {background-color: yellow; border: 1px solid black; } p #blue { background-color: blue; } Given the HTML code shown below how would the element be rendered: <p><p id="blue">Hello World</p></p>
Hello world, with no border and blue background
Hello world with no border and no background color
Hello world with a solid border and blue background
Hello world, with a solid border and a yellow background
15. This question uses the following code: p { background-color: yellow; border: 1px solid black; } p #blue { background-color: blue; } Given the HTML code shown below how would the element be rendered: <p><p class="blue" style="background-color: green">Goodbye World</p></p>
Goodbye world, with border and yellow background
Goodbye world, with no border and green background
Goodbye world with border and green background
Goodbye world with no border and no background color
16. Which line of JQuery code selects the element with a class red and assigns an event to when the element is clicked:
$("#red").onclick()
$(".red").click()
$(".red").onclick()
$("#red").click()
17. Which line of code selects a paragraph element with the class "blue", and assigns a hover event to it, such that on hover the text turns "green", and off hover it turns "red".
$("p#blue").onhover( function() { $(this).css('color', 'green’); }, function() { $(this).css('color', 'red'); });
$("p.blue").onhover( function() { $(this).css('color', ‘green’); }, function() { $(this).css('color', ‘red'); });
$("p#blue").hover( function() { $(this).css('color', ‘green’); }, function() { $(this).css('color', ‘red'); });
$("p.blue").hover( function() { $(this).css('color', 'green’); }, function() { $(this).css('color', ‘red’); };
18. The structure of Uniform Resource Locator structure is as follows:
scheme://domain/path&query_string=val#fragment_identifier
protocol://domain/path&query_string=val #fragment_identifier
scheme://domain/path?query_string=val #fragment_identifier
protocol://domain/path?query_string=val #fragment_identifier
19. REST and SOAP provide different ways for exchanging structured information. However, they both have advantages and disadvantages. Select the statement that best applies.
SOAP and REST are complicated, very verbose, slow and add lots of overheads
SOAP is reliable but very verbose, whereas REST is simple but adds lots of overheads.
SOAP and REST both build upon HTTP, but REST puts the burden on the developer to process the message
SOAP and REST are protocol specific, but SOAP is slow and very verbose
20. What is the role of XML on the web? Select the statement that best describes the role of XML on the web.
to describe semi-structured documents, to be a mechanism for storing annotated data, and to display data
to be mechanism for storing annotated data, to be a mechanism for sharing annotated data, and to be a mechanism for securing annotated data
to be mechanism for storing annotated data, to be a mechanism for sharing annotated data, and to display data
to describe semi-structured documents, to be mechanism for storing annotated data, to be a mechanism for transporting annotated data
21. Which of the following HTML TAGS is used at the start of a list item element?
<ul>
<li>
</li>
<div>
22. What command would you issue to download an existing GitHub repository (that you have not downloaded before)?
clone
push
pull
rebase
23. Which of the following design philosophies does Django adhere to?
Don’t repeat yourself
Implicit is better than explicit
Tight coupling
All of the above
24. Suppose that Question is a model that is used to represent a multiple-choice question. Which of the following commands will print a list of the Question objects that are stored in the database?
print Question.objects.all()
print Question.objects.list()
print Question.objects.filter()
print Question.objects.get()
25. Suppose that the following URLconf is added to urls.py in the mysite project:url(r'^polls/',include('polls.urls')),What happens when the user navigates to https://wad2.pythonanywhere.com/polls/extra?
Django tries to match "extra" in polls/urls.py
Django automatically issues a 404 error
Django tries to match “polls/extra†in polls/urls.py
Django passes control over to a view called “pollsâ€
26. What effect does the following URLconf have?url(r'^(?P<question_id>[0-9]+)/results/$', views.results, name='showresults')
A URL ending “35/results/†will map to the results view, with “35†being stored in the variable “question_idâ€
A URL ending “?P35/results/†will map to the showresults view, with “35†being stored in the variable “question_idâ€
A URL ending “35/results/†will map to the showresults view, with “35†being stored in the variable “resultsâ€
A URL ending “3+/results/†will map to the results view, with “3+†being stored in the variable “resultsâ€
27. Suppose that a view wishes to pass on a variable to a template, which should display the value of the variable. How should the view do this?
Call the render function, passing the request object, the template name and a context dictionary containing the variable and its value
Call the request function, passing the render object, the template name and the variable name
Call the HttpResponseRedirect function, passing the template name and the variable name
Call the HttpResponse function, passing the template name and the variable name
28. Which of the following is not an assertion from the class Django.Test.Testcase?
assertContains
assertQuerysetEqual
assertBool
assertEqual
29. Which of the following are good strategies for creating tests in Django?
Create a separate testing class for each model and view
All of the above
Don’t worry about tests that become redundant
Write a test for a view before creating a view
30. Which option from the following list best describes a 1-tier architecture?
Difficult to design but scalable
Easy to design but not scalable
Difficult to design but easy to maintain
Easy to design and good for web applications
31. Building web applications involves an array of challenges and complexities; these include:
The lack of an accepted development methodology, the hypertext structure and the homogeneous user populations
The variety of devices, the simplicity of the HTTP protocol and the composition of the development team.
The hypertext structure, the demand by users for instant availability, the variety of devices and the different web frameworks
The composition of the development team, the immature and legacy technologies and the low expectations of users
32. Which of the following are HTTP methods for sending data?
PUSH and GET
CONNECT and POST
CONNECT and PUT
GET and POST
33. Which of the following are good choices of URL? Choose all that apply.
http://search.autotrader.co.uk/es-uk/www/cars/FORD+KA/Ne-2-4-5-6-7-8-27-44-49-53-61-64-67-103-133-146,N-19-29-4294966844-4294967194/advert.action?
http://bling.com/blog/2011/05/20/full/text/gold?chains
http://www.technorati.com/technology/gadgets/
http://mobile.yahoo.com/onesearch;_ylt=AjpRL9DUfGFuHlra8WMMmjdWtQcJ
http://www.expertsexchange.com
34. What are the main components of Entity-Relationship diagrams?
Entities, Relationships and Types
Models, fields and connectors
Tables, primary keys and fields
Entities, Relationships and Attributes
35. Consider the following ER Diagram:
What line of code should be in the Course model?
students = models.PrimaryKey(Student)
students = models.OneToOneField(Student)
students = models.ManyToManyField(Student)
students = models.ForeignKey(Student)
36. Consider the following HTML and CSS code:
How will "Test message" be displayed?
Black border, black text and white background
No border, red text and white background
Black border, red text and white background
No border, black text and blue background
37. Consider the following HTML and CSS code:
How will "WAD2" be displayed?
Coloured red with no border
Coloured yellow with a black border
Coloured red with a green border
Coloured blue with a green border
38. Consider the following HTML and JavaScript code:
What will the document.write method print out?
WAD2
para
null
yellow
39. In the example event handling web page involving 5 nested div blocks, how many event listeners are triggered when the user clicks on the div block labelled 5?HTML:
JS:
2
10
1
5
40. Consider the following HTML and JavaScript code:
What should be inserted at point *****?
document.getElementByTagName(‘para’).value = Date()
document.getElementById(‘#para’).innerHTML = Date()
document.getElementById(‘.para’).value = Date()
document.getElementById(‘para’).innerHTML = Date()
41. Consider the following JavaScript code:
What will be returned if getReturnVal() is called?
null
false
true
undefined
42. What is the correct jQuery code to set the background colour of all p elements to red?
$("p").style("background-color", "red");
$("p").css("background-color", "red");
$("p").layout("background-color", "red");
$("p").manipulate("background-color","red");
43. Which of the following XML fragments is well-formed?
<car registration=â€ABC123â€><owner>John Smith</owner><postcode=â€G1 1XYâ€></car>
<car registration=â€ABC123â€><owner>John Smith</owner></car>
<car registration=â€ABC123â€></address><postcode=â€G1 1XYâ€/></car>
<car registration=â€ABC123â€><address/><owner>John Smith</owner><postcode=â€G1 1XYâ€/></car>
44. Consider the XHTML code below. Is it well-formed?
<comedy answer>
All of the above
No
Yes
45. Asynchronous JavaScript and eXtensible Markup Language (also known as AJAX) is a useful combination of technologies, which enables a web app to (select the statement that best applies):
make requests without reloading the page, to receive and work with data from the server, using only XML data
make requests without reloading the page, to receive and work with data from the server, using XML, JSON and plain text data
make requests by reloading the page, to receive and work with data from the server, using only XML data
make requests by reloading the page, to receive and work with data from the server, using XML, JSON and plain text data
46.
Consider the above HTML and JavaScript code contained in Parser.html. What text will be displayed when Parser.html is opened in a browser?
All contents of the variable text
"title"
None
"Everyday Italian"
47. Which of the following statements best describes the differences between a DOM parser and a SAX parser?
DOM uses less memory, SAX tends to be slower, DOM is harder to code
DOM uses more memory, SAX tends to be slower, DOM is easier to code
DOM uses more memory, SAX tends to be faster, DOM is easier to code
DOM uses less memory, SAX tends to be faster, DOM is harder to code
48. When using HTTP, two communication methods are commonly used. Select the statement that best describes what each method does.
POST appends data to the URL as key-value pairs, PUSH sends the data as part of the message
GET appends data to the URL as key-value pairs, POST sends data packaged as part of the message
GET sends data packaged as part of the message, POST appends data to the URL as key-value pairs
PUSH sends the data as part of the message, GET appends data to the URL as key-value pairs
49. Web Application Frameworks have both benefits and drawbacks. Which of the following statements best describes the benefits and drawbacks:
enables rapid development, decreases code bloat, reduces boiler plate code and decreases performance
enables rapid development, reduces boilerplate code, introduces code bloat, and increased performance
steep learning curve, enables rapid development, typically poorly documented, and introduces code bloat
increases reliability, increased security, increased performance, and typically poorly documented
50. Most web application frameworks make use of the Model View Controller design pattern (or some variant of this). What are the advantages and disadvantages of the MVC pattern? Select the statement that best applies:
provides reusable models, but not reusable views, requires knowledge of design patterns, debugging can be problematic
easier to maintain, decreases the development overheads, provides reusable views and models, requires knowledge of design patterns
decreases the development overheads, requires knowledge of design patterns, provides reusable views, harder to maintain
easier to maintain, helps enforce logical separation of concerns, provides reusable models, debugging can be problematic
51. What sequence of commands would you issue to upload and share your code in a GitHub repository? You can assume the added code wont cause a conflict with existing code.
pull commit push add
push commit add pull
push add commit pull
pull add commit push
52. The typical architecture of a web application follows a:
Model View Controller
Three Tier architecture
Model View Template
Two tier architecture
53. What design pattern does the django web application use:
Model View Template Pattern
Model View Controller Pattern
Factory Pattern
Subject Observer Pattern
54. An overriding principle when design web applications is:
separation of concerns
separation of content
keep’em separated
concerns separation
55. The responsibilities of the middleware include: (select option where all correctly apply):
handle incoming requests from clients, request data from a database, return an html/xml response to the client
handle incoming requests from servers, request data from the client, return an html/xml response the server
handle incoming requests from clients and servers, request data from server, return a html/xml response to the client and server.
handle incoming request from clients, request data from a database, return a html/xml response to the server
56. What does HTTP stand for?
Hyper Text Transfer Process
Hyper Text Transfer Protocol
The good of all internet citizens
Hyper Text The Protocol
57. The two most frequently used in HTTP requests are:
FETCH and POST
PUSH and GET
PUSH and PULL
GET and POST
58. Which problem does HTTP suffer from:
statuslessness, maintains no status
statelessness, maintains no state
statefulness, maintains state
entomophobia, fear of being crawled
59. AJAX stands for:
Asynchronous JavaScript and eXtensible Makeup Language
Asynchronous Java and Extensible Markup Language
Asynchronous JavaScript and eXtensible Markup Language
Amsterdam Football club
60. AJAX enables us to (Select the option where all statements apply):
make requests without reloading the page, to receive and work with data from the server, using any type data
make requests by reloading the page, to receive and work with data from the server, using any type data
make requests by reloading the page, to receive and work with data from the server, using only xml data
make requests without reloading the page, to receive and work with data from the server, using only xml data
61. CSS stands for:
Cascading Style Sheet
Cascading Styling Sheet
Counterstrike Source Sheet
Cascade Style Sheet
62. Which selector applies to all tags with a class called blue and are paragraph elements:
#blue p
$blue p
blue p
.blue p
63. Which selector applies to all tags with the ID called blue and are div elements:
div #blue
$blue div
blue div
div blue
64. The following code applies to the following question: p { background-color: yellow; border: 1px solid black; } p .blue { background-color: blue; } Given the HTML code shown below how would the element be rendered: <p id=“blueâ€>Hello World
Hello world with no border and no background color
Hello world, with no border and blue background
Hello world with a solid border and blue background
Hello world, with a solid border and a yellow background
65. The following code applies to the following question: p { background-color: yellow; border: 1px solid black; } p .blue { background-color: blue; } Given the HTML code shown below how would the element be rendered: <p style=“background-color: greenâ€>Goodbye World
Goodbye world, with no border and green background
Goodbye world with border and green background
Goodbye world, with border and yellow background
Goodbye world with no border and no background color
66. By referencing the Javascript as follows in the HTML is an example of:<head><link type="text/javascript" href="broken.js"></head>
external referencing
online referencing
inline referencing
embedded referencing
67. Assume that user has visited the site on previous occasions, and within the HTML on the site a piece of Javascript is referenced as follows: <head> <link type="text/javascript" href="notbroken.js"> </head> Select the option, where all apply:
page load times will be faster, content is separated from style, difficult to maintain
page load times will be slower, content is separated from style, easy to maintain
page load times will be slower, content is separated from style, difficult to maintain
page load times will be faster, content is separated from style, easy to maintain
68. Which line of JQuery code selects the element with a class brown and assigns an event to when the element is clicked:
$(“.brownâ€).click( )
$(“.brownâ€).onclick( )
$(“#brownâ€).onclick( )
$(“#brownâ€).click( )
69. Which line of code selects a paragraph element, and assigns a hover event to it, such that on hover the text turns blue, and off hover it turns red.
$("p").hover( function() { $(this).css('color', 'red’); },</br> function() { $(this).css('color', 'blue'); };
$("p").hover( function() { $(this).css('color', ‘blue’); },</br> function() { $(this).css('color', ‘red'); });
$("pâ€).onhover( function() { $(this).css('color', 'red’); },</br> function() { $(this).css('color', 'blue'); });
$("pâ€).onhover( function() { $(this).css('color', ‘blue’); },</br> function() { $(this).css('color', ‘red'); });
70. When writing JQuery code, it should be encapsulated by:
$().ready(function() {</br> // JQuery code to be added in here.</br> });
$(document).onready(function() {</br> // JQuery code to be added in here.</br> });
$().onready(function() {</br> // JQuery code to be added in here.</br> });
$(document).ready(function() {</br> // JQuery code to be added in here.</br> });
Submit Quiz