Skip to content

Instantly share code, notes, and snippets.

@andrewmclagan
Last active July 17, 2020 01:08
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save andrewmclagan/af507f97156c4460782588cfea738ebe to your computer and use it in GitHub Desktop.
Save andrewmclagan/af507f97156c4460782588cfea738ebe to your computer and use it in GitHub Desktop.
Beam Tech Interview - Bruno.

Below are general senior level full stack developer Q&As.


1. GraphQL vs RESTful

List some issues within RESTful APIs that GraphQL attempts to solve.


2. Dont't Repeat Yourself.

Write a snippet of code violating the Don't Repeat Yourself (DRY) principle. Then, fix it. Use any language.

// past your code here

3. Inheritance vs Composition.

Many state that, in Object-Oriented Programming, composition is often a better option than inheritance. What's you opinion?


4. Test Driven Development

How do tests and TDD influence code design?


5. Statelessness

Why is developing a backend service (e.g. a Laravel API) as a stateless servie so important? What's the advantages of stateless code?

Below are senior level frontend javascript developer Q&As.


1. ES6 functional javascript code

Below is an array of people and their pets, along with an array of pet IDs. Write some code that takes two inputs: people and petIds and returns the original people array and for each matching pet id insert a property { species: 'cat' } into matching pet object.

e.g. { id: '2', name: 'Rolf', species: 'cat' }

Demonstrate your most expressive, clean, testable and ES6 compatible code

const petIds = ['2','3','5'];

const people = [
  {
    id: '1',
    name: 'Jill',
    sex: 'female',
    age: 32,
    pets: [
      { id: '1', name: 'Kitty'},
      { id: '2', name: 'Rolf'}
    ]
  },
  {
    id: '2',
    name: 'Sam',
    sex: 'male',
    age: 16,
    pets: [
      { id: '3', name: 'Pretty boy'}
    ]
  },
  {
    id: '4',
    name: 'Pete',
    sex: 'male',
    age: 33,
    pets: [
      { id: '4', name: 'Misty'},
      { id: '5', name: 'Milo'}
    ]
  },
  {
    id: '5',
    name: 'Jess',
    sex: 'female',
    age: 21,
    pets: []
  }  
]
// paste your code here

2. Dependencies

Define NPM, Yarn and the difference between the two.


3. Variable scope

What is the purpose of let keyword in javascript?


4. Statless components

Explain the reasoning behind a stateless component along with a small code example. Use React or Vue.

// past your code here

Below are PHP / Laravel senior level full stack developer Q&As.


1. Writing clean and testable code

Rewrite the class below to be more testable and clean

class User
{
    public static function getUsersByAge(int $age): ?Collection
    {
        $users = DB::table('users')
            ->where('age', $age)
            ->get();

        if ($users->count() > 0) {
            return $users;
        }

        return null;
    }
}
// paste your code here

2. Redis

What are the advantages of using Redis as the cache and queue drivers over the php array driver?


3. Eloquent and the database

Explain the differences between eager loading and lazy loading in eloquent models.


4. Modern PHP

What is your favourite language feature introduced in PHP 7.4? Why do you like it? What advantages does it offer?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment