Skip to content
tezvyn:

🌐Frontend Dev

Frontend web development and UI engineering

132 bites

Test yourself: Top 30 easy Frontend Dev interview questionsMultiple choice, with the correct answer and why it is correct on every question. Free, no sign-in.

Easy interview questions in Frontend Dev, page 2

Explain useEffect dependency array behavior for [], [deps], and omitted
easy2 min read

Explain useEffect dependency array behavior for [], [deps], and omitted

It tests reactive dependency tracking. Omitting re-runs every render; [] runs on mount with cleanup on unmount; [deps] re-runs when Object.is detects change. Red flag: claiming [] means 'run once' without mentioning cleanup or stale values.

Explain em, rem, px and why rem is preferred for font sizing
easy2 min read

Explain em, rem, px and why rem is preferred for font sizing

This tests CSS unit semantics and accessibility. px is absolute; em compounds against its parent; rem is root-relative and predictable. rem respects user browser font settings without nesting issues.

easy2 min read

Define a User object shape: interface vs type alias?

Tests structural typing and API contracts. Good answer: interface for API objects because it merges; type alias for unions. Forced: declaration merging needs interface; discriminated unions need type. Red flag: claiming performance differences.

easy2 min read

Design the public API for a reusable Button component

Variant, size, disabled, type props; forward click; slots for content/icons; no router/form coupling.

easy2 min read

How do you type a function with two possible response shapes?

This checks TypeScript union types for API responses. Define a union of Product[] and a message object, use a type guard to narrow it at runtime, and return that.

What is prop drilling in React?
easy2 min read

What is prop drilling in React?

Define it as threading props through middle layers; give a three-layer example like a theme toggle; cite useContext.

easy2 min read

Primary mechanism for passing data from parent to child component

Tests unidirectional parent-to-child data flow and explicit component contracts. A strong answer names props or inputs, explains one-way binding, and warns against direct child mutation. Red flag: confusing props with global state or events.

How does children work, and why is it fundamental to composition?
easy2 min read

How does children work, and why is it fundamental to composition?

Tests React composition knowledge. Good answer: children is a prop holding nested JSX; a Card wrapper renders {children} to let parents inject markup; contrast with prop-driven text. Red flag: calling children magic syntax instead of a standard prop.

CSS Grid: difference between 1fr and auto column sizing?
easy2 min read

CSS Grid: difference between 1fr and auto column sizing?

Tests fractional vs intrinsic sizing. 1fr divides leftover space; auto shrinks to content. Note that 1fr minimums default to auto, causing overflow with unbreakable content, unlike auto tracks. Red flag: claiming they are identical or auto always fills space.

How do you emit events from a child to parent component?
easy2 min read

How do you emit events from a child to parent component?

This probes unidirectional data flow and child-to-parent event emission. In Vue, call $emit with a named event and payload; in Angular, use @Output with EventEmitter and emit the query. A red flag is suggesting two-way binding or direct parent mutation.

What is a custom hook? Write a simple useToggle example.
easy2 min read

What is a custom hook? Write a simple useToggle example.

What it tests: Whether you see hooks as stateful logic extraction. Outline: Define a use-prefixed function calling hooks; write useToggle with useState and callback; explain extraction vs duplication. Red flag: Helpers without hooks or missing use prefix.

easy2 min read

Type alias for a function with optional param and default value

Tests whether you know function type expressions cannot encode default values. A great answer writes (s: string, n?: number) => boolean, explains defaults are implementation-only, and notes parameter names are required.

easy2 min read

Create a Person class using TypeScript parameter properties

This tests TypeScript parameter properties: constructor access modifiers auto-declare and initialize fields. A strong answer gives class Person { constructor(public name: string, private age: number) {} } and notes it removes manual this.name = name…

What is the viewport meta tag and what does width=device-width, initial-scale=1.0 do?
easy2 min read

What is the viewport meta tag and what does width=device-width, initial-scale=1.0 do?

This tests mobile viewport behavior and CSS pixels. The tag instructs browsers how to size the viewport; width=device-width sets width to screen CSS pixels; initial-scale=1.0 sets a 1:1 zoom ratio. A red flag is confusing viewport width with physical pixels.

easy2 min read

How do you conditionally render Login/Logout with isLoggedIn in Vue or Angular?

This tests DOM lifecycle awareness versus CSS toggling. A strong answer uses v-if/*ngIf for infrequent changes that need cleanup, and v-show/[hidden] for frequent toggles that should stay mounted. A red flag is treating them as interchangeable.

easy2 min read

How do CSS Modules solve global scope conflicts in React?

This tests build-time hashing and local scope. An answer explains that CSS Modules compile classes into unique hashes, scoping styles to the component, and shows the React import pattern styles.primary.

Explain the mobile-first approach and how it differs from desktop-first
easy2 min read

Explain the mobile-first approach and how it differs from desktop-first

Mobile-first starts small, layers up with min-width; desktop-first starts large, overrides down with max-width.

Explain two-way data binding and provide input binding syntax
easy2 min read

Explain two-way data binding and provide input binding syntax

Tests whether you see two-way binding as sugar for value binding plus an input event. Strong answer: show one syntax, then explain the prop-out, event-in pattern. Red flag: syntax only with no mention of change detection or unidirectional flow.

easy2 min read

Where and how to import global stylesheets in Next.js

This tests Next.js style entry points. In the App Router, import global CSS in the root layout.js; in the Pages Router, import it in _app.js. Never import global styles inside pages or components, since Next.js restricts global CSS to root-level files.

Make an image scale fluidly without exceeding its original size
easy2 min read

Make an image scale fluidly without exceeding its original size

Tests intrinsic sizing awareness. Good answer: max-width: 100% scales the image down with its container but never stretches it beyond intrinsic size; add height: auto to preserve aspect ratio. Red flag: width: 100% or omitting height, causing distortion.

We are hiring for this. Every open role lists the topics its interview covers, so you can prepare for the real thing rather than guessing.

See open roles