I applied online. The process took 2+ months. I interviewed at Costco Wholesale in Jun 2024
Interview
The interview process consisted of six rounds. Initially, I had a call with the HR representative, who was very nice throughout the whole process. She sent me a coding assessment that I could complete in my own time, which was quite easy.
After that, the first two rounds, each lasting an hour, were with different team members. These were coding rounds with three questions each. They did not provide any assistance, and while I was coding, they asked unrelated, random questions. They expected me to solve the problems and answer their questions simultaneously. This was the worst part of the experience. They didn't seem to focus on whether I could program or understand logic, and it felt pointless after a while.
Interview questions [5]
Question 1
Consider these 3 tables that map hotels to a single city each:
Table 1: costcotravel_ys003_DZ_Hotel
- Id (numeric primary key)
- Name (string)
Table 2: costcotravel_ys003_DZ_Hotel_Mapping_to_City
- Id (numeric primary key)
- Hotel_Id (numeric foreign key to hotel table)
- City_Id (numeric primary key to city table)
Table 3: costcotravel_ys003_DZ_City
- Id (numeric primary key)
- Code (3-letter city airport code)
- Name (full name of city)
Please write a script to create a stored procedure that takes as its input these variables:
CityCode: exactly 3 characters (but optionally empty)
HotelName: Up to 100 characters
and produces the following output fields:
HotelName (the name of the hotel)
CityName (the full name of the city)
for records that (1) contain the HotelName input anywhere inside the name of the hotel and (2) if a non-empty CityCode value is supplied, then also match exactly on city code.
Review the EmployeeManager class.
Identify and explain the bad practices in the code.
Find the bugs that could cause errors during execution.
Provide suggestions for improving the code quality and functionality.
Consider the following aspects:
Code structure and readability.
Proper use of data structures.
Error handling and edge case considerations.
Java coding standards and best practices.
Write your review and improvement suggestions.
Explain why certain parts of the code are problematic.
Suggest specific changes and improvements.
import java.util.List;
import java.util.ArrayList;
public class EmployeeManager {
private List employees;
public EmployeeManager() {
employees = new ArrayList<>();
}
// Adds an employee to the list
public void addEmployee(String name) {
if(name != null || !name.isEmpty()) {
employees.add(name);
}
}
// Removes an employee from the list
public void removeEmployee(String name) {
if(employees.contains(name)) {
employees.remove(name);
}
}
// Prints all employees
public void printEmployees() {
for(int i = 0; i <= employees.size(); i++) { //index out of bounds will throw here
System.out.println(employees.get(i));
}
}
// Finds an employee by name
public boolean findEmployee(String name) {
for(String employee : employees) {
if(employee == name) {// .equals() for string comparision
return true;
}
}
return false;
}
// Adds an employee to a database
public void addEmployeeToDatabase(String name, Connection conn) {
PreparedStatement stmt = null;
try {
if (name != null && !name.isEmpty()) {
String sql = "INSERT INTO employees (name) VALUES (?)";
stmt = conn.prepareStatement(sql);
stmt.setString(1, name);
stmt.executeUpdate();
stmt.close();
}
} catch (SQLException e) {
e.printStackTrace();
}
}
}
}
Given a list of daily flight prices to Maui, return a list such that, for each day in the input, tells you how many days you would have to wait until a cheaper flight is available.
If there is no future day for which this is possible, put 0 instead.
Example:
given the list of flights [350, 349, 348, 225, 415, 300, 500, 200],
your output should be [1, 1, 1, 4, 1, 2, 1, 0]
For $350, wait 1 day for next lower price of $349
For $349, wait 1 day for next lower price of $348
For $348, wait 1 day for next lower price of $225
For $225, need to wait 4 days for next lower price of $200
You own a small online store, consisting of its own site and a bunch of products presented on it. Your task is to retrieve all the products that are currently contained in the store using the provided REST API.
The current site contains the products represented by the following fields:
id?- the unique identifier of the product (integer);
name?- the name of the product (string);
updated_at?- timestamp of the last product update (integer);
price?- the price of the product (positive integer);
manufacturer?(optional) - the name of the manufacturer. This field is optional, and if it is not presented, then the product is considered to be produced locally, by yourself.
To obtain information about the current products from the site, you are given an?API endpoint. Use HTTP requests to obtain information about the current products from this endpoint.
API information
The API is served at?http://127.0.0.1:8081?and supports the only endpoint:
A GET request of the form?http://127.0.0.1:8081/products
This endpoint returns a JSON array, containing a list of JSON objects representing the information about the product with the fields described above.
For example, the response for this endpoint may look like:
[
{
"id": 1,
"name": "ProductName",
"updated_at": 150000000,
"price": 100,
"manufacturer": "ManufacturerCompanyName"
},
{
"id": 3,
"name": "ProductName 2",
"updated_at": 150000230,
"price": 90
}
]
Your task is to request an API endpoint and print the information of all the products in the following format:
Product has price and no manufacturer
if product has no manufacturer field, and
Product has price and manufacturer
otherwise.
The information about the products should be returned in the same order as the products were returned in response.
Had an hour intro and behavioral question interview with hiring manager and team members. Was told they were looking for more experience. Unhelpful, unfortunate and very unprofessional since my experience was on my resume. No actual questions were asked related to my expertise during the interview.
Interview questions [1]
Question 1
Name something you wish you had approached differently
One hour of behavioral questions from manager and one tech lead. Manger asked basic questions but tech lead asked more personal questions which I found refreshing in terms of getting to know me as a person.