Google Onsite | Round 3 | L4 | India

Anonymous User
17
Nov 05, 2024

The interview began with a technical issue lasting 10 minutes, as the document didn't open. We both agreed to proceed by coding in Google Docs.

Got this question : https://leetcode.com/discuss/interview-question/342129

Create a class LightString to manage a string of lights, each of which has a value 0 or 1 indicating whether it is on or off.

class LightString {

	/**
	* Return if the i-th light is on or off. 
	*/
    public boolean isOn(int i) {
	}

	/**
	* Switch state (turn on if it's off, turn off if it's on) of every light in the range [start, end].
	*/
    public void toggle(int start, int end) {
	}
}

Before starting the interview, I asked several questions, such as the size of the input, but the interviewer kept emphasizing that the input was very large. As a result, I switched from using an array to an unordered_map and did dynamic initialization during toggle. I made mistakes while initializing the bulbs because they weren't initialized by default.

I also mentioned using a segment tree approach for optimization, but the interviewer disagreed, noting that not all bulbs were initialized.

Not sure what is expected, question was easy, but constraint was difficult

I had an interviewer from another country, likely because it was a festival week in India.

will I get Lean hire or hire or Lean no hire for this round ?

Comments (0)