Interview

Coding Interview

Some high-level notes are written in Landing your dream coding job. Also see LeetCode, Competitive Programming for more specific notes.

Platforms for live interview practice:

Domain / company specific prep:

Some helpful phraseology

  • So I think a reasonable way to go about this
  • “Is this a reasonable thing, or do you want me to?”
  • “Conceptually, we have…”
  • “Does that sound ok?”
  • “Does that make sense so far?”
  • Does that seem like a reasonable idea i can try and implement?
  • Does that seem reasonable or you want me to try and find a more optimal solution?
  • “Is it alright to write up this more naive solution or do you want me to try and find a more optimal solution?”
  • “So it feels like one way to go about this is using a graph to model the relationships between the different units”
  • “at a high level, let’s say that…”
  • “Are there kind of like 2 different steps…?”

Pure Data Structure and Algorithms interview

These kind of interviews usually only have 1 or 2 solutions. They’re just trying to see if you’re going to get the solution pretty quickly.

General Formula that I came up with

The steps:

  • Cover the brute force solution
    • “The first idea I have is to”
  • Come up with an efficient solution based on observations you make
  • Ask the interviewer if you are on the right track
  • Ask if you can start coding up the solution
    • Test using your own test cases.
  • Ace it!

Tip: ALWAYS read the question CAREFULLY

The biggest mistake is probably misunderstanding the question. This shows that you don’t really pay attention to detail.

Tip: Check EDGE CASES

ALWAYS check for edge cases. When you come up with your solution, you should also account for these edge cases.

Personal Feedback

I say way too may Umms, it’s really annoying. Don’t UM.

Right now, I think I am strong on the algorithmic types of questions, because I had a lot of codeforces experience. However, when it comes to designing data structures like an LRU cache, I have trouble still.

The purpose of these interviews

The entire point of an interview for a developer is to assess whether you know what you are doing and why you are doing it.

You WILL be rejected if you don’t understand the trade offs, and that you were going to blindly write code without considering its impact on the wider codebase and teams.

Know what you don’t know

  • (with a smile) I’m not super sure the api

Practice

Problems I need to prep for:

  • Implement a memory allocator with support for allocating and deallocating memory blocks. You should simulate the behavior of malloc and free, ensuring efficient reuse of freed memory.
  • Create an in-memory database system that supports basic SET, GET, and DELETE operations for key-value pairs, as well as transactions with BEGIN, COMMIT, and ROLLBACK functionality.
  • Design a circular buffer that supports pushing and popping elements. Ensure that overwriting the oldest elements when the buffer is full is handled efficiently.
  • Implement a directory structure that allows you to create, delete, and move files and directories. The system should handle permissions and symbolic links.
  • Create a rate limiter that allows requests up to a certain threshold within a given time window (e.g., 100 requests per minute) and blocks or throttles additional requests.
  • Implement a basic distributed task scheduler that assigns tasks to workers, keeps track of completed tasks, and reschedules tasks that fail due to worker crashes.
  • Implement a class to handle very large numbers (e.g., for arbitrary-precision arithmetic). Support addition, subtraction, multiplication, division, and modulo with numbers far beyond the limits of built-in types.