1. How does PhantonJS use YSlow?
c) Command Line Prompt
d) Command Line Script
Explanation: YSlow for PhantomJS is a command line script that allows page performance analysis from live URLs, unlike YSlow for Command Line (HAR) where a pre-generated HAR file is needed in order to analyze page performance.
2. What are the two output formats YSlow uses?
a) TAP, JUnit
b) JIT, TRD
c) JKP, RFD
d) TIP, KIT
Explanation: YSlow for PhantomJS is a command line script that allows page performance analysis from live URLs. YSlow for PhantomJS introduces new output formats for automated test frameworks: TAP (Test Anything Protocol) and JUnit.
3. Initially, YSlow was an extension of which browser?
Explanation: Initially, YSlow was an extension of Firefox. YSlow for Firefox needs Firebug to run.
4. Which of the following can be used for a deeper analysis of the web page’s performance?
d) WebPageTest & FireBug
5. How many rules are there in the YSlow version 2.0?
Explanation: There are totally 23 rules in the ruleset of YSlow (V2) namely :
- Minimize HTTP Requests
- Use a Content Delivery Network
- Avoid empty src or href
- Add an Expires or a Cache-Control Header
- Gzip Components
- Put StyleSheets at the Top
- Put Scripts at the Bottom
- Avoid CSS Expressions
- Reduce DNS Lookups
- Avoid Redirects
- Remove Duplicate Scripts
- Configure ETags
- Make AJAX Cacheable
- Use GET for AJAX Requests
- Reduce the Number of DOM Elements
- No 404s
- Reduce Cookie Size
- Use Cookie-Free Domains for Components
- Avoid Filters
- Do Not Scale Images in HTML
- Make favicon.ico Small and Cacheable
6. Which of the following is mandatory to run before running YSlow?
c) Both WebPageTest and FireBug
7. How does the YSlow for Mobile work as?
8. Which network allows you to distribute static assets like images, etc?
a) Content Delivery Network
b) Content Receiving Network
c) System Area Network
d) Local area network
9. What are the three important manipulations done in a for loop on a loop variable?
a) Updation, Incrementation, Initialization
b) Initialization,Testing, Updation
c) Testing, Updation, Testing
d) Initialization,Testing, Incrementation
Explanation: In a for loop, the initialization, the test, and the update are the three crucial manipulations of a loop variable. Firstly the variable is created then it’s first tested then updated.
let succ = function(x) x+1, yes = function() true, no = function() false;
What convenience does the above code snippet provide?
a) Functional behaviour
b) Modular behaviour
c) No convenience
d) Shorthand expression
Explanation: The functions defined in this way behave exactly like functions defined with curly braces and the return keyword. The functions can be defined in a shorthand expression.