Skip to main content

Welcome to a Grasp lesson

Create a free account to keep studying and create your own study path.

Lesson 7

Mastering HTML, CSS, & JS: QCM Practice

Recommended resources

Welcome to the final lesson of our frontend module! Over the past several lessons, we've systematically reviewed the core concepts of HTML, CSS, and JavaScript, from structuring documents and styling layouts to tracing complex asynchronous code. Now, it's time to bring all that knowledge together and apply it to the specific challenge of your exam: the QCM (multiple-choice question) format.

Today's lesson is designed to sharpen your test-taking skills. We will focus on solving QCM-style questions that target common "nuances" or "traps" in HTML, CSS, and JavaScript. As an experienced developer, you are already familiar with these technologies; our goal is to refine your ability to spot subtle details in code snippets and select the correct answer under pressure.

Deconstructing the QCM: What to Expect

QCMs in technical exams are designed to test not just your knowledge, but your precision. They often hinge on a single, easily missed detail. Let's analyze a typical example to get into the right mindset.

This image shows several multiple-choice questions in French, typical of what you might encounter in the concours exam. They cover a range of JavaScript topics.

Take a look at the questions in the image. Notice their structure:

  • "Quelle méthode permet de faire une recherche...": Tests your knowledge of specific String or Array methods.
  • "Que vérifie isNaN(var)?": Tests your understanding of a built-in function's precise behavior. The correct answer is "Si var n'est pas un nombre" (If var is not a number), which is a classic nuance.
  • "Comment ajouter un item en plus dans une liste?": Tests your knowledge of DOM manipulation methods (appendChild is the correct answer here).

The key to success is to move beyond "what works" in a project and focus on "what the language specification says."


HTML & CSS: Spotting the Nuances

While JavaScript often has more "trick" questions, HTML and CSS have their own set of common QCM traps. These usually revolve around semantics, selector priority, and the box model.

For a quick, high-level review of these critical areas, the following video provides excellent summaries.

HTML CSS Interview Questions and Answers | Top 30 HTML CSS Interview Questions | Edureka

This video from edureka! offers concise explanations of fundamental HTML and CSS concepts that are frequently tested.

Watch these specific segments to refresh your memory on key distinctions: Semantic HTML: Start with the explanation of semantic elements from this section. Remember why <header> is different from a generic <div>, a common point for questions. CSS Priority: Review the hierarchy of CSS rules at this timestamp. This will remind you that inline styles override internal, which override external stylesheets. The Box Model: Finally, watch the clear breakdown of the box model from this point. Pay attention to the role of content, padding, border, and margin.

The difference between <b> and <strong> is a perfect example of a QCM nuance. While both make text bold, <strong> adds semantic importance, which is a key distinction for accessibility and SEO. Similarly, understanding that a selector like #nav .link is more specific than div .link is crucial.


JavaScript: Mastering the Traps

JavaScript is notorious for QCMs that test your understanding of its internal mechanics. The previous lessons on hoisting, scope, and the event loop were preparation for this.

Let's look at another classic trap: implicit global variables.

This code snippet demonstrates how assigning a value to an undeclared variable inside a function makes it a global variable.

In this example, teacher is reassigned, but topic is assigned a value without being declared with var, let, or const. Because of this, JavaScript creates topic on the global object. When otherClass() is called, it modifies the global teacher and creates the global topic. This is why both variables are accessible outside the function. This is a prime QCM scenario.

For a comprehensive written review of the most common JavaScript "gotchas," the following resource is invaluable.

50 Must-know HTML, CSS and JavaScript Interview Questions by Ex ...

This article from GreatFrontEnd breaks down many of the core concepts you'll be tested on. It's an excellent reference to solidify your understanding.

Focus on these specific sections. They are concise and directly relevant to QCM topics: Read the section on let, var, and const. It summarizes the key differences in scope, hoisting, and reassignment. Review the difference between == and ===. This is a fundamental concept for type coercion questions. Refresh your knowledge of data types, especially the distinction between primitive and non-primitive types. Finally, read the section on JavaScript scope to reinforce the concepts of global, function, and block scope.


Time to Practice

Theory is essential, but practice is what builds speed and confidence. The following resources are specifically designed for QCM-style drilling.

HTML & CSS Practice

This first resource is a French-language QCM platform, which will give you a very realistic practice environment.

QCM HTML/CSS : Listes, Quiz et Exercices Corrigés – | QCMUP.COM

This site, QCMUP.COM, provides interactive quizzes that are perfect for your exam preparation.

Navigate to the section Listes disponibles. I recommend you complete at least two of the lists, for example, "Partie 1" and "Partie 3". For each question, try to reason out the answer before selecting it. After you finish a list, review your incorrect answers and make sure you understand the explanation.

JavaScript Practice

Now for some more advanced JavaScript challenges. The following video presents a series of difficult questions on hoisting and scope. Treat it like an interactive quiz.

Hard level JavaScript questions on Hoisting | Scoping, Shadowing, ( Var, Let, Const ) & more

This video from the xplodivity channel is a fantastic workout for your JavaScript mental model. The questions are designed to be tricky.

Watch the video from the beginning. The presenter will pose a question with a code snippet. Pause the video at each question, decide on your answer, and then play the video to hear the detailed explanation. Pay close attention to the "behind the scenes" visualizations, as they clarify how the JavaScript engine interprets the code.


Conclusion

This lesson marks the culmination of our frontend review. By combining your practical experience with a focused review of the specific nuances tested in QCMs, you are now well-equipped to handle the HTML, CSS, and JavaScript portions of your exam.

Key Takeaways:

  • Read Carefully: QCMs often pivot on a single word like not, or a subtle difference like == vs. ===.
  • Know the Traps: Be on the lookout for common pitfalls: semantic vs. presentational tags in HTML, specificity and box-sizing in CSS, and hoisting, scope, and type coercion in JavaScript.
  • Practice is Paramount: The best way to get faster and more accurate is to work through dozens of practice questions, analyzing both your correct and incorrect answers.

You have now completed the entire frontend module. We have built a strong foundation. In our next lesson, we will transition to the server side. We'll begin Module 2 by exploring how clients and servers communicate, starting with the fundamental differences between GET and POST requests in the context of PHP web forms.