Below are general senior level full stack developer Q&As.
List some issues within RESTful APIs that GraphQL attempts to solve.
- Multiple Resources
- Number of request
- Over and Under fetching
Write a snippet of code violating the Don't Repeat Yourself (DRY) principle. Then, fix it. Use any language.
const fruit = 'apple'
if (fruit === 'apple' || fruit === 'orange') {
//do something
}
Fixed
if (['apple', 'orange'].includes(fruit)) {
//do something
}
Many state that, in Object-Oriented Programming, composition is often a better option than inheritance. What's you opinion?
Composition is better than Inheritance because the code becomes more flexible, cohesive, testable, and prevents coupling between classes.
How do tests and TDD influence code design?
TDD and test in general help to develop a quality code. Helps to write a simple code and reusable.
Why is developing a backend service (e.g. a Laravel API) as a stateless servie so important? What's the advantages of stateless code?
It's important because we can separate de responsability between frontend and backend, distribute tasks among teams, optimize the development process and some service advantages are horizontal scalability, less use of computational resources, and architecture with simplified design.