Build an emoji blaster animation on iOS

Quick Overview

This question evaluates a developer's skills in iOS UI interaction, animation frameworks, event scheduling and concurrency, performance optimization, and designing testable application architecture.

Build an emoji blaster animation on iOS

Company: Pinterest

Role: Software Engineer

Category: Software Engineering Fundamentals

Difficulty: medium

Interview Round: Onsite

Build an iOS "blaster" app with a button at the bottom; when the user presses and holds, it emits emoji projectiles that animate toward the top of the screen at regular intervals. Specify your animation approach (Core Animation, UIKit Dynamics, or SwiftUI), scheduling/timers for continuous firing, collision or off-screen cleanup, performance considerations for many concurrent animations, and how you would structure the code for testability.

Quick Answer: This question evaluates a developer's skills in iOS UI interaction, animation frameworks, event scheduling and concurrency, performance optimization, and designing testable application architecture.

|Home/Software Engineering Fundamentals/Pinterest
Pinterest logo
Pinterest
Sep 6, 2025, 12:00 AM
mediumSoftware EngineerOnsiteSoftware Engineering Fundamentals
9
0

iOS "Blaster" App: Press-and-Hold Emoji Projectiles

Problem

Build a minimal iOS app with a button fixed at the bottom. While the user presses and holds the button, the app emits emoji "projectiles" that travel upward at regular intervals until the press ends.

Requirements

  1. Interaction
    • A bottom-aligned fire button.
    • Press-and-hold continuously fires projectiles at a fixed interval (e.g., every 80–150 ms).
  2. Animation
    • Projectiles animate from the button area toward the top of the screen.
    • Choose and justify an approach: Core Animation, UIKit Dynamics, or SwiftUI.
  3. Scheduling
    • Describe how you will schedule continuous firing while the button is held.
  4. Cleanup
    • Either implement collision handling or ensure projectiles are cleaned up when off-screen.
  5. Performance
    • Discuss performance considerations with many simultaneous projectiles and how to avoid jank.
  6. Code Structure & Testability
    • Outline how you would structure the code for unit testing (e.g., timer abstraction, renderer abstraction, separation of UI and logic).

Assume a modern iOS target. You may use UIKit or SwiftUI; include brief code to illustrate your chosen approach and any key abstractions.

Loading comments...