Skip to content

Commit 770ea68

Browse files
committed
Remove interview package.
1 parent d351aa7 commit 770ea68

22 files changed

+98
-95
lines changed

src/test/java/com/github/streams/interview/problems/employee/ignore/domain_related/Identity.java

Lines changed: 0 additions & 3 deletions
This file was deleted.

src/test/java/com/github/streams/interview/problems/strings/A_FirstNonRepeatingCharacterTest.java

Lines changed: 0 additions & 26 deletions
This file was deleted.

src/test/java/com/github/streams/interview/InterviewProblemSolutions.java renamed to src/test/java/com/github/streams/practice/ProblemSolutions.java

Lines changed: 10 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,14 @@
1-
package com.github.streams.interview;
1+
package com.github.streams.practice;
2+
3+
import com.github.streams.practice.employee.ignore.domain_related.Department;
4+
import com.github.streams.practice.employee.ignore.domain_related.Employee;
5+
import com.github.streams.practice.employee.ignore.domain_related.Identity;
26

3-
import com.github.streams.interview.problems.employee.ignore.domain_related.Department;
4-
import com.github.streams.interview.problems.employee.ignore.domain_related.Employee;
5-
import com.github.streams.interview.problems.employee.ignore.domain_related.Identity;
67
import java.util.*;
78
import java.util.function.Function;
89
import java.util.stream.Collectors;
910

10-
public class InterviewProblemSolutions {
11+
public class ProblemSolutions {
1112
public static Map<String, ? extends Number> findUniqueDomainsCount(List<Identity> people) {
1213
return people.stream()
1314
.filter(x -> x.email().split("@").length == 2)
@@ -64,12 +65,10 @@ public static Map<String, Long> getMinSalaryInEachDepartment(Collection<Employee
6465
}
6566

6667
public static Map<String, Long> getSumOfSalariesOnEachDepartment(Collection<Employee> employees) {
67-
final var collect =
68-
employees.stream()
69-
.collect(
70-
Collectors.groupingBy(
71-
e -> e.department().name(), Collectors.summingLong(e -> e.salary())));
72-
return collect;
68+
return employees.stream()
69+
.collect(
70+
Collectors.groupingBy(
71+
e -> e.department().name(), Collectors.summingLong(e -> e.salary())));
7372
}
7473

7574
public static Map<Department, List<String>> getEmployeesBelongToEachDepartment(

src/test/java/com/github/streams/interview/problems/employee/A_MinSalaryInEachDept.java renamed to src/test/java/com/github/streams/practice/employee/A_MinSalaryInEachDept.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
1-
package com.github.streams.interview.problems.employee;
1+
package com.github.streams.practice.employee;
22

3-
import com.github.streams.interview.InterviewProblemSolutions;
4-
import com.github.streams.interview.problems.employee.ignore.domain_related.dummy_data.DummyEmployees;
3+
import com.github.streams.practice.ProblemSolutions;
4+
import com.github.streams.practice.employee.ignore.domain_related.dummy_data.DummyEmployees;
55
import java.util.Map;
66
import org.junit.jupiter.api.Assertions;
77
import org.junit.jupiter.api.Disabled;
@@ -29,7 +29,7 @@ void testMinSalaryInEachDepartment() {
2929

3030
final var employees = DummyEmployees.randomEmployees();
3131

32-
final var mySolution = InterviewProblemSolutions.getMinSalaryInEachDepartment(employees);
32+
final var mySolution = ProblemSolutions.getMinSalaryInEachDepartment(employees);
3333
final var yourSolution = Map.<String, Long>of();
3434

3535
Assertions.assertEquals(mySolution, yourSolution);

src/test/java/com/github/streams/interview/problems/employee/B_MaxSalaryInEachDept.java renamed to src/test/java/com/github/streams/practice/employee/B_MaxSalaryInEachDept.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
1-
package com.github.streams.interview.problems.employee;
1+
package com.github.streams.practice.employee;
22

3-
import com.github.streams.interview.InterviewProblemSolutions;
4-
import com.github.streams.interview.problems.employee.ignore.domain_related.dummy_data.DummyEmployees;
3+
import com.github.streams.practice.ProblemSolutions;
4+
import com.github.streams.practice.employee.ignore.domain_related.dummy_data.DummyEmployees;
55
import java.util.Map;
66
import org.junit.jupiter.api.Assertions;
77
import org.junit.jupiter.api.Disabled;
@@ -30,7 +30,7 @@ void testMaxSalaryInEachDept() {
3030

3131
final var employees = DummyEmployees.randomEmployees();
3232

33-
final var mySolution = InterviewProblemSolutions.getHighestSalaryInEachDepartment(employees);
33+
final var mySolution = ProblemSolutions.getHighestSalaryInEachDepartment(employees);
3434
final var yourSolution = Map.<String, Long>of();
3535

3636
Assertions.assertEquals(mySolution, yourSolution);

src/test/java/com/github/streams/interview/problems/employee/C_SumOfSalaryInEachDept.java renamed to src/test/java/com/github/streams/practice/employee/C_SumOfSalaryInEachDept.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
1-
package com.github.streams.interview.problems.employee;
1+
package com.github.streams.practice.employee;
22

3-
import com.github.streams.interview.InterviewProblemSolutions;
4-
import com.github.streams.interview.problems.employee.ignore.domain_related.dummy_data.DummyEmployees;
3+
import com.github.streams.practice.ProblemSolutions;
4+
import com.github.streams.practice.employee.ignore.domain_related.dummy_data.DummyEmployees;
55
import java.util.Map;
66
import org.junit.jupiter.api.Assertions;
77
import org.junit.jupiter.api.Disabled;
@@ -28,7 +28,7 @@ class C_SumOfSalaryInEachDept {
2828
@Disabled
2929
void sumOfSalariesInEachDepartment() {
3030
final var employees = DummyEmployees.randomEmployees();
31-
final var mySolution = InterviewProblemSolutions.getSumOfSalariesOnEachDepartment(employees);
31+
final var mySolution = ProblemSolutions.getSumOfSalariesOnEachDepartment(employees);
3232
final var yourSolution = Map.<String, Long>of();
3333

3434
Assertions.assertEquals(mySolution, yourSolution);

src/test/java/com/github/streams/interview/problems/employee/D_NumberOfEmployeeInEachDept.java renamed to src/test/java/com/github/streams/practice/employee/D_NumberOfEmployeeInEachDept.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
package com.github.streams.interview.problems.employee;
1+
package com.github.streams.practice.employee;
22

3-
import com.github.streams.interview.problems.employee.ignore.domain_related.dummy_data.DummyEmployees;
3+
import com.github.streams.practice.employee.ignore.domain_related.dummy_data.DummyEmployees;
44
import java.util.Map;
55
import java.util.stream.Collectors;
66
import org.junit.jupiter.api.Assertions;

src/test/java/com/github/streams/interview/problems/employee/E_EmployeesBelongToEachDept.java renamed to src/test/java/com/github/streams/practice/employee/E_EmployeesBelongToEachDept.java

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
1-
package com.github.streams.interview.problems.employee;
1+
package com.github.streams.practice.employee;
22

3-
import com.github.streams.interview.InterviewProblemSolutions;
4-
import com.github.streams.interview.problems.employee.ignore.domain_related.Department;
5-
import com.github.streams.interview.problems.employee.ignore.domain_related.dummy_data.DummyEmployees;
3+
import com.github.streams.practice.ProblemSolutions;
4+
import com.github.streams.practice.employee.ignore.domain_related.Department;
5+
import com.github.streams.practice.employee.ignore.domain_related.dummy_data.DummyEmployees;
66
import java.util.List;
77
import java.util.Map;
88
import org.junit.jupiter.api.Assertions;
@@ -37,7 +37,7 @@ class E_EmployeesBelongToEachDept {
3737
@Disabled
3838
void employeesBelongToEachDept() {
3939
final var employees = DummyEmployees.randomEmployees();
40-
final var mySolution = InterviewProblemSolutions.getEmployeesBelongToEachDepartment(employees);
40+
final var mySolution = ProblemSolutions.getEmployeesBelongToEachDepartment(employees);
4141
final var yourSolution = Map.<Department, List<String>>of();
4242

4343
Assertions.assertEquals(yourSolution, mySolution);

src/test/java/com/github/streams/interview/problems/employee/F_ManagerWithMaxEmployees.java renamed to src/test/java/com/github/streams/practice/employee/F_ManagerWithMaxEmployees.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
1-
package com.github.streams.interview.problems.employee;
1+
package com.github.streams.practice.employee;
22

3-
import com.github.streams.interview.InterviewProblemSolutions;
4-
import com.github.streams.interview.problems.employee.ignore.domain_related.dummy_data.DummyEmployees;
3+
import com.github.streams.practice.ProblemSolutions;
4+
import com.github.streams.practice.employee.ignore.domain_related.dummy_data.DummyEmployees;
55
import org.junit.jupiter.api.Assertions;
66
import org.junit.jupiter.api.Disabled;
77
import org.junit.jupiter.api.Test;
@@ -34,7 +34,7 @@ class F_ManagerWithMaxEmployees {
3434
void findManagerWithMaxEmployeesTest() {
3535
final var employees = DummyEmployees.randomEmployees();
3636

37-
final var mySolution = InterviewProblemSolutions.getManagerIdHavingMaxEmployees(employees);
37+
final var mySolution = ProblemSolutions.getManagerIdHavingMaxEmployees(employees);
3838
final var yourSolution = -1;
3939

4040
Assertions.assertEquals(mySolution, yourSolution);

src/test/java/com/github/streams/interview/problems/employee/G_EmployeesWhoWorkedOnMostProject.java renamed to src/test/java/com/github/streams/practice/employee/G_EmployeesWhoWorkedOnMostProject.java

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,11 @@
1-
package com.github.streams.interview.problems.employee;
1+
package com.github.streams.practice.employee;
22

3-
import com.github.streams.interview.InterviewProblemSolutions;
4-
import com.github.streams.interview.problems.employee.ignore.domain_related.*;
5-
import com.github.streams.interview.problems.employee.ignore.domain_related.dummy_data.DummyProjects;
3+
import com.github.streams.practice.ProblemSolutions;
4+
import com.github.streams.practice.employee.ignore.domain_related.Department;
5+
import com.github.streams.practice.employee.ignore.domain_related.Employee;
6+
import com.github.streams.practice.employee.ignore.domain_related.Identity;
7+
import com.github.streams.practice.employee.ignore.domain_related.Project;
8+
import com.github.streams.practice.employee.ignore.domain_related.dummy_data.DummyProjects;
69
import java.util.*;
710
import org.junit.jupiter.api.Assertions;
811
import org.junit.jupiter.api.Disabled;
@@ -73,7 +76,7 @@ public void employeeWorkedOnMostProject() {
7376
employees, employee1, employee1ProjectsHistory, employee2, employee2ProjectsHistory);
7477

7578
// When
76-
var mySolution = InterviewProblemSolutions.employeesWorkedForMaxProjects(employees);
79+
var mySolution = ProblemSolutions.employeesWorkedForMaxProjects(employees);
7780

7881
// Then
7982
Employee yourSolution = null;

0 commit comments

Comments
 (0)