Senior Engineer Interview Prep Notes

  • Dependency Injection - the concept I know, DI is managed by Spring IoC container in Spring boot
  • Thread safety is ensured by synchronization techniques

  • ** Scalable REST API **
  • Use pagination for large datasets
  • Caching for high frequency requests 
  • API rate limiting to prevent abuse

  • ** SQL vs NoSQL **
  • Structured data, relations, tables -> SQL -> ACID props
  • Unstructured, frequently changing -> NoSQL -> Order data

  • ** Auth in microservices **
  • Centralized auth server will issue JWT tokens -> stateless auth
  • Each Microservices verifies token and does role based authorization

  • ** Error logging and monitoring **
  • use centralized logging like ELK
  • structured logging format -> JSON
  • distributed tracing OpenTelemetry to track requests across services 
  • setup alerts for critical errors via Grafana

  • ** Optimize database queries **
  • use indexes, avoid Select * , query caching, normalized table structures, optimized joins, analyse query execution plans (filtering should be done before join)

  • ** Eventual consistency **
  • updates to db are eventually rolled out to all nodes, and not instantly
  • observed in systems with high availabilty and partition tolerance

  • ** Design patterns ** 
  • Singleton -> one object of a class
  • Observer -> class has methods to notify on state change

  • ** API Versioning **
  • use versioning in uri /api/v1/resource
  • use headers to specify versioning 
  • have backwards compatibilty
  • deprecate only when all clients are migrated to use new version 

  • ** Feature toggles in microservices **
  • spring cloud config, centralized data store

  • ** Transition from monolith to microservices **
  • idenitfy independent modules and extract to microservice
  • manage request routing via gateway
  • gradually break down monolith

  • ** How to handle deadlocks **
  • avoid nested locks, don’t acquire all locks at once
  • use timeout while acquiring locks
  • use proper lock ordering strategy
  • Comments

    Popular posts from this blog

    What is a REST controller & Write a simple REST controller in Spring boot 3.xx

    DSA Practice: How to invert a binary tree