كل التخصصاتالتقنية · مقابلة عمل

الواجهة الأمامية

تفحص مقابلات الواجهة الأمامية الأساسيات الكامنة تحت كل إطار عمل. تغطي هذه الأسئلة الخمسة ما يفعله المتصفح وما تقرره أنت بوصفك مطورًا.

كلمات → عبارات → جمل → تحدث

جرّب SpeakRole ↗
مقابلة عملالواجهة الأمامية
V

How do you keep a large frontend codebase from slowing down?

0:18
سؤال المقابل

الواجهة الأمامية

يبدأ المحاورون في وظائف الواجهة الأمامية غالبًا بالمنصة: كيف يعرض المتصفح الصفحة، وكيف تتعامل JavaScript مع الانتظار، وكيف يبني CSS التخطيط. تتغير أطر العمل كل بضع سنوات، أما هذه الأفكار فتبقى. وإذا استطعت شرحها بإنجليزية بسيطة فبإمكانك العمل مع أي إطار.

اجعل إجاباتك عملية. قل ما الذي ستقيسه وما الذي ستفحصه في أدوات المتصفح وما الذي سيراه المستخدم. يحب المحاورون المرشح الذي يربط التفاصيل التقنية بتجربة شخص حقيقي يستخدم الصفحة.

  • ✓كلمات → عبارات → جمل → تحدث
  • ✓معنى الإجابة
  • ✓اللغة

أكثر الأسئلة تكرارًا ونماذج الإجابات

How does the browser turn HTML and CSS into a visible page?

كيف يحوّل المتصفح HTML وCSS إلى صفحة مرئية؟

ما الذي يريد المحاور سماعه. الخطوات (DOM، والأنماط، والتخطيط، والرسم، والتركيب)، وأي التغييرات مكلفة.

نموذج إجابة بالإنجليزية للتدرّب عليه بصوت عالٍ

The browser parses the HTML into the DOM and the CSS into a style model. It combines them to find out what is visible and which styles apply. Then it does layout, which calculates the size and position of every element, then paint, which draws the pixels, and finally compositing, which puts the layers together. Layout is the expensive part. If I change something that affects geometry, like width or position, the browser may recalculate the layout for many elements. Changes to transform and opacity are usually cheaper, because the browser can often handle them in the compositing step. Also, scripts in the head can block rendering, so I load non-critical ones with defer or async.

How does asynchronous code work in JavaScript?

كيف تعمل الشيفرة غير المتزامنة (asynchronous) في JavaScript؟

ما الذي يريد المحاور سماعه. خيط رئيس واحد، وحلقة الأحداث (event loop)، والفرق بين المهام (tasks) واستدعاءات promise، والقاعدة العملية بألا تحجب الخيط أبدًا.

نموذج إجابة بالإنجليزية للتدرّب عليه بصوت عالٍ

JavaScript runs on one main thread, so it does one thing at a time. When I start something slow, like a network request, the browser does the waiting outside the main thread. When the work finishes, a callback goes into a queue. The event loop takes work from the queue when the call stack is empty. Promise callbacks use a separate microtask queue, which runs before the next regular task. The async and await syntax sits on top of promises and makes asynchronous code look sequential. The practical rule is to never block the main thread with a long loop, because the page freezes. I also always handle errors, with try and catch or with a catch on the promise.

How do you manage state in a frontend application?

كيف تدير الحالة (state) في تطبيق واجهة أمامية؟

ما الذي يريد المحاور سماعه. أنواع مختلفة من الحالة (محلية ومشتركة وقادمة من الخادم وفي الرابط URL) ومبدأ مصدر واحد للحقيقة، دون ذكر مكتبة بعينها.

نموذج إجابة بالإنجليزية للتدرّب عليه بصوت عالٍ

I separate state by type. Local state, like whether a dropdown is open, stays inside the component. Shared client state, like the current user or a shopping cart, may need a central store or a shared context. Server state, like a list loaded from an API, is different. It needs caching, loading and error handling, and refetching, so I use a data-fetching layer for it and do not copy it into a global store. The URL is also state: filters and page numbers belong there, so users can share links. My rule is to keep state close to where it is used, and to have one source of truth for every piece of data.

A page loads slowly. How do you find the cause and fix it?

صفحة تُحمَّل ببطء. كيف تجد السبب وتصلحه؟

ما الذي يريد المحاور سماعه. منهج يبدأ بالقياس، وCore Web Vitals إطارًا، وعدة إصلاحات محددة، مع فحص أخير.

نموذج إجابة بالإنجليزية للتدرّب عليه بصوت عالٍ

I start by measuring, not guessing. I use the performance tools of the browser to see the loading time, and field data if I have it. The Core Web Vitals give a good frame: how fast the main content appears, how quickly the page responds to input, and whether the layout jumps. Common fixes are sending less JavaScript by splitting the bundle, compressing and resizing images, loading things below the fold lazily, caching static files with a CDN, and reserving space for images to avoid layout shifts. After each change, I measure again, because an optimisation that I cannot measure may not help.

How do you make a web page accessible?

كيف تجعل صفحة ويب سهلة الوصول (accessible)؟

ما الذي يريد المحاور سماعه. HTML الدلالي (semantic) أولًا، ودعم لوحة المفاتيح، والتباين وبدائل النص، واستخدام حذر لـ ARIA، والاختبار اليدوي.

نموذج إجابة بالإنجليزية للتدرّب عليه بصوت عالٍ

Accessibility means that people can use the page with a keyboard, a screen reader or other assistive technology, and with different abilities. I start with semantic HTML: a real button for actions, a link for navigation, proper headings and labels for form fields. Native elements give keyboard support and the right role for free. I check that everything works with the keyboard alone, with a visible focus. I keep enough colour contrast and I write a meaningful alt text for images. I use ARIA only when native HTML is not enough, because wrong ARIA is worse than none. I test with automated tools and also by hand, because tools find only part of the problems.

كيف تنطق المصطلحات الأساسية

JavaScript
جَافَاسْكْرِبْت
DOM
دِي أُو إِم
asynchronous
أَيْسِنْكْرَنَس
accessibility
أَكْسِسِبِلِتِي
semantic
سِمَانْتِك
responsive
رِسْبُونْسِڤ
viewport
ڤْيُوبُورْت

عبارات مفيدة للإجابة

  • I would measure it first with the performance tools.كنت سأقيس ذلك أولًا بأدوات الأداء.
  • That change triggers a layout recalculation.هذا التغيير يستدعي إعادة حساب التخطيط (layout).
  • The state should live as close as possible to where it is used.ينبغي أن تعيش الحالة أقرب ما يمكن إلى المكان الذي تُستخدم فيه.
  • I would use a native element here, because it is accessible by default.كنت سأستخدم عنصرًا أصليًّا (native) هنا لأنه سهل الوصول افتراضيًا.
  • The main thread is blocked, so the page freezes.الخيط الرئيس محجوب، ولذلك تتجمد الصفحة.
  • It depends on whether the data is local or comes from the server.هذا يعتمد على ما إذا كانت البيانات محلية أم قادمة من الخادم.
  • From the point of view of the user, what changes?من وجهة نظر المستخدم، ما الذي يتغير؟

أخطاء شائعة

  • شرح إطار العمل فقط. إذا قلت "the framework updates the screen" فاذكر أيضًا ما يفعله المتصفح تحته. يختبر المحاورون الأساسيات أولًا.
  • قول "Java" وأنت تقصد "JavaScript". لغتان مختلفتان، والخلط بينهما يبدو إهمالًا. انطق JAH-vuh-skript بوضوح.
  • تحسين الأداء دون قياس. قل أي أداة ستستخدمها وأي رقم ستراقبه قبل التغيير وبعده.
  • اعتبار سهولة الوصول (accessibility) إضافة في نهاية المشروع. قل إنك تبنيها من البداية بـ HTML دلالي واختبار بلوحة المفاتيح.
  • استخدام الصفات بدل الظروف: "the page loads slow" أو "it works good". قل "the page loads slowly" و"it works well".

الأسئلة الشائعة

أي إطار عمل أقول إنني أعرفه؟

سمِّ الإطار الذي استخدمته في مشروع حقيقي، وقل كيف استخدمته. يهتم كثير من المحاورين بأساسيات HTML وCSS وJavaScript أكثر، ثم يفحصون هل طبقتها جيدًا داخل الإطار.

كيف أشرح تخطيط CSS في المقابلة؟

قل إن Flexbox لتخطيط أحادي البعد، صفًّا أو عمودًا، وإن Grid لبعدين، صفوف وأعمدة معًا. وكثيرًا ما يُستخدم الاثنان في الصفحة نفسها. اذكر نموذج الصندوق (box model) والتصميم المتجاوب (responsive design) بـ media queries، وأعطِ مثالًا واحدًا من عملك.

هل سأضطر إلى كتابة الكود مباشرةً أمام المحاور؟

غالبًا نعم: مكوّن صغير، أو دالة بكود غير متزامن. قل خطتك بصوت عالٍ: أولًا البنية في HTML، ثم الأنماط، ثم السلوك. واذكر الحالة الفارغة وحالة التحميل ولوحة المفاتيح، فهذه تدل على الخبرة.

قراءة الإجابة ليست مثل قولها. تدرّب على كل سؤال بصوت عالٍ، ثم قارن معنى إجابتك ولغتها بالنموذج.

جرّب SpeakRole ↗

موضوعات أخرى في هذا المجال