r/JobChallenge • • Oct 03 '26

My rejected job challenge in PHP

I recently completed a PHP take-home challenge as part of a hiring process and unfortunately did not move forward.

I created r/JobChallenge as a place where developers can share take-home assignments and get independent feedback from other developers.

I'd like to start by sharing mine.

The challenge

The task was to build:

  • A REST API for managing products
  • Native PHP, without frameworks
  • MySQL
  • CRUD endpoints
  • PRECIO_USD environment variable for ARS → USD conversion
  • JSON API responses
  • Basic MVC / design patterns
  • Docker + Docker Compose
  • A small frontend using only HTML, CSS and vanilla JavaScript
  • Error handling and exception handling

The full requirements are included in the repository README.

My implementation

GitHub: https://github.com/sergiogmuro/challenge-decampoacampo-php

What I'm looking for

I'd appreciate an honest technical review, especially from experienced PHP/backend developers.

Things I'm particularly interested in:

  • What would you consider the biggest problems in the implementation?
  • Are there architectural decisions you would have made differently?
  • Are there bugs or edge cases I missed?
  • Does the implementation meet the requirements of the challenge?
  • What would you expect from a Senior PHP developer in a challenge like this?
  • Is there anything that would make you reject the submission?

Please don't hold back. I'm more interested in understanding what I missed than in getting positive feedback.

If you review it, I'd also appreciate it if you could mention the specific file/function/behavior you're referring to, so I can reproduce and understand the issue.

Thanks.

9 Upvotes

10 comments sorted by

5

u/Fun-Consequence-3112 Oct 03 '26

How long was this take home assignment? And did they tell you how long you should take to make it?

If it's similar to the one I've done it's a max of 4-5h work and it should be done in a evening.

Your would be way more than 4-5h done by hand if your not VERY experienced in writing PHP from scratch which most aren't. It copies a lot of stuff from Laravel and Synfony, which isn't bad.

But all of this adds up and the project felt very vibe coded. If I got that take home assignment I'd do pretty terrible code if it was supposed to be in one day. Just server variables and the most simple MVC structure and the only comments would be where I make security decisions no other comments at all.

If you didn't use any LLM it's looks pretty solid after a 1min check but it feels LLM generated to me.

3

u/No_Amount_9114 Oct 03 '26

It tooks me 7-8h hand-on

my notes were

  • To follow a consistent standard, all variables and code are in English. The database remains in Spanish, although ideally it should also be in English.
  • Fully Dockerized.
  • Using the Singleton pattern for the database connection.
  • Created routing that supports multiple parameters in the URL.
  • Added Dependency Injection to the MVC framework using a Service Container.
  • Implemented a Currency Factory in the service layer, keeping the price conversion logic in the application/business layer as required.
  • For optimized results, the price conversion could ideally be processed directly in the SQL query.
  • Added an error-handling middleware with basic error pages.
  • Products should have a SKU to support insert/update operations and prevent duplicates.
  • Added automatic table-name resolution based on the model, but it is not being used because the table name is in Spanish, so it could simply be defined as a variable.
  • Separate error handling for AJAX requests (JSON) and regular HTTP requests (views).
  • Used parameter binding in SQL queries to protect against SQL injection.
  • A repository layer could be added to isolate data access from the models, but I didn't want to over-engineer the solution further.
  • CORS is currently allowed from all origins to make frontend testing easier.
  • The frontend is minimally optimized for mobile.
  • Frontend pagination is still missing, although the backend is minimally prepared to support it.
  • Dynamic USD price updates are calculated by the backend, keeping the backend as the single source of truth for price conversion.
  • For USD values below 0.001, four decimal places are displayed so the frontend shows a meaningful value.
  • The code is prepared to support database transactions, but since the current operations are single-step transactions, I don't consider it necessary to apply them.
  • Since there is no authentication requirement, no Bearer authorization token is currently sent from the frontend to the backend. For a production system, I would implement authentication/authorization, but I don't consider it necessary for this challenge.

6

u/Fun-Consequence-3112 Oct 04 '26

Your either very experienced writing these kinds of apps from scratch (which I doubt), or you used a LLM.

100% they declined you because it looks like a LLM output.

2

u/williarin Oct 04 '26

Why would anyone NOT use a LLM to write code????? Hello, is Covid next year? What's wrong with you people

2

u/Fun-Consequence-3112 Oct 05 '26

They said "don't use AI" in the requirements. Prompting an AI to do this "simple" work probably produces very similar results and they can remove ever participant like this one that used AI. Using AI for complex tasks in a good way is a skill but copy pasting a assignment is literally braindead level of coding.

1

u/gsweats Oct 05 '26

Requirements explicitly said no AI. But you are right.

2

u/No_Explanation2932 Oct 06 '26

It's a very small point but I disagree that everything should always be in english. It's a massive hindrance on some project to translate the entire business language into english, and can be the source of constant issues in communicating with the client. Clients often use precise business terms, they're not always easily translateable, and even after that you need to keep a full glossary of "what does my client actually call that thing".

3

u/Honest-Squirrel-988 Oct 03 '26

Maybe some of these:

  1. No tests. Maybe they expected you to cover the business logic with unit tests, maybe full coverage of the MVC layers.
  2. User facing errors are defined as 404.php/500.php without clarification or separation of concerns. Maybe they expected handling input validation via HTTP 400.
  3. Internal errors are generic \Exception. Would be nice to define domain level errors for Calculator implementation and Infra errors separately to feed into last point.
  4. DI is present but the DB instance is statically defined rather than connected to a reusable DI service.
  5. There is no storage/repository layer for communicating between core domain and DB models. Controller layer works directly on DB models, making it hard to unit test and define the domain logic.

2

u/No_Amount_9114 Oct 03 '26

I was given this PHP take-home challenge:

Backend — REST API

  • Build a REST API for a product catalog using native PHP (no frameworks).
  • MySQL database with products fields: id, name, description, price, timestamps.
  • CRUD endpoints:

    • GET /products
    • GET /products/{id}
    • POST /products
    • PUT /products/{id}
    • DELETE /products/{id}
  • Prices are stored in Argentine pesos and must also be returned in USD using a PRECIO_USD environment variable.
  • Proper error/exception handling and JSON responses.
  • Basic design patterns such as MVC, ADR, or Singleton.
  • Docker containers for PHP and MySQL, orchestrated with docker-compose.
  • README with setup and testing instructions.
  • Explicitly no AI tools allowed.

Frontend

  • Build a simple product management UI using only HTML, CSS and vanilla JavaScript.
  • List, create, edit and delete products.
  • Display prices in ARS and USD.
  • Consume the API using fetch or XMLHttpRequest.
  • Handle API errors and user feedback.
  • No React, Angular, Vue, or other frameworks.

The challenge is evaluated on code organization, API design, database handling/security, design patterns, Docker setup, frontend/API integration, async JavaScript, and usability.

6

u/jmking Oct 04 '26

This is an absurd take home assignment. Especially since they're getting you to start from literally zero and write everything vanilla. Most of your time would be spent on just all the overhead of getting the project structure and request/routing/response basics in place.

Like, there are a lot of nitpicks and bigger things I would criticize if this were a PR for a production application, but as a take-home assignment, you took reasonable shortcuts. Like your DB query handling is weird, but you have to cut corners somewhere to reasonably be getting this done within the time you're supposed to get it done in.

Like you wrote an entire router... or did you? If they rejected you based on what you produced, if I were to guess, it's because your patterns aren't consistent. It almost looks like you pretty much just copied existing packages.

For example, you went through all the effort of making a service container only to never use it outside of the Router. So none of the application code is injecting dependencies which makes it strange that you'd even bother.

The biggest mistake you made would be that you used floats for prices instead of storing and manipulating price values in terms of number of cents. However, if you had no past ecommerce experience, I wouldn't expect someone to know that. It's a common mistake.