HTML इंटरव्यू प्रेप
In this page:
Semantic HTML समझाना
Interviewers अक्सर आपसे यह समझाने को कहते हैं कि semantic HTML क्यों ज़रूरी है। semantic tags (जैसे header, article, और nav) browsers और developers दोनों को अपना meaning स्पष्ट रूप से बताते हैं, जो SEO और accessibility दोनों के लिए महत्वपूर्ण है।
उदाहरण: Explaining Semantic HTML
<article>
<header>Post title</header>
<p>Post content</p>
</article>
CSS बॉक्स मॉडल समझाना
CSS Box Model web design की नींव है। यह तय करता है कि elements screen पर कैसे sized और spaced होते हैं, अंदर से बाहर की ओर चार layers stack करते हुए: Content, Padding, Border, और Margin।
उदाहरण: Explaining the CSS Box Model
<div style="box-sizing: border-box; width: 200px; padding: 10px; border: 1px solid black;">
Content
</div>
स्क्रिप्ट प्लेसमेंट: defer बनाम async
Interviewers page optimization के बारे में पूछना पसंद करते हैं। डिफ़ॉल्ट रूप से, browsers script files download और run करने के लिए आपके webpage layout को लोड होने से रोक देते हैं, जिससे आपकी site की load speed धीमी हो सकती है।
defer या async attributes इस्तेमाल करने से browser layout rendering को रोके बिना background में scripts download कर सकता है।
उदाहरण: Script Placement: defer vs. async
<script src="analytics.js" async></script>
<script src="app.js" defer></script>
लोकल वेब स्टोरेज ऑप्शन्स की तुलना करना
आपको standard storage methods की तुलना करने के लिए तैयार रहना चाहिए: localStorage (browser restarts के बीच persistently बना रहता है), sessionStorage (temporary, session-bound data), और Cookies (session tokens के लिए इस्तेमाल होने वाले छोटे, server-shared variables)।
उदाहरण: Comparing Local Web Storage Options
<script>
localStorage.setItem('theme', 'dark');
sessionStorage.setItem('step', '2');
document.cookie = "session=abc123";
</script>
एक्सेसिबिलिटी बेस्ट प्रैक्टिसेज हैंडल करना
Accessible coding (A11y) आधुनिक companies के लिए एक top priority है।
समझाएं कि आप अपने pages को screen readers और keyboard-only users के लिए accessible रखने के लिए buttons और headers जैसे standard, semantic HTML elements और aria-label जैसे ARIA attributes कैसे इस्तेमाल करते हैं।
उदाहरण: Handling Accessibility Best Practices
<button aria-label="Close">X</button>
Chapter Quiz — Complete all 20 topics to unlock
0/20 topics done
Complete these topics first:
- HTML Keyboard Shortcuts
- HTML Browser Support
- HTML Character Sets
- HTML Doctypes
- HTML Audio/Video Reference
- HTML Meta Tags
- HTML ARIA Roles
- HTML Input Validation
- HTML Iframe Security
- HTML Responsive Images
- HTML Web Fonts
- HTML Icon Fonts
- HTML Progress & Meter
- HTML Output Element
- HTML Datalist
- HTML Image Maps
- HTML Browser DevTools
- HTML Validation
- HTML Quiz
- HTML Interview Prep