Piotr Sikora - Logo - Automatyzacja procesów | AI | JavaScript | Front End | Team Leader
  • Home
  • Services
    • Process Automation
    • AI for Lawyers
  • Blog
  • Quotes
  • Contact
PL/EN

Front-End Developer Interview Questions Part 1

  • Home
  • Blog
  • Front-End Developer Interview Questions Part 1
Front-End Developer Interview Questions Part 1

By Piotr Sikora

  • css

  • 3 min read

Table of Contents

  • Box model
  • Clearfix

Headhunters are calling to you and want to check your skills as fast as possible. What are they asking about? Its rather simple questions but in some cases they know the tricky ones.

So what are they asking?

Question: (CSS)

Box model

Do you know the box model? Please list elements of box model.

This is the most fundamental knowledge about DOM and CSS. Elements of box model:

  • margin

  • padding

  • border

  • content

So when you have a box described with CSS:

.box {
width: 100px;
height: 200px;
border: 10px solid #000;
margin: 20px;
padding: 30px;
}

what is total width/height and total height of the box?

total_width = width + border_left + border_right + padding_left + padding_right + margin_left + margin_right

so in this case it is

total_width = 100 + 10 + 10 + 20 + 20 + 30 + 30 = 220 (px)

total_height = height + border_top + border_bottom + padding_top + padding_bottom + margin_top + margin_bottom

so in this case it is:

total_height = 200 + 10 + 10 + 20 + 20 + 30 + 30 = 320 (px)

How can we omit problem of counting total width and height? Use a box-sizing in CSS.

Question: (CSS)

Clearfix

What is clearfix?

This is mostly connected with floating elements in HTML / CSS. In case you have a container with floating elements you need to clear floatings in the last element of childrens of this container. In oldschool way:

HTML code:

<div class="container">
<div class="floating"></div>
<div class="floating"></div>

<div class="clearboth"></div>
</div>

CSS

.container {}
.floating { width: 100px; height: 100px; float: left; }
.clearboth { clear: both }

Now when you have :before and :after pseudoelements you dont need to waste one more tag in HTML for clearing floats. You just need to add a CSS to container:

.container:before,
.container:after {
  content: "";
  display: table;
}

.container:after {
  clear: both;
}

or create a standard reusable clearfix in same way:

.container:before,
.clearfix:after {
  content: "";
  display: table;
}

.clearfix:after {
  clear: both;
}

Share this article

TwitterLinkedInFacebook

Tags:

  • #css

  • #front-end

  • #front-end-developer

Categories

after-hours(1)AI(7)ai-en(1)angular(4)automatic-tests(1)Automation(2)cryptography(1)css(8)CyberSecurity(2)Development(6)DevOps(1)events(3)javascript(11)n8n(10)ollama(1)security(2)seo(1)

Recent Posts

Testing Kimi Code: First Impressions from Web and CLI

Development

Testing Kimi Code: First Impressions from Web and CLI

Why You Shouldn't Cram Multiple Webhooks Into One n8n Workflow

Automation

Why You Shouldn't Cram Multiple Webhooks Into One n8n Workflow

DRY, WET, AHA: Finding the Right Balance in Code Reuse

Development

DRY, WET, AHA: Finding the Right Balance in Code Reuse

API vs Webhook: Understanding the Difference

Development

API vs Webhook: Understanding the Difference

RTCROS Framework: Structure Your Prompts for Better AI Results

AI

RTCROS Framework: Structure Your Prompts for Better AI Results

About Me

Piotr Sikora - Process Automation | AI | n8n | Python | JavaScript

Piotr Sikora

Process Automation Specialist

I implement automation that saves time and money, streamlines operations, and increases the predictability of results. Specializing in process automation, AI implementation, and workflow optimization using n8n, Python, and JavaScript.

n8n Workflows

n8n workflow automation templates

Explore my workflow templates on n8n. Ready-to-use automations for blog management, data collection, and AI-powered content processing.

3Workflow Templates
View Templates

• Auto-Categorize Blog Posts with AI

• Collect LinkedIn Profiles

• Export WordPress Posts for SEO

Tags

activepiecesafter-hoursahrefsaiAI cost reductionai-agentsai-automationangularantigravityapiAqua Securityarcade-gamesarchitectureautomationbackendbest-practicescadillacs-and-dinosaurschatbotchatgptCI/CD
“Your time is limited, so don't waste it living someone else's life.”
Steve Jobs
View more quotes

Similar Articles

Discover more related content

Master SASS Installation with This Quick Guide

Master SASS Installation with This Quick Guide

Ever dreamed of variables or functions in CSS? The easiest way to get them is by using a preprocessor like SASS.

3 April 2014
Test Your Mastery: Challenge Your Knowledge of CSS Selectors

Test Your Mastery: Challenge Your Knowledge of CSS Selectors

Do you want to check your fundamental knowledge of FEDev? Check it out! Run it and test your knowledge about selectors.

Pure CSS Collapsible Elements: Create Accordion

Pure CSS Collapsible Elements: Create Accordion

Learn how to create collapsible elements and accordion components using pure CSS-no JavaScript needed

Piotr Sikora | ai | n8n | javascript | python

Let's get to know each other!

Get in touch with me
Piotr Sikora | Process Automation  | AI Implementation 🤖 | Technology Consulting
Quick links
  • Home
  • Blog
  • Contact
Contact
  • piotr.sikora.ck@gmail.com
  • +48 505 684 661

© Piotr Sikora 2026 | All Rights Reserved