Mid-Level
October 4, 2026

Spot the bug: React / Next.js

One snippet. Find the bug, or prove there isn't one.

tsx
1interface Order {
2  id: string
3  status: 'pending' | 'shipped' | 'delivered' | 'cancelled'
4  trackingNumber?: string
5}
6
7export function OrderStatus({ order }: { order: Order }) {
8  return (
9    <div className="status">
10      {order.status === 'pending' ? (
11        <span>Pending</span>
12      ) : order.status === 'shipped' ? (
13        <span>Shipped: {order.trackingNumber}</span>
14      ) : order.status === 'delivered' ? (
15        <span>Delivered</span>
16      ) : (
17        <span>Cancelled</span>
18      )}
19    </div>
20  )
21}

Click the lines that carry the problem.

Your verdict

One attempt per day. The answer shows up right after.

Keep your streak

Create an account to keep your streak and track your progress.

Create an account