If there is any digital wave coming with random 0s and 1s, how do you find the time difference between 2 successive 1s?

If there is any digital wave coming with random 0s and 1s, how do you find the time difference between 2 successive 1s?

How can we answer this question?

In reply to n347:

Your interview question has a lot of missing information, and perhaps your task was to ask for the missing pieces,

When you say “digital wave”, do you mean you are looking at a signal on a waveform viewer and want to measure time between two interesting events? Or do you want to write code that calculates the time difference, and if so, what do you want to do with that information?

And finally, when you say “between 2 successive 1’s”, do you mean the length of time the signal was 0 between being 1, or is there a synchronizing clock to sample your signal?