Doppel First Round

Doppel is a startup for detecting and taking down social engineering attacks for brands. They crossed Series B funding

The question

Problem Description
A board is made up of an M x N grid of cells, where each cell has an initial state:
- live (represented by a letter “O”), or
- dead (represented by a dot “.).

Each cell interacts with its eight neighbors (horizontal, vertical, diagonal) using the following four rules:
- Any live cell with fewer than two live neighbors dies as if caused by under-population.
- Any live cell with two or three live neighbors lives on to the next generation.
- Any live cell with more than three live neighbors dies, as if by overpopulation.
- Any dead cell with exactly three live neighbors becomes a live cell, as if by reproduction.

The next state is created by applying the above rules simultaneously to every cell in the current state, where births and deaths occur simultaneously.

Part 1: Implement the game

Implement the above logic and print the state of the board after each generation. You need to be able to run the simulation for K generations

Sample test case is provided from the interviewer which helps

Part 2: Do you notice any patterns in the new test cases

Interviewer provides some sample starting boards of their choice and has you run the state of the board. Any pattern you notice? Why do you think that pattern makes sense? Just use your brain to answer this question. Shouldn't require too much thought

Part 3: Infinite board

Look at the code you wrote. We assumed the board was finite. What if we wanted to run this code but for infinite board. What would you do to simulate an infinite grid with finite memory?

Part 4: Continuation of Part 2

Based on what you answered in part 2, how would you optimize the implementation

Reflection

  • Doppel's interview process is one example of a great process from a candidate experience. I felt my skills were effectively tested in that I wasn't asked any leetcode brainteasers.
  • The questions were geared towards fundamentals and critical thinking, which I thought is a solid compared to other places that are leetcode brained.
  • This question in particular is a fun question because you can tune it based on the level of candidate and talk about a very interesting problem. I was lucky the interviewer was collaborative and the discussion was meaningful
Comments (2)