Symfony + React js interview test
Tags: webdev, symfony, react
Published: 2022-08-20 09:31:33

I would like to share my experience of failing the interview test. Yes failing, because success stories are not as useful as failure stories. I will add resources that I used to complete the task. Before conclusion, I will explain the disadvantages of my solution and add some recommendations for back-end developers (Laravel/Symfony).

### Online Meeting Before Test
I had a nice online meeting. Traditional questions: Salary expectations, why I left my last work, my inspiration, favorite technologies, etc. In the past, I was learning Laravel by myself. I had zero experience with Symfony. Later I got an interview test to complete.

### Used Others Persons Code.
I decided to save time by finding an existing project and making a minimal amount of changes. Credits to [@hantsy](https://twitter.com/hantsy). Link to [project](https://dev.to/hantsy_26/-building-restful-apis-with-symfony-5-and-php-8-1p2e)

### Task
![Task](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/gtklg71c41bomqmxe9t7.png) 
The main goal was to have 2 lists as in the example above. Single arrow buttons should move one list element from one list to another. Two arrow buttons should move all list items from one list to another. Link to my [task](https://github.com/Oscar-Sherelis/multiple-select-list).

### Problems With Task
The project required PHP 8.1, I was working only with versions 5-6 to 7.4. The main problem was that I had zero experience and projects with the Symfony framework.
From the front-end side, I was thinking to use React + TS, but TS was too challenging for me. To solve problems from the back-end side I was reading the [official documentation](https://symfony.com/doc/current/index.html), but only StackOverflow helped. In the past, I made API with vanilla PHP. For this reason, I understood how it should work. To test HTTP requests I used VS Code extension called "Thunder Client". At start in src folder I was not understanding, what is "Annotation", "ArgumentResolver", "Command", "DataFixtures", "DTO" and "Entity" folders. Understanding of structure took some time. In the end, I had one main problem.  Moving all items from one list to another. As a solution, I mapped all ids from one list and made an update to the title_loc column.
![table structure](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/ndtbxsy94d20wqgx6014.png) 
I know this is a bad solution. Because item = PUT request, moving 5 items from one list to another will cost 5 PUT requests. I did this because I was out of time. For now, I am still stuck with the question of how to make the best solution to change all rows with one click by making one request. If the experienced developers would like to share knowledge about better solutions, comments are open.

### Recommendations
To have a better chance to find work as a back-end developer learn. Some of these recommendations were in the interview.
- Testing
- Docker
- Caching for Performance
- How to work with a big amount of data
- Debugging not only with var_dump, print_r
- Dependency injection
- Continuous integration continuous delivery
- Factory design pattern
- Event listener design pattern
- Builder Pattern

### Conclusion
Before applying to Symfony/Laravel developer position it is important to know: testing, docker, design patterns, and best practices. Do not be afraid to fail, in my case this interview gave me more knowledge which I decided to share.

I am available on social media:
[Twitter](https://twitter.com/Oscar_Sherelis)
[LinkedIn](https://www.linkedin.com/in/oscar-sherelis)
[Instagram](https://www.instagram.com/oscar_sherelis)

Support me:
https://www.buymeacoffee.com/oscarWeb