Top Content Delivery Network (CDN) Interview Questions (2021) | CodeUsingJava
















Most frequently Asked Content Delivery Network (CDN) Interview Questions


  1. What is a CDN?
  2. What are the kinds of CDN based on how the content is cached and refreshed?
  3. Are all Content Delivery Networks equal?
  4. What kind of hardware does the CDN use?
  5. How to create a CDN?
  6. What are the three fields used in CDN?
  7. What is an Origin Server?
  8. How can we force CloudFront distribution/file update?
  9. How can we load Bootstrap from CDN with Require.js?
  10. How can we import an externally hosted file with sass?

What is a CDN?

CDN(Content Delivery Network) helps in serving content from locations closest.CDN serves Static Content Files and Pre-generated Files like CSS, HTML, JS, etc. It is also involved in serving Dynamic Content such as rich media.
CDN is used for improving the performance by reducing Latency, and loading on the servers that are also reduced when we do not have to serve the content.

What are the kinds of CDN based on how the content is cached and refreshed?

CDN
  • Push CDN - It is used for pushing CDN Cache Server when the content is modified and is responsible for pushing the content to the CDN Cache Servers.
  • Pull CDN - Pull CDN is used for pulling CDN from the origin server and is stored in the Cache Servers fro a period of time.

Are all Content Delivery Networks equal?

The CDN we choose matters as the performance will be depending on our chosen provider, the content we cache in our CDN, and the distance through our Cache Server and our Users.

What kind of hardware does the CDN use?

CDN uses powerful hardware that is used for building the network it can offer the company a better page load speed and performance. It can also increase the speed of Cloud Services and provide maximum Bandwidth for the delivery to the users. It involves placing the data which is choosing Locations and Caching.

We can create a CDN by using the following steps:
Logging in to our Azure Management Portal.
Clicking on "New" at the bottom left corner.
Selecting "App Services" then "CDN".
Clicking on "Quick Create".
Choosing options from the dropdown and click on "Create".

What are the three fields used in CDN?

CDN
  • Subscription - By using subscription we can choose one option in the subscription dropdown.
  • Origin Type - Helps in integrating service that can have options of Web Apps, Media Services, and Storage.
  • Origin URL - This helps by showing URLs which are based on the origin type.

What is an Origin Server?

Origin Server is used in the processing and responding to incoming internet requests from Internet Clients. It is used in conjunction with an edge server or caching server. It can also be designed for listening and processing incoming interner requests. It also takes responsibility for serving the content for an internet property like a Website.

How can we force CloudFront distribution/file update?

We can force cloudfront file by using the following command:
POST /2010-08-01/distribution/[distribution ID]/invalidation HTTP/1.0
Host: cloudfront.amazonaws.com
Authorization: [AWS authentication string]
Content-Type: text/xml

<InvalidationBatch>
   <Path>/image1.jpg</Path>
   <Path>/image2.jpg</Path>
   <Path>/videos/movie.flv</Path>
   <CallerReference>my-batch</CallerReference>
</InvalidationBatch>


How can we load Bootstrap from CDN with Require.js?

We can load Bootstrap from CDN with Require.js by using the following command:
requirejs.config({
    appDir: ".",
    baseUrl: "js",
    paths: {
        /* Load jquery from google cdn. On fail, load local file. */
        'jquery': ['//ajax.googleapis.com/ajax/libs/jquery/2.0.3/jquery.min', 'libs/jquery-min'],
        /* Load bootstrap from cdn. On fail, load local file. */
        'bootstrap': ['//netdna.bootstrapcdn.com/bootstrap/3.0.2/js/bootstrap.min.', 'libs/bootstrap-min']
    },
    shim: {
        /* Setting bootstrap dependencies */
        'bootstrap' : ['jquery']
    }
});

require(['jquery', 'bootstrap'], function($) {
    console.log("Loaded :)");    
    return {};
});


How can we import an externally hosted file with sass?

We can import an externally hosted file with sass by using the following command:
styles.scss
@import url(https://maxcdn.bootstrapcdn.com/bootstrap/latest/css/bootstrap.min.css);