Example Questions Given Flashcards

1
Q

Can you explain the box model in CSS?

A

A box in CSS consists of a content area, which is where any text, images, or other HTML elements are displayed. This is optionally surrounded by padding, a border, and a margin, on one or more sides. The box model describes how these elements work together to create a box as displayed by CSS.

Content: image, text, other media
Padding: space around content
Border: border area surrounding padding and content
Margin: Margin is transparent.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

How would you optimize the performance of a web page?

A

Clean HTML, proper CSS (top) and JS (bottom) placements, Optimize CSS, Reduce external HTP request (extra images, JS, CS, plug ins), Minify CSS, JS, and HTML, enable prefetching (rel=”prefetch”, rel=”dns-prefetch”, or rel=”prerender”), increase speed with a CDN and caching, compress your files, optimize images, minimalistic framework.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

What are some differences between inline and block elements in HTML?

A

Inline elements never start from a new line. Block elements cover space from left to right as far as it can go. Inline elements only cover the space as bounded by the tags in the HTML element. Block elements have top and bottom margins.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

How do you handle responsive design and make a website mobile-friendly?

A

The Viewport Meta Tag to Identify a Mobile Website, CSS Media Queries for Different Screen Sizes and Orientations, Horizontal Scrolling with Overflow Scroll, Responsive Images and Videos.

Also, The Flexbox Layout (Flexible Box) module provides a more efficient way to lay out, align and distribute space among items in a container, even when their size is dynamic (hence the word “flex”).

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

Explain the concept of event delegation in JavaScript.

A

Event delegation in JavaScript is a pattern that efficiently handles events. Events can be added to a parent element instead of adding to every single element. It refers to the process of using event propagation (bubbling) to handle events at a higher level in the DOM than the element on which the event originated.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

How would you handle cross-browser compatibility issues?

A
  1. Validate HTML and CSS (HTML/CSS validator) (JS Lint)
  2. Maintain Layout Compatibility (viewport meta tag and flex box and grid)
  3. Use CSS Resets (CSS reset style sheet (GitHub based normalize.css)
  4. Provide Support for Basic Features of the Application
  5. Check JavaScript Issues to avoid the Cross-Browser compatibility issues
  6. Check DOCTYPE tag
  7. Test on Real Devices to Avoid Cross-Browser Compatibility Issues
  8. Use Frameworks and Libraries that Support Cross-Browser Compatibility (React and Bootstrap)
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

What are some techniques for improving website accessibility?

A
  1. Include People with Disabilities in the Design Process.
  2. Use Alt Tags.
  3. Choose Your Font Wisely.
  4. Choose an Accessible Color Palette.
  5. Make Navigation Seamless.
  6. Create Subtitles and Transcripts.
  7. Make Links Descriptive.
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

Can you describe the purpose of CSS preprocessors and provide examples?

A

A CSS preprocessor is a program that lets you generate CSS from the preprocessor’s own unique syntax. There are many CSS preprocessors to choose from, however most CSS preprocessors will add some features that don’t exist in pure CSS, such as mixin, nesting selector, inheritance selector, and so on. (SASS and Stylus)

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

How would you implement animations or transitions in CSS?

A

To make a CSS animation, you need three things: an HTML element to animate, a CSS rule which binds the animation to this element, and a group of keyframes that defines the styles at the start and end of the animation.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

What is the difference between localStorage and sessionStorage in JavaScript?

A

sessionStorage is similar to localStorage ; the difference is that while data in localStorage doesn’t expire, data in sessionStorage is cleared when the page session ends. Whenever a document is loaded in a particular tab in the browser, a unique page session gets created and assigned to that particular tab.

Local storage is useful for storing data that the user will need to access later, such as offline data. Session storage is similar to cookies, but the data is only stored for the current session. This means that the data will be deleted when the user closes the browser.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

What are floats, and how do they work?

A

The float CSS property places an element on the left or right side of its container, allowing text and inline elements to wrap around it. The element is removed from the normal flow of the page, though still remaining a part of the flow (in contrast to absolute positioning).

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

Suggest three plugins present in the Bootstrap jQuery plugin library.

A

Bootstrap:
* Multi-select (selects inputs with the multiple attribute present, drop down menu with options as checkboxes)
* Confirmation (uses Bootstrap Popovers as confirmation dialogs.)
* Date/Time Picker (drop down choose date and time)

-> Slick (responsive and customizable carousels and sliders but not bootstrap just JS)

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q

Which CSS class will you employ to span 16 columns on medium screens and 10 columns on large screens?

A

class = “col-md-16” and class = “col-lg-10”

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
13
Q

How will you verify whether a variable is set in PHP or not?

A

PHP isset() Function
The isset() function checks whether a variable is set, which means that it has to be declared and is not NULL. This function returns true if the variable exists and is not NULL, otherwise it returns false.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
14
Q

What’s the difference between require() and include() in errors?

A

The only difference is that the include() statement generates a PHP alert but allows script execution to proceed if the file to be included cannot be found. At the same time, the require() statement generates a fatal error and terminates the script.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
15
Q

What is a CSS reset?

A

A CSS Reset (or “Reset CSS”) is a short, often compressed (minified) set of CSS rules that resets the styling of all HTML elements to a consistent baseline.

In case you didn’t know, every browser has its own default ‘user agent’ stylesheet, that it uses to make unstyled websites appear more legible. For example, most browsers by default make links blue and visited links purple, give tables a certain amount of border and padding, apply variable font-sizes to H1, H2, H3 etc. and a certain amount of padding to almost everything. Ever wondered why Submit buttons look different in every browser?

Obviously this creates a certain amount of headaches for CSS authors, who can’t work out how to make their websites look the same in every browser. (NB: article coming soon about why this is a false notion!)

Using a CSS Reset, CSS authors can force every browser to have all its styles reset to null, thus avoiding cross-browser differences as much as possible.

16
Q

How will you use an AJAX request?

A

To send a request to a server, we use the open() and send() methods of the XMLHttpRequest object

17
Q

How will you use HTML5 new tags in IE8?

A

IE7/8 do not support the new HTML5 tags like footer . If you use them, you will get issues like this, and rendering glitches as a result. There are work-arounds in the form of the html5shiv and Modernizr polyfill scripts. Use one of these libraries to add support for HTML5 tags to old IE versions. If you use HTML5 semantic elements and your users are using Internet Explorer 8, then they would see the feature properly.