---
# System prepended metadata

title: Interview questions

---

# Interview questions

- API design best practices
    - Which HTTP methods do you know?
    - GET vs POST
        - Digging deeper with the problems of GET requests
            - e.g. prefetching for logout
        - using JWT for authentication
            - encoding data in the token

    - imagine that we have these two endpoints
        - GET /getAuthorById/{id}
        - GET /deleteAuthorById/{id}
    - Answer
        - GET /author/{id}
        - DELETE /author/{id}
    - Consider the endpoint /authors, which returns all the authors in your database. And there are 10000 of them. What technique can you use to make sure your API doesn't crash/get blocked if someone makes a request to that endpoint?
        - Pagination
    - JWTs
        - can you encode data into JWTs
        - JWT vs cookies
- Node JS threads, event loop
    - Nodejs is single thread. However, if you run multiple operations from Node's Crypto module, they will run in parallel. Why is that?
        - the crypto module is implemented in nodes libuv (c++), which makes use of the worker threads (4 by default), so that operation benetifts of true parallelism.
    - Difference between using node cluster or kubernetes
- How to split into microsservices
    - refactoring strategy -> split off components
    - How would he monitor the microsservices

# Answers

- familiar with client-side area
- JS/PHP/Python in backend as first responses
- remote work experience
- lengthy self-intro, talkative

- base7: microservice experience with Node and GraphQL
- parallelism in Node: distributing across various CPUs
- migration across DBs: https://github.com/ggarri/mysql2psql
- REST API paradigms: checks out
- pagination: nice, comfortable with follow-up
- user auth:
    - OAuth access/refresh
    - proposes session IDs
    - one-time tokens
    - handshake on sign-up for encryption: cool idea!
- storage of JWT tokens:
    - browser storage, but issues iOS
- encoding data in JWT
    - open about lacking knowledge
    - contributed to discussion, happy to learn something new
- GraphQL:
    - mentioned flexible modeling
    - talked about relocating business logic
    - also mentioned complexity in mutations
    - probably quickly up to speed with new changes when given time
    - aware of docs advantage
- refactoring into microservices
    - differentiate between functionalities and split them off
    - stay in the same repo, write microservice in parallel
    - connect them to same DB, proxy from first to second one
    - redirecting traffic, essentially talks about hotswapping
    - talked about validating interfaces
- looks for in a team:
    - knowledgeable and nice people
    - flexibility in remote work
    - value on availability on team
