Monthly Archives: November 2018

WHAT ARE TEMPLATE LITERALS IN HTML5?

What are template literals in HTML5?

Template literals are enclosed by the back-tick (` `)

Template literals can contain placeholders. These are indicated by the dollar sign and curly braces (${expression}). The expressions in the placeholders and the text between them get passed to a function.

In order to embed expressions within normal strings, you can use the following syntax:

var a = 5;
var b = 10;
console.log(‘Fifteen is ‘ + (a + b) + ‘ and\nnot ‘ + (2 * a + b) + ‘.’);
// “Fifteen is 15 and
// not 20.”

Now, with template literals, you are able to make use of the syntactic sugar making substitutions like this more readable:

var a = 5;
var b = 10;
console.log(`Fifteen is ${a + b} and
not ${2 * a + b}.`);
// “Fifteen is 15 and
// not 20.”

Nesting Templates:

In certain times, nesting a template is the easiest and perhaps more readable way to have configurable strings. Within a backticked template it is simple to allow inner backticks simply by using them inside a placeholder ${ } within the template. For instance, if condition a is true: then return this templated literal.

EXPLAIN IN WINDOWS DNS SERVER WHAT IS PRIMARY, SECONDARY, AND STUB ZONE?

Explain in windows DNS server what is Primary, Secondary, and Stub zone?

In windows DNS server,

Primary Zone: In this, the file is saved as normal text file with filename (.dns).

Secondary Zone: It maintains a read-only copy of zone database on another DNS server. Also, it acts as a back-up server to the primary server by providing fault tolerance and load balancing.

Stub Zone: It consists of a copy of name server and SOA records which is used for reducing the DNS search orders.

EXPLAIN WHAT IS THE DIFFERENCE BETWEEN A THREAD AND A COMPUTER PROCESS?

Explain what is the difference between a thread and a computer process?

Computer Process: In computing, a process is an instance of a computer program that is executed sequentially by a computer system which can run several computer programs concurrently.

Thread: A thread is a several executable program that work together as a single process. For instance, one thread might send an error message to the user; another might handle error signals while the third thread might be executing the original action.

WHAT IS PAGE SPEED AND WHY DOES IT MATTER?

What is page speed and why does it matter?

Page speed refers to how fast your site loads for a user, something Google takes into account while ranking websites since a faster loading page directly translate to better user experience. If the interviewer asks what you would do to increase page speed, describe how you’ve achieved this in the past with examples such as reducing image sizes, enabling compression, reducing redirects, removing render-blocking JavaScript, leveraging browser caching, improve server response time, using a content distribution network to compress files, optimizing the code etc.

WHAT IS SPECIFICITY IN CSS3?

What is Specificity in CSS3?

The CSS Specificity is one of the most difficult concepts to grasp in Cascading Stylesheets. The different weight of selectors is usually the reason why CSS-rules don’t apply to some elements, although they should have.

  1. Specificity determines, which CSS rule is applied by the browsers.
  2. Every selector has its place in the specificity hierarchy.
  3. If two selectors apply to the same element, the one with higher specificity wins.
  4. There are four distinct categories which define the specificity level of a given selector: inline styles, IDs, classes, attributes, and elements.

How to measure specificity?

“Start at 0, add 1000 for style attribute, add 100 for each ID, add 10 for each attribute, class or pseudo-class, add 1 for each element name or pseudo-element. So in the specificity value would be 122 (0,1,2,2 or 0122): 100 for #content, 10 for .data, 10 for :hover, 1 for body and 1 for img.”