1. Junior

    When do you choose a WebSocket over HTTP polling in a Flutter app?

    A WebSocket suits near-instant two-way updates, while polling is simpler for rare updates.

    Read the full explanation
  2. Mid-level

    How do you represent realtime connection states in Flutter?

    Use clear states such as connecting, connected, disconnected, and error instead of scattered flags.

    Read the full explanation
  3. Mid-level

    How do you design a safe WebSocket reconnect?

    Use exponential backoff with a cap and jitter, and stop attempts on dispose or logout.

    Read the full explanation
  4. Senior

    How do you handle message ordering and duplication after a reconnect?

    Use a message id or sequence number and apply idempotency per a clear contract.

    Read the full explanation
  5. Junior

    How do you prevent a StreamSubscription leak in a Flutter screen?

    Keep the subscription and cancel it in dispose, and do not subscribe inside build.

    Read the full explanation
  6. Senior

    What happens to a realtime connection when the session ends or on logout?

    Stop sending, close the connection, and clear the listeners and private data before allowing a new connection.

    Read the full explanation