Domain Knowledge

💡
InterviewCatをご購入された方は第6章を使って練習してください。InterviewCatのメリット: - 日本語付き - 回答付き
 

Resources

Here are some of the best resources (mostly books) we can find. Not only do they help you prepare for domain knowledge interviews, but they also help you become a better software engineer as a whole.
💡
For most of the domain knowledge interviews, you are expected to understand domain knowledge in the Common section like data structure & algorithms, networking, and database. Only go through the Advanced section if your role or experience is relevant.

Common

Data Structures & Algorithms

  • How to sort an array that contains a list of ages in O(n)
  • Explain the most common sorting algorithms and complexities.
  • Design a HashMap data structure
  • Array vs linked list
  • Hash internal implementations. (know about hashcode and equals, collision, internal DSA, Red Black tree, 2-3 trees)
  • How do you implement PriorityQueue?
  • How does Union Find work and how to optimize (talk about path compression in find operation)
  • How do you represent graph like child->parent, 1->3, 2->3, 4->5
    • something like map[3: []int{1,2}, 4:[]int{5}
  • What data structure is used for the DB index
  • Explain stack vs Heap

Database

  • Provide the transaction content and explain the final result:
Transaction1
Transaction2
Begin
Begin
balance = SELECT balance
balance = SELECT balance
balance = balance + 10
balance = balance + 20
UPDATE balance
UPDATE balance
COMMIT
COMMIT
Follow up: How to make it work correctly? (Optimistic lock, pessimistic lock, atomic update)
  • Explain ACID
  • What is an atomic operation in Database? Follow-ups: How does the database manage atomic operations?
  • Explain the isolation level in RDBMS
  • Explain the usage of NoSQL vs SQL
    • Difference between PostgreSQL and Cassandra
  • What are one-to-many and many-to-many relationships? how to design tables in each one
  • What is the usage of normalization vs denormalization?
  • Explain pessimistic vs optimistic locking
  • What is bin log in the RDBMS? Where is it stored and what is in it?
  • If multiple transactions are going concurrently, how to ensure consistency?
  • [only Elasticsearch] In Elasticsearch, how writes and search are implemented?
  • Explain the difference between left join and right join
  • What is indexing in databases and how does it work?
    • Why use a B-tree and not a hash map?
  • What is an index, and how do you use it
    • What is a composite index
  • How to scale DB if it’s slow
    • Scale read
    • Scale write
  • What is Foreign Key, and Why Use? Why not Use?
    • https://en.wikipedia.org/wiki/Referential_integrity
  • How did you manage the connection pool to the database when the database is restarted, or it is shut down? Is the connection pool restarted?

Networking

  • What is the difference between TCP and UDP
  • What is the difference between HTTP and HTTPs
  • What is TCP
    • 3-way handshake
  • How does IP packet work
    • Has a header
    • TCP layer add TCP header
    • IP layer add an IP header
  • How to check TCP connection in Linux OS
  • What is TLS

Programming language/framework (OOP)

  • What is thread-safety?
  • Explain garbage collection in your primary programming language
  • How does [your primary programming language] handle concurrency?
    • Locks (mutex etc)
    • Immutable data structure
  • What’s dependency injection? Why use dependency injection?
  • Inheritance vs composition
  • Explain polymorphism
  • Code a Singleton class in your choice of language
  • Code mutex usage example in your choice of language

Operating system

  • Explain process vs thread
  • how to kill the process
    • SIGTERM, SIGKILL
  • How does the process share information
    • using pipe. pipe has buffer
  • Explain async vs. sync IO
  • Explain blocking IO and non-blocking IO
  • How does coroutine work internally
  • Explain thread fork vs join
  • How does an application know IO has finished

Virtualization

  • what do you know about container
    • Cgroups, namespace
    • what kind of namespace does Linux have
  • What is the difference between a VM and Docker

Distributed System

  • How do you handle failure in distributed systems?
  • How do you retry in a distributed system?
  • What is idempotency?
  • What is a circuit breaker?
  • Explain load-balancing algorithms
  • How to mitigate cascading error in Microservices
  • How to handle distributed transactions / How to synchronize data between microservices
    • (SAGA vs 2 phase commit)
  • What is the CAP theorem? Example of AC. Example of CP
  • How to distribute cache across multiple nodes
  • What are some consensus algorithms that you know?
    • Raft

Production

  • How to monitor health check of service
  • How to deploy to production safely

Advanced

Java

You might get some Java questions if you have experience with Java. Same thing with other languages, but since most bigger companies in Japan use Java these questions tend to get asked more often.
  • Difference between Array list and Linked list
  • How is a HashMap implemented
  • What is a volatile keyword used for in Java
  • What happens if the array exceeds its size
  • Explain the difference between Java keywords: final vs static, volatile vs synchronized
  • How would you tweak the JVM and GC settings of an application in order to optimize its performance?
  • Explain garbage collection in Java
    • Generation
    • Algorithms such as mark and sweep, G1GC
  • How to do multithreading in Java
  • What are the differences between BigDecimal and double in Java? What are the advantages and disadvantages of using one over another?
  • What is a weak reference?
  • Explain the Java memory model
  • Why is Spring initialization slow
  • How does parallel stream work in Java stream API
  • Write concurrent code in java for incrementing a counter

Kubernetes

  • What is Kubernetes?
  • How does scaling in Kubernetes work
  • What Kubernetes resources are used for a simple web server

Redis

  • Why Redis can have high performance even though it is single threaded
    • event loop
  • Explain the Redis eviction policy

JavaScript

  • How does JavaScript achieve concurrency
  • How does JavaScript use the event loop

Kafka

You might get some Kafka questions if you have experience with it. Or if the team you are applying to is responsible for their Kafka platform
  • How to make Kafka process messages orderly
  • What are consumer groups
  • How do we control consumption if the producer is producing larger than the consumer is consuming?
  • What kind of exception do we encounter while working with Kafka and how should we take it?

Misc

  • Event-driven design pattern
  • Given a very large log file (say 1TB), each row contains time stamp, http response code and response time, how to get the largest response time without loading the whole log file to memory? How to get top 50 response times efficiently? If response times are always integers, how to optimize?
 
 

For complete guide you can sign in here if you have registered.