---
# System prepended metadata

title: DGM Interview with Salah

---

# DGM Interview with Salah

### Talk about the various types of rendering in React, focusing on the advantages and disadvantages of each.

- client components
- server side rendering
- server components
- static site generation

### Discuss strategies for handling deployment of multiple services.

The website is made up of a few different services:

- database
- various backend components (handling queries from frontend, handling queue messages and updating database accordingly)
- headless CMS that defines pages and components
- frontend code that generates pages based on that CMS and backend queries

How would you go about managing development and deployment of all of these to ensure a reliable production system?

### Write a function that performs an immutable update on a field of an object.

- The function may not modify the object.
- If the update function returns an identical value to the one held in the original object, the function must return the original object.

```typescript!
type Fn<A,B> = (x: A) => B;

const modify = <T extends object, K extends keyof T>(key: K) => (mod: Fn<Readonly<T[K]>,T[K]>) => (obj: Readonly<T>): T => {
    const unmodifiedObj = JSON.parse(JSON.stringify(obj))
    unmodifiedObj[key] = mod( unmodifiedObj[key] )
    return unmodifiedObj[key] === obj[key] ? obj : unmodifiedObj
};

const a = {hello: "world"};
modify("hello")(x => x.toUpper()) -> {hello: "WORLD"}
```

