For an element with position: sticky; to work, the parent container must have a defined ________.

  • Height
  • Margin
  • Overflow
  • Position
For an element with position: sticky; to work, the parent container must have a defined overflow property (e.g., overflow: auto;). This allows the element to stick within the scrolling container when it reaches a certain point, behaving as if it's "stuck" to the viewport.

How does SMACSS (Scalable and Modular Architecture for CSS) categorize its styles?

  • By alphabetical order
  • By color
  • By position in the HTML
  • By specificity
SMACSS categorizes its styles by specificity. In SMACSS, styles are organized into five categories: Base, Layout, Module, State, and Theme. This categorization helps in creating a scalable and maintainable CSS architecture by defining how styles should be applied and structured.

You are designing a responsive website and want a box to always be 10% of the viewport width. Which CSS value would you use?

  • %
  • em
  • px
  • vw
To make a box 10% of the viewport width, you should use the 'vw' (viewport width) unit. The 'vw' unit is based on the width of the viewport, making it ideal for responsive design. It ensures the box is always a percentage of the viewport's width, regardless of the screen size.

The ________ property in CSS specifies how overflows should be handled when the content overflows its block container.

  • overflow
  • overflow-type
  • overflow-x
  • overflow-y
The "overflow" property in CSS is used to specify how overflows should be handled when content overflows its block container. It can take values like "visible," "hidden," "scroll," and "auto" to control the display of content that overflows its container.

You're refactoring a website's CSS and want to separate styles that apply to layout from those that apply to modules. Which methodology would provide guidelines for this type of separation?

  • ITCSS (Inverted Triangle CSS)
  • ACSS (Atomic CSS)
  • RSCSS (Reasonable System for CSS Stylesheet Structure)
  • OOCSS (Object-Oriented CSS)
To separate styles that apply to layout from those that apply to modules, you should consider the ITCSS (Inverted Triangle CSS) methodology. ITCSS offers a scalable and logical structure for your stylesheets, with layers that guide you in distinguishing between core layout styles and module-specific styles, promoting maintainability and organization.

One of the benefits of CSS-in-JS solutions is that they can prevent unused styles, leading to ________.

  • Enhanced SEO
  • Improved performance
  • Increased memory usage
  • Reduced development time
CSS-in-JS solutions, such as styled-components or Emotion, can help prevent unused styles by generating scoped styles at runtime. This means only the styles required for a specific component are injected, leading to improved performance.

You're designing a button that, when clicked, shows a loading spinner. The spinner should rotate continuously. Which properties are crucial for this effect?

  • animation-duration
    animation-timing-function
    animation-iteration-count
    animation-direction
  • box-shadow
    margin
    border-radius
    display
  • font-size
    color
    line-height
    width
  • transform
    transition
    opacity
    position
To create a loading spinner that rotates continuously, you need to use CSS animations. Key properties for this effect include animation-duration (to control the duration of the animation), animation-timing-function (to specify the timing function for animation), animation-iteration-count (to set it to 'infinite' for continuous rotation), and animation-direction (to make it rotate continuously using 'alternate' or 'normal').

In a responsive design, the term ______ is used to describe a layout that adjusts and looks good on all screen sizes.

  • adaptive
  • dynamic
  • fixed
  • fluid
In responsive design, the term "adaptive" describes a layout that adjusts and looks good on all screen sizes and devices. An adaptive design ensures that the content and layout respond effectively to various screen sizes, providing a seamless user experience.

Which of the following is a valid method to execute a stored procedure using JDBC?

  • CallableStatement.execute() with a procedure
  • executeQuery() with a stored procedure call
  • executeStoredProc()
  • executeUpdate() with a stored procedure call
To execute a stored procedure using JDBC, you typically use the CallableStatement interface and its execute() method with a procedure call. The other options (executeStoredProc(), executeQuery() with a stored procedure call, and executeUpdate() with a stored procedure call) are not standard methods for executing stored procedures in JDBC.

Which operator can be used to invert the sign of a numeric expression?

  • !
  • +
  • -
  • ~
The - (minus) operator can be used to invert the sign of a numeric expression. For example, if you have a variable int x = 5;, then -x would give you -5. The other options are not used for inverting the sign of numeric values.

How can you read data from a URL using Java?

  • Use the InputStream class
  • Use the Scanner class
  • Use the URLConnection class
  • Use the readData() method
To read data from a URL in Java, you typically use the URLConnection class to open a connection to the URL and then use the InputStream class to read the data. The other options are not standard methods for reading data from a URL.

Which of the following primitive data types has the largest size in memory?

  • byte
  • double
  • long
  • short
Among the primitive data types listed, double has the largest size in memory. It is a 64-bit data type and can store large floating-point numbers with precision. The other options (byte, short, long) have smaller memory footprints.