Front End Developer

  Home  GUI  Front End Developer


“Front End Programmer based Frequently Asked Questions by expert members with experience as Front End Developer. These questions and answers will help you strengthen your technical skills, prepare for the new job test and quickly revise the concepts”



67 Front End Developer Questions And Answers

43⟩ Tell me how to optimize the page using front end code or technology?

Below is the list of best practices for front-end technology, which helps to optimize page.

1. Improve server response by reducing resource usage per page

► Combine all external CSS files into one file

► Combine all external JS files into one file

2. Use responsive design instead of making device based redirects

3. Use asynchronous Javascript and remove block level Javascript

4. Use Minify version of stylesheet and javascript.

5. Optimize Image and use correct format of Image. Use the lazy loading design pattern for large size of images.

6. Use browser side cache with Cache control

7. Avoid plugins to drive functionality

8. Configure view port and use CSS best practices

9. Prioritize visible content

10. Load style-sheets in header and script in footer.

 218 views

44⟩ Tell us the purpose of each of the HTTP request types when used with a RESTful web service?

The purpose of each of the HTTP request types when used with a RESTful web service is as follows:

☛ GET: Retrieves data from the server (should only retrieve data and should have no other effect).

☛ POST: Sends data to the server for a new entity. It is often used when uploading a file or submitting a completed web form.

☛ PUT: Similar to POST, but used to replace an existing entity.

☛ PATCH: Similar to PUT, but used to update only certain fields within an existing entity.

☛ DELETE: Removes data from the server.

☛ TRACE: Provides a means to test what a machine along the network path receives when a request is made. As such, it simply returns what was sent.

☛ OPTIONS: Allows a client to request information about the request methods supported by a service. The relevant response header is Allow and it simply lists the supported methods. (It can also be used to request information about the request methods supported for the server where the service resides by using a * wildcard in the URI.)

☛ HEAD: Same as the GET method for a resource, but returns only the response headers (i.e., with no entity-body).

☛ CONNECT: Primarily used to establish a network connection to a resource (usually via some proxy that can be requested to forward an HTTP request as TCP and maintain the connection). Once established, the response sends a 200 status code and a "Connection Established" message.

 220 views

45⟩ Tell me why do we need to use W3C standard code?

The goals of such standards are to ensure cross-platform compatibility and more compact file sizes. The focus of these standards has been to separate "content" from "formatting" by implementing CSS. It eases maintenance and development.

 222 views

46⟩ What is a float?

Floats are used to push elements to the left or right, so other elements wrap around it.

 210 views

47⟩ How to clear a floated element?

A floated element is taken out of the document flow. To clear it you would need to do a clear:both or try overflow:auto on the containing div.

 217 views

49⟩ What is event delegation?

Event delegation allows you to avoid adding event listeners for specific nodes. Instead, you can add a single event listener to a parent element.

 205 views

50⟩ Explain what event bubbling is?

Event bubbling causes all events in the child nodes to be automatically passed to its parent nodes. The benefit of this method is speed because the code only needs to traverse the DOM tree once.

 195 views

51⟩ Explain what is an anonymous function?

Anonymous functions are functions without a name. They are stored in a variable and are automatically invoked (called) using the variable name.

var x = function(a, b) {

console.log(a * b)

}

x(3, 5); // 15

 213 views

52⟩ Explain what is AJAX? Write an AJAX call?

AJAX stands for asynchronous JavaScript and XML and allows applications to send and retrieve data to/from a server asynchronously (in the background) without refreshing the page. For example, your new Gmail messages appear and are marked as new even if you have not refreshed the page.

 185 views

53⟩ Explain why table-less layout is very important?

There are several reasons why web designers should stop using tables for layouts, and adopt the use of CSS for controlling HTML layouts.

1) It adheres to current W3C web standards and it improves accessibility of the information to a wider variety of users, using a wide variety of user agents.

2) There are bandwidth savings as large numbers of semantically meaningless <table>, <tr> and <td> tags are removed from dozens of pages leaving fewer, but more meaningful headings, paragraphs and lists.

3) Layout instructions are transferred into site-wide CSS stylesheets, which can be downloaded once and cached for reuse while each visitor navigates the site.

4) If coded well, CSS makes it easy to apply global changes to the layout

5) Web pages often have less code, and are much thinner when XHTML and CSS are used

6) Sites may become more maintainable as the whole site can be restyled or re-branded in a single pass merely by altering the mark-up of the specific CSS, affecting every page which relies on that stylesheet.

7) New HTML content can be added in such a way that consistent layout rules are immediately applied to it by the existing CSS without any further effort.

 202 views

58⟩ Do you know what is CORS? How does it work?

Cross-origin resource sharing (CORS) is a mechanism that allows many resources (e.g., fonts, JavaScript, etc.) on a web page to be requested from another domain outside the domain from which the resource originated. It's a mechanism supported in HTML5 that manages XMLHttpRequest access to a domain different.

CORS adds new HTTP headers that provide access to permitted origin domains. For HTTP methods other than GET (or POST with certain MIME types), the specification mandates that browsers first use an HTTP OPTIONS request header to solicit a list of supported (and available) methods from the server. The actual request can then be submitted. Servers can also notify clients whether "credentials" (including Cookies and HTTP Authentication data) should be sent with requests.

 209 views