PracHub
QuestionsPremiumLearningGuidesInterview PrepNEWCoaches
|Home/Software Engineering Fundamentals/Valon

Design employee and company classes with tests

Last updated: Mar 29, 2026

Quick Overview

This question evaluates object-oriented design, API modeling, and unit testing competencies by requiring an Employee and Company model, CRUD operations, validation, and edge-case handling.

  • easy
  • Valon
  • Software Engineering Fundamentals
  • Software Engineer

Design employee and company classes with tests

Company: Valon

Role: Software Engineer

Category: Software Engineering Fundamentals

Difficulty: easy

Interview Round: Technical Screen

## Object-Oriented Design + Unit Testing You are implementing a small in-memory model for a company and its employees. The interviewer will give only input/output expectations, so you must clarify requirements and design clean APIs. ### Part 1 — Employee Design an `Employee` object with at least: - `id` (unique identifier) - `name` - `email` ### Part 2 — Company Design a `Company` object that manages many employees. Support operations such as: - Add an employee - Read/lookup an employee by `id` - Update an employee’s `email` by `id` - Delete/remove an employee by `id` ### Part 3 — Behavior and validation (clarify assumptions) Define and implement behavior for edge cases such as: - Adding an employee with a duplicate `id` - Looking up/updating/deleting an `id` that does not exist - Invalid emails (if you choose to validate) ### Part 4 — Testing requirement Write unit tests for each part/operation (the interview requires tests that can be executed successfully). Tests should cover: - Happy paths - Key edge cases and error handling ### Part 5 — Code quality expectations Aim for: - Clear method names and return values - Appropriate exceptions or error results - Maintainable structure (separation of concerns, minimal coupling)

Quick Answer: This question evaluates object-oriented design, API modeling, and unit testing competencies by requiring an Employee and Company model, CRUD operations, validation, and edge-case handling.

Valon logo
Valon
Jan 20, 2026, 12:00 AM
Software Engineer
Technical Screen
Software Engineering Fundamentals
8
0
Loading...

Object-Oriented Design + Unit Testing

You are implementing a small in-memory model for a company and its employees. The interviewer will give only input/output expectations, so you must clarify requirements and design clean APIs.

Part 1 — Employee

Design an Employee object with at least:

  • id (unique identifier)
  • name
  • email

Part 2 — Company

Design a Company object that manages many employees. Support operations such as:

  • Add an employee
  • Read/lookup an employee by id
  • Update an employee’s email by id
  • Delete/remove an employee by id

Part 3 — Behavior and validation (clarify assumptions)

Define and implement behavior for edge cases such as:

  • Adding an employee with a duplicate id
  • Looking up/updating/deleting an id that does not exist
  • Invalid emails (if you choose to validate)

Part 4 — Testing requirement

Write unit tests for each part/operation (the interview requires tests that can be executed successfully). Tests should cover:

  • Happy paths
  • Key edge cases and error handling

Part 5 — Code quality expectations

Aim for:

  • Clear method names and return values
  • Appropriate exceptions or error results
  • Maintainable structure (separation of concerns, minimal coupling)

Solution

Show

Comments (0)

Sign in to leave a comment

Loading comments...

Browse More Questions

More Software Engineering Fundamentals•More Valon•More Software Engineer•Valon Software Engineer•Valon Software Engineering Fundamentals•Software Engineer Software Engineering Fundamentals
PracHub

Master your tech interviews with 7,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.