- What You'll Be Building
- Core Concepts
- Access and Tracking Logic
- Expected Behaviour
- How to Approach It
- Testing Expectations
- What We’ll Discuss in Review
- Tools & Constraints
- My Exercise - Getting Started
This challenge is designed to evaluate your ability to:
- Design interactive UIs with state and access control logic
- Structure components in a reusable and testable way
- Manage side effects and asynchronous behavior thoughtfully
You’ll be implementing a simplified version of a secure livestream viewer, designed to restrict access to a YouTube livestream based on a simulated login state, and track key user interactions with the embedded video. While you won’t implement real authentication, your design should demonstrate how you’d enforce access in production. You’ll also log user actions like play, pause, and seek, to simulate how analytics might work in the live product.
We're building part of MyEdSpace’s video infrastructure, which serves livestreamed classes to authenticated users across web and mobile. This frontend component is intended to:
- Gate access to a video based on login state
- Provide hooks for analytics and engagement tracking
- Be simple enough to prototype quickly, but structured for growth
In production, only logged-in users would be allowed to view livestreams. For now, simulate this using any of the following:
- A hardcoded
isLoggedInflag - A toggle or simple login/logout button
- A mock context/provider
Unauthenticated users should see a "Please log in" message instead of the video.
Track and record the following video events:
- Play
- Pause
- Seek
You may use the YouTube Iframe API or the simple <iframe> embed with fallback
events. Display the captured events in memory (e.g., console or UI list).
- User is not logged in → ❌ Video not shown
- User is not logged in → Please log in message is shown
- User logs in → ✅ Embedded video player becomes visible
- User clicks play → event tracked/logged
- User pauses, seeks → each event logged
- User logs out → ❌ Video hidden again
- User logs out → Please log in message is shown
- Write React (JS or TS) code that is fully testable, you should use functional components and not class components
- You don’t need to implement a real auth flow — just simulate it.
- Focus on separation of concerns and extensibility
- You may use any lightweight testing framework (e.g. Jest, Testing Library) to show intent and test structure.
Please include at least two meaningful tests:
- A test validating that unauthenticated users cannot view the video
- A test ensuring that user interactions are tracked correctly Bonus if you show intent to mock YouTube events or abstract away APIs.
- How you structured your components and logic
- How you approached access control and video embedding
- How you tracked and handled side effects (e.g., video events)
- Tradeoffs you made and what you’d improve with more time
- Your approach to testing
- A simple React app is enough, or you can use a framework if preferred
- Avoid large libraries — keep it lightweight
- You can use AI tools to support your work as long as you remain the decision-maker
- Complete the exercise and share your code with us, we will then organize a follow up review. We recommend time boxing to 2hrs and sharing your code via git bundle which is well described at the following link https://www.linkedin.com/pulse/what-git-bundle-stephen-paynter/
-
Clone the repository:
git clone https://github.com/javierlopezdeancos/my-ed-space-tech-interview.git
-
Install the dependencies:
pnpm install
To start the development server, run the following command:
pnpm devThis will start the application on http://localhost:5173.
To format the code, run the following command:
pnpm formatTo run the unit tests, use the following commands:
pnpm test:unitTo run the end-to-end tests, use the following command:
-
install browsers (only once)
pnpm exec playwright install -
run tests
pnpm test:e2e
To run all tests, use the following command:
pnpm testTo build the Docker image, run the following command:
pnpm container:buildTo run the Docker container, run the following command:
pnpm container:runThe application will be available on http://localhost:8080.