JavaScript, HTML5, CSS, UI interview questions and answers

Nimish Goel
3 min readOct 24, 2020

What is Java script: single-threaded, non-blocking, asynchronous, concurrent language.
1.1 Closures — Closures can also access the variables of its outer function even after the function has returned. This allows the returned function to maintain access to all the resources of the outer function.
1.2 ES6/7
1.2.1 Classes and inheritance with coding example: The JavaScript prototype property allows you to add new properties to object constructors:
1.3 Coding exercise (format Date ) — was not able to write- but did a good try
1.4 Functional scopingaccess to block
1.5 Classes creating and using
1.6 Troubleshooting using chrome inspect/firebug
1.7 Network tab
1.8 Event handling (with code)
1.9 Timing events is of two types:
setTimeout(Executes a function, after waiting a specified number of milliseconds.)
setInterval(Same as setTimeout(), but repeats the execution of the function continuously.)
1.10 Event capturing( the click event will start from the top and move to the children.) and
event bubbling ( inverse of event capturing, the event will start from the child element and move up to the parent. ).
1.11 Debooucning (Debouncing enforces that a function not be called again until a certain amount of time has passed without it being called.)
1.12 Throtlling (Throttling enforces a maximum number of times a function can be called over time.)
Benefits:
Wait until the user stops “resizing the window”
Don’t fire an “ajax event until the user stops typing”
Measure the scroll position of the page and respond at most every 50ms
1.13 call — allowing to call a function which is defined somewhere else. But in the same context,(We are passing the context as first paramter.)
1.14 apply is similar to call, but allows you to pass in arguments as an array.
1.15 bind : The Bind method returns a new function, allowing you to pass in a this array and any number of arguments.
Use it when you want that function to later be called with a certain context like events.
Call and Apply are interchangeable. You can decide whether it’s easier to send in an array or a comma separated list of arguments.
Bind is different. It always returns a new function.
1.15 Prototyping in javascript: The JavaScript prototype property allows you to add new properties to object constructors:
1.16 Event loop : The event loop is what allows Node. js to perform non-blocking I/O operations
— despite the fact that JavaScript is single-threaded
Java script single-threaded, non-blocking, asynchronous, concurrent language.
1.17: class vs interface

Basic Coding Questions asked
1. Difference between ‘==’ and ‘===’
2. Difference b/n null and undefined
3. childObj.prototype = new ParentClass();
4. Different types of data types in JS

HTML 5
1. Usage of DOCTYPE in an html page (Standards and quirks mode): tell browser about version
2. New elements in HTML5 :
footer header nav
3. New semantic elements in HTML5
4. Form Attributes in HTML5 (GET and POST)
5. Any multimedia elements in HTML5
video audio
6. HTML5 API(Application Programming Interfaces) -> Geolocation : no
7. Can we use 2 submit buttons in an HTML form
8. Self closing tags
9. Difference between cookies, sessionStorage, and localStorage
cookies : server communication
SessionStorage :windows/tab/Browser closed
localStorage: client side
10. Write down a simple html page that contains a form and form should have 2 text fields to accept user name and password and a submit button.

CSS
1 Responsive design
2 Bootstrap
3 Best practices to create fluid/adaptive layouts

1. Different ways to include CSS in a page
2. pseudo classes in CSS
3. ‘+’, ‘~’, ‘>’, ‘ ‘
4. Default value given by browser to position, float, display
5. What is CSS box model
6. What is z-index ?
7. Difference between padding and margin
8. Margin collapsing
9. Difference between visibility and display
10. rem, em, ox

--

--

Nimish Goel

UI Developer, Business enthusiastic, coder, angular developer,