Bootstrap Interview Questions for Freshers
These are the questions interviewers ask most often at the beginner level. Read each answer, then say it in your own words. This is better than memorizing.
1. What is Bootstrap?
Bootstrap is a free, open-source front-end framework with ready-made CSS and JavaScript for building responsive, mobile-first websites quickly. It includes a grid system, components like navbars and modals, and utility classes.
2. What are the advantages of Bootstrap?
It saves development time, gives a consistent design, is responsive by default, works across browsers, has good documentation and a large community, and is easy to customize.
3. Which version of Bootstrap are you using, and what changed in version 5?
Bootstrap 5 (5.3.x) removed the jQuery dependency, replaced Internet Explorer support with modern browsers, added data-bs-* attributes, improved the grid with gutters classes, added offcanvas, RTL support and color modes (dark mode).
4. How do you include Bootstrap in a project?
There are three common ways: using a CDN link for the CSS and JS bundle, downloading the compiled files and linking them locally, or installing it with npm (npm install bootstrap) and importing it in a build tool.
5. What is the viewport meta tag and why is it important?
<meta name="viewport" content="width=device-width, initial-scale=1"> tells mobile browsers to use the real device width. Without it, phones show a zoomed-out desktop layout, and Bootstrap's responsive features do not work properly.
6. What is the difference between container and container-fluid?
.container has a maximum width that changes at each breakpoint and is centered. .container-fluid always takes 100 percent of the screen width.
7. What is the Bootstrap grid system?
It is a 12-column layout system built with flexbox. You use a container, rows and columns, and give columns a number of parts, such as col-md-6. Columns stack on small screens and sit side by side from the chosen breakpoint.
8. What are the breakpoints in Bootstrap 5?
Extra small (below 576px), small (sm, 576px), medium (md, 768px), large (lg, 992px), extra large (xl, 1200px) and extra extra large (xxl, 1400px).
9. What does mobile-first mean?
It means that styles are written for the smallest screens first, and larger screens are handled with breakpoint classes using min-width media queries. A class like col-md-6 applies from 768px and up.
10. How do you hide an element on mobile but show it on desktop?
Use d-none d-md-block. The element is hidden by default and displayed as a block from the medium breakpoint up.
11. What are utility classes? Give examples.
They are single-purpose helper classes that do one job, for example mt-3 (margin top), text-center, bg-primary, d-flex, fw-bold, rounded and shadow.
12. What is the difference between margin and padding classes?
Margin classes (m-*) add space outside an element and padding classes (p-*) add space inside. Sizes are 0 to 5, and sides are t, b, s, e, x, y.
13. How do you create a button in Bootstrap?
Add the class btn and a variant such as btn-primary to a button, a or input element. Use btn-outline-* for outlines, btn-lg and btn-sm for sizes.
14. How do you center content horizontally and vertically?
On a flex container use d-flex justify-content-center align-items-center. To center a block with a width, use mx-auto. For text use text-center.
15. What is the difference between the bootstrap.js and bootstrap.bundle.js files?
bootstrap.bundle.js includes Popper, which is needed for dropdowns, tooltips and popovers. bootstrap.js does not include Popper, so you must add it separately.
Conclusion
Strong basics are the key to passing the first interview round. Be ready to write a simple grid or navbar on paper or a whiteboard.

