Skip to content

Add solution for Challenge 3 by onomica#1219

Merged
github-actions[bot] merged 3 commits intoRezaSi:mainfrom
onomica:challenge-3-onomica
Apr 14, 2026
Merged

Add solution for Challenge 3 by onomica#1219
github-actions[bot] merged 3 commits intoRezaSi:mainfrom
onomica:challenge-3-onomica

Conversation

@onomica
Copy link
Copy Markdown
Contributor

@onomica onomica commented Jan 28, 2026

Challenge 3 Solution

Submitted by: @onomica
Challenge: Challenge 3

Description

This PR contains my solution for Challenge 3.

Changes

  • Added solution file to challenge-3/submissions/onomica/solution-template.go

Testing

  • Solution passes all test cases
  • Code follows Go best practices

Thank you for reviewing my submission! 🚀

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai bot commented Jan 28, 2026

Walkthrough

Adds a new Go program implementing Employee and Manager types with methods to add, remove, find employees by ID, and compute average salary; includes a main demonstrating usage. (50 words)

Changes

Cohort / File(s) Summary
Employee Management Solution
challenge-3/submissions/onomica/solution-template.go
New file: defines Employee{ID, Name, Age, Salary} and Manager{Employees []Employee}; adds methods AddEmployee, RemoveEmployee, GetAverageSalary, FindEmployeeByID; includes main showing add/remove/find and average salary computation.

Sequence Diagram(s)

(Skipped — change does not introduce multi-component sequential interactions requiring visualization.)

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Possibly related PRs

  • RezaSi/go-interview-practice#561: Adds a near-identical Employee/Manager implementation with the same methods in a different submission.
  • RezaSi/go-interview-practice#788: Introduces the same types and methods (AddEmployee, RemoveEmployee, GetAverageSalary, FindEmployeeByID) in another submission.
  • RezaSi/go-interview-practice#879: Adds an equivalent Employee/Manager solution including main usage in the challenge-3 submissions.
🚥 Pre-merge checks | ✅ 2 | ❌ 1
❌ Failed checks (1 warning)
Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (2 passed)
Check name Status Explanation
Title check ✅ Passed The title accurately summarizes the main change: adding a solution file for Challenge 3 by onomica. It is concise, specific, and directly related to the changeset.
Description check ✅ Passed The description is clearly related to the changeset, providing context about the Challenge 3 submission, identifying the submitter, and noting that the solution passes tests and follows best practices.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.


Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link
Copy Markdown
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

🤖 Fix all issues with AI agents
In `@challenge-3/submissions/onomica/solution-template.go`:
- Around line 46-54: FindEmployeeByID returns &v where v is the range-loop copy,
so callers get a pointer to a copy instead of the actual slice element; change
the loop to iterate indices (e.g., for i := range m.Employees) or keep both
index and value and return &m.Employees[i] so the function returns a pointer to
the actual Employee in the Manager.Employees slice (refer to FindEmployeeByID,
Manager, Employees, Employee).

Comment thread challenge-3/submissions/onomica/solution-template.go
@github-actions github-actions bot merged commit 7a20a47 into RezaSi:main Apr 14, 2026
6 checks passed
@github-actions
Copy link
Copy Markdown

🎉 Auto-merged!

This PR was automatically merged after 2 days with all checks passing.

Thank you for your contribution, @onomica!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants