PracHub
QuestionsPremiumCoachesLearningGuidesInterview Prep
|Home/Software Engineering Fundamentals/League

Design matrix-operations HTTP service and test strategy

Last updated: Mar 29, 2026

Quick Overview

This question evaluates system and API design, input validation, error handling, project architecture, and test strategy for backend services, assessing practical software engineering competencies such as modularity, clarity, and testability.

  • medium
  • League
  • Software Engineering Fundamentals
  • Software Engineer

Design matrix-operations HTTP service and test strategy

Company: League

Role: Software Engineer

Category: Software Engineering Fundamentals

Difficulty: medium

Interview Round: Technical Screen

You are given a take-home assignment to build a small backend server. The goal is not algorithmic difficulty but demonstrating solid software engineering practices, project structure, and test design. Design an HTTP service that exposes several APIs to perform operations on 2D matrices of integers. At minimum, support: - Matrix addition - Matrix subtraction - Matrix transpose - Horizontal flip (reverse columns) - Vertical flip (reverse rows) Assume: - Clients send requests over HTTP using JSON. - A matrix is represented as a 2D JSON array of integers, e.g. `[[1, 2], [3, 4]]`. - For binary operations (like addition), the client sends two matrices in the request. - The service should validate input (e.g., shape compatibility for addition) and return clear error responses for invalid input. - Performance is not the primary concern; correctness, clarity, and testability are. Describe in detail: 1. **Overall architecture and project structure** for this server (layers, modules, packages, etc.). 2. **API design**: the endpoints you would expose, HTTP methods, and example request/response payloads for each operation. 3. **Validation and error handling**: how you handle malformed JSON, non-rectangular matrices, dimension mismatches, and unexpected server errors. 4. **Testing strategy**: what unit tests, integration tests, and possibly end-to-end tests you would write, and how you would organize them. 5. Any **additional engineering considerations** you think are important (e.g., logging, configuration, extensibility for adding new matrix operations later).

Quick Answer: This question evaluates system and API design, input validation, error handling, project architecture, and test strategy for backend services, assessing practical software engineering competencies such as modularity, clarity, and testability.

League logo
League
Oct 17, 2025, 12:00 AM
Software Engineer
Technical Screen
Software Engineering Fundamentals
0
0

You are given a take-home assignment to build a small backend server. The goal is not algorithmic difficulty but demonstrating solid software engineering practices, project structure, and test design.

Design an HTTP service that exposes several APIs to perform operations on 2D matrices of integers. At minimum, support:

  • Matrix addition
  • Matrix subtraction
  • Matrix transpose
  • Horizontal flip (reverse columns)
  • Vertical flip (reverse rows)

Assume:

  • Clients send requests over HTTP using JSON.
  • A matrix is represented as a 2D JSON array of integers, e.g. [[1, 2], [3, 4]] .
  • For binary operations (like addition), the client sends two matrices in the request.
  • The service should validate input (e.g., shape compatibility for addition) and return clear error responses for invalid input.
  • Performance is not the primary concern; correctness, clarity, and testability are.

Describe in detail:

  1. Overall architecture and project structure for this server (layers, modules, packages, etc.).
  2. API design : the endpoints you would expose, HTTP methods, and example request/response payloads for each operation.
  3. Validation and error handling : how you handle malformed JSON, non-rectangular matrices, dimension mismatches, and unexpected server errors.
  4. Testing strategy : what unit tests, integration tests, and possibly end-to-end tests you would write, and how you would organize them.
  5. Any additional engineering considerations you think are important (e.g., logging, configuration, extensibility for adding new matrix operations later).

Solution

Show

Submit Your Answer

Sign in to leave a comment

Loading comments...

Browse More Questions

More Software Engineering Fundamentals•More League•More Software Engineer•League Software Engineer•League Software Engineering Fundamentals•Software Engineer Software Engineering Fundamentals
PracHub

Master your tech interviews with 8,500+ real questions from top companies.

Product

  • Questions
  • Learning Tracks
  • Interview Guides
  • Resources
  • Premium
  • For Universities
  • Student Access

Browse

  • By Company
  • By Role
  • By Category
  • Topic Hubs
  • SQL Questions
  • Compare Platforms
  • Discord Community

Support

  • support@prachub.com
  • (916) 541-4762

Legal

  • Privacy Policy
  • Terms of Service
  • About Us

© 2026 PracHub. All rights reserved.