# React Questions (Full Stack Questions)
- Cau you demonstrate some react product you have made in the past?
- If yes ---> further ask question on the product
- possible questions:
- what is the UI framework used
- what is the state management tool used
- If no, the topic can be closed.
- How would you implement a google authentication?
- If a react app has performance issue, how do you investigate which component is the culprit?
- How would you implement an infinite scroll to fetch data of a table that contains possibly 1000 rows? Given that you can communicate with the backend developer.
- Good if he knows api in browser such as
- `IntersectionObserver` or
- `getBoundingClientRect` (which gives the disstance of target element away from the browser boundary)
- What is the state management tool you usually use.
- What is the CSS framework you usually use.
- Can you describe the workflow in the past how you cooperate with a UI designer?
- In typescript what is the difference between `type` and `interface`? What is missing in `interface` that `type` can provide?
- Sometimes we make a post request to get an image and the content-type in the response headers are
```
Content-Type:application/octet-stream
```
instead of
```
Content-Type:image/png
```
- how can you manage to show the image?
- More specific, we need `<img src="some_url" />`, how do you get a `some_url` to display the image?
> **Why this question?.** In springboot we sometimes write an API to return in the following way:
> ```java
> StreamingResponseBody responseBody = someMethod(someParam)
> return ResponseEntity.ok()
> .header(HttpHeaders.CONTENT_DISPOSITION, "attachment; filename=generic_file_name.bin")
> .contentType(MediaType.APPLICATION_OCTET_STREAM)
> .body(responseBody);
> ```
> And in nodejs we also response like
> ```js
> zipStream.pipe(res);
> res.setHeader("Access-Control-Expose-Headers", "Content-Disposition");
> res.setHeader(
> "Content-Disposition",
> 'attachment; filename="zip-file-example.zip"'
> );
> ```
> These will have content-type `octet-stream`. Returning streams are memory efficient to the backend server but will cost extra work to frontend developers.
- When do we use `useEffect`? If I want a function to be executed whenever a component is unmounted, how do we do that?
- What is an **uncontrolled component**?
- Can you give an example of uncontrolled component?
- Why do we need that?
- How would you implement your own one?
- If the display data of an uncontrolled component is not the one you want (like default value coming from react state has been changed and you want to show it), how would you fix that?
# React-Native
- Do you use `expo`? (why and why not, it will be very good if he can explain reason not to use expo)
- It is known that plain-text must be wrapped inside a `Text` component. Can we wrap a `Text` component inside a `Text` component?
- How to implement a row in a scroll-list that can swipe left or right and display hidden buttons?
- It is known that the `Image` component in react-native or expo-image suffers from "flickering" when they live in a component that gets rerendered, how do you solve it?
- How do you deploy your app to app store?
- Can you update the deployed app without rebuilding it?
# Python
- For `tkinter`, can your programme be used in another computer without installing python?
- Do you use virtual environment when you use python?
- Why do we need virtual environment?
- If you use `Flask` for development, and you run and test the server locally by `python main.py`, can we directly deploy it in an ec2 instance or ECS via an image with exactly the same approach?
[This is to test whether a candiate understand `Flask` cannot handle multiple requests in `dev` environment, it needs to be served via `uwsgi` or `Gunicorn` server.]
# General Questions
- In frontend when you make an api call, how do you let backend know your identity?
- If you are asked to save the user data in frontend (like the login status or login information), how do you do that?
- What is the difference between cookie and local storage?
# Deep learning
- can you briefly explain your thesis about
> automatic enhancement of music performance quality in universal MIDI piano tracks
- you also mentioned Computer Vision and Image Processing as your skill set, can you briefly explain what have your learnt and implemented in these field?
# Database
- You have mentioned MySQL and dynamoDB, what is the use case for mysql and also that for dynamoDB?
# Nodejs
- If you have installed node.js runtime of **version 20** in your machine but you are given a project that can only be run under nodejs 16, what would you do?
- It is known that nodejs is a **single-thread** run-time environment. Suppose we have a backend server having a long running task inside a request handler
```js
await someTask() // takes 200s
```
will the backend be blocked from upcoming requests and why?
- What will be output of the following code?
```js
const counting = () => {
setTimeout(() => { console.log("1") }, 1);
console.log("2");
console.log("3");
console.log("4");
console.log("5");
}
counting();
```