Does this question have two answers correct? 
A simple pendulum (whose length is less than that of a second's pendulum) and a second's pendulum start swinging in phase. They again swing in phase after an interval of $18$ seconds from the start. The period of the simple pendulum is
(A) $0.9$ sec
(B) $1.8$ sec
(C) $2.7$ sec
(D) $3.6$ sec

I was given a formula for such questions:
$$T = \frac {T_1 T_2} {T_1-T_2} \qquad (T_1>T_2)$$
where $T_1$ and $T_2$ are the time periods of the individual pendulums, and $T$ is the time after which they are in phase again.
I took $T_1$ as the seconds pendulum, i.e., $T_1=2$ seconds.
Using the formula, I got $T_2=1.8$ sec, which makes sense; the timestamps for each oscillation are:
$$1.8\ \ 3.6\ \ 5.4\ \ 7.2\ \ 9.0\ \ 10.8\ \ 12.6\ \ 14.4\ \ 16.8\ \ 18.0$$
seconds for simple pendulum, and $2, 4, 6, 8, 10, 12, 14, 16, 18$ seconds for seconds pendulum. None of these overlap, so if $T_2=1.8$, the pendulums swing in phase after intervals of $18$ seconds.
However, I also tried option A, and got the timestamps as:
$$0.9\ \ 1.8\ \ 2.7\ \ 3.6\ \ 4.5\ \ 5.4\ \ 6.3\ \ 7.2\ \ 8.1\ \ 9.0\ \ 9.9\ \ 10.8\ \ 11.7\ \ 12.6\ \ 13.5\ \ 14.4\ \ 15.3\ \ 16.2\ \ 17.1\ \ 18$$
seconds for simple pendulum, and $2, 4, 6, 10, 12, 14, 16, 18$ seconds for seconds pendulum. Again, none of these overlap, so if $T_2=0.9$ seconds also, the pendulums swing in phase after intervals of $18$ seconds.
According to the answer key, the answer is only B. Is A also correct, or am I missing something?
 A: Good work, but your issue is that you're taking too narrow a view of what "swinging in phase" means. To be in phase, the two pendulums simply need to be at the same point in their cycle -- meaning at the same angle and swinging in same direction. What you're doing with your timestamps approach is to identify only those instants when the two pendulums have returned exactly to their starting position at the same time.
And they will definitely be in phase when they are both back at their starting positions at the same time (since the problem specified that they started off in phase), but the trick is that they could also be in phase at points before that as well.
Imagine a pendulum with a period of 10 seconds, and one with a period of only 1 second:

*

*After 1 second, P2 will have returned to its starting position, while P1 will have only traveled through 10% of its 10-second cycle. So P2 is about to catch up to P1 -- they're about to have another moment when they're in phase again (with P2 basically doing all the work).

*Another 0.1 seconds after that (1.1s total), P2 will have gone from back to its starting point to 10% through its 1-second cycle, while P1 will only be 11% through its cycle

*Another 0.01 seconds after that (1.11s total), P2 will be 11% through its cycle, while P1 is 11.1% through its cycle.

*You can see where this is headed -- P2 will "catch" P1 for the first time at 1.111111...s (aka 10/9 seconds).

You can validate that from your formula: T2*T1/(T2-T1) = 10*1/(10-1) = 10/9 = 1.11111...
So these two are going to be in phase every 10/9 seconds. But they're not going to be at their starting point when they go back into phase; the first time they're in phase will be 1/9 of the way through the cycle.
Do you see how that's different from what you were looking at? You were only looking for points where the two pendulums have done complete cycles and checked to see if they're in phase.
Your method is equivalent to finding the smallest time period that is an integer multiple of both pendulums' periods. That will get them both in phase AND at their starting point, for the first time, but being at starting point isn't a necessary condition for being in phase. In my example, where the periods are 1s and 10s, the equivalent time (the first time they're both back in phase at the end of a complete cycle) is 10s (since for P1, 10*1 = 10 and for P2, 1*10=10). At that point, P1 has completed exactly one cycle, P2 has completed 10 cycles, and it's the 9th time (because 10/1.11... = 9) that they've been back in phase with each other.
In your question, with P1 of 2s and P2 of 0.9s, the "beat frequency" (amount of time to return to phase) is = 2*0.9/(2-0.9) ~= 1.63 seconds. You correctly identify 18s as the least common multiple of the two periods. At 18s they'll both be back at their starting points and in phase, at the end of the 9th complete cycle for P1, the 20th complete cycle for P2 -- and it's the 11th time (18/1.63) that they've returned to phase with each other.
With P1 of 2s and P2 of 1.8s, the "beat frequency" is 2*1.8/(2-1.8) = 18 seconds, AND the least common integer multiple of the two periods also happens to be 18s. At 18s, P1 will have completed 9 cycles, P2 will have completed 10 cycles, and it will be the first time they're back in phase together.
You could argue the question is slightly ambiguous by saying "They again swing in phase after an interval of 18 seconds from the start" -- that is, it doesn't specify that "They, for the first time since the start, swing again in phase after an interval of 18 seconds from the start", but I think the "first time" part is pretty heavily implied.
A: In your analysis with the time stamps, you deduced that either answers (a) and (b) are possibly correct. See also helloworld's answer on how you can deduce further which of these is correct by again looking closer at the phase relationship.
But how you arrive at the correct answer lies in the not-so-obvious wording of the question. First, do you know what "a seconds pendulum" is? Your question reads:

A simple pendulum (whose length is less than that of a second's pendulum) and a second's pendulum

Note the words and a seconds pendulum. A seconds pendulum is a pendulum that has a period of precisely $2$ seconds. That is, one second per swing in one direction, or two seconds to complete a swing in both directions (one full period is two seconds)$^1$.
This means with $T_1=2\ \text{sec}$ and with $T=18\ \text{sec}$ to retain an in-phase relationship, gives the only possible correct answer of $T_2=1.8\ \text{sec}$. The answer cannot possibly be 0.9 sec. Nor can it be the other two possibilities (c) and (d).

$^1$From the wording of the question alone, you can deduce that the only possible answers are (a) and (b), since "the length is less than that of a second's pendulum" or less than 2 seconds, since we know that the period of a simple pendulum is proportional to $l^{\frac 12}$. And one could have even deduced the correct answer from this information alone. The equation you quoted is a transpose of the equation $$\frac 1T=\frac 1T_1-\frac 1T_2$$ and by adding $\frac{1}{18}$ and $\frac 12$ $(=\frac{9}{18})$ to each other and then just flipping the fraction to get 1.8 seconds.
A: Let's look at the equations
$$x_1(t)=\sin\left(\frac{2\pi}{T_1}\,t\right)\\
x_2(t)=\sin\left(\frac{2\pi}{T_2}\,t\right)$$
for  $~t=T~$ is $~x_1(T)=0~$ only if
$~\frac {T}{T_1}=1,2,\ldots n~\quad$
and   $~x_2(T)=0~$ only if
$~\frac {T}{a\,T_2}=1,2,\ldots n~$
with
$~T=\frac{T_1\,T_2}{T_1-T_2}=\frac{2*1.8}{2-1.8}=18~$ thus
$$a=1~,T_2\mapsto 1.8\quad ,n=\frac{18}{1.8}=10~\surd\\
a=\frac 12~,T_2\mapsto \frac 12*1.8=0.9\quad ,n= \frac{18*2}{0.9}=40~\surd\\
a=2~,T_2\mapsto 2*1.8=3.6\quad ,n=\frac{18}{3.6}=5~\surd $$


I don't think that you need the formula $~T=\frac{T_1\,T_2}{T_1-T_2}~$ .
for a given period  $~T,~\frac {T}{T_1}~$ must be integer.
the period $~T_2=\frac{T}{n}~$ and for $~T_2 \le T_1=2\quad \Rightarrow n\gt \frac T2$
Example
$$T=18~,n\gt 9\\
T_2=\left[\frac 95,{\frac {18}{11}},\frac 32,{\frac {18}{13}},{\frac {9}{7}},\frac 65,{\frac {
9}{8}}\,\ldots\right]
$$
A: The key point that's overlooked in the timestamp-counting method is that having the pendulums be in sync at the end of complete periods is not the only way for them to be in phase - they can also happen to be in phase in the middle of a period. In particular, for this example, note that after $\frac{18}{11}$ seconds, the $0.9$-second-period pendulum and the $2$-second-period pendulum will be $\frac{9}{11}$ of the way through a period (try dividing $\frac{18}{11}$ seconds by each of their periods and verify for yourself). By looking only at timestamps of complete periods, the timestamp-counting method misses out this point (earlier than $18$ seconds) where they came back in phase.
I'd highlight that this means care is needed to derive the $\frac{T_1 T_2}{T_1 - T_2}$ formula - for example, it's not enough to just solve for the times when the pendulums have the same (angular) position, because there are many earlier times where this happens, but requiring that the pendulums are in phase is a much stronger condition. Also, one has to explicitly use the fact that we are interested in the first time they are back in phase, because it's true that the $0.9$-second-period pendulum and the $2$-second-period pendulum are in phase after $18$ seconds - the tricky thing is that there was an earlier time where they were already in phase. Basically, the correct way to derive that formula would be to say we are solving for the earliest time $t$ such that the difference between $t/T_1$ and $t/T_2$ is an integer.
For the explicit derivation: the pendulums are in phase at time $t$ if and only if $t/T_1 - t/T_2 = n$ for some integer $n$. Solving for $t$ yields
$$t = n \frac{T_1 T_2}{T_1 - T_2},$$
and hence we see that they are in phase whenever $t$ is an integer multiple of $\frac{T_1 T_2}{T_1 - T_2}$ (to restrict to positive $t$, take $T_1 > T_2$ and $n>0$ without loss of generality). In particular, the first positive $t$ at which this occurs is clearly when $n=1$, i.e. $t=\frac{T_1 T_2}{T_1 - T_2}$ as claimed.
A: My goodness the other answers are woefully overcomplicating this.
The question says

A simple pendulum (whose length is less than that of a second's pendulum)

The length of the pendulum is less than that of a second's pendulum. Therefore it will swing faster, therefore it will have a shorter period than $1s$. Only one answer has a period less than $1s$.

More generally, equate $18$ swings of the 'second's pendulum' with some integer number of swings of the other pendulum:
$$ 18 s = n T $$
It is generally assumed, by the wording, that they were in sync only after $18s$ and no sooner than that. In this case, it must be that
$$ \gcd(18,n) = 1.$$
You're also told that the simple pendulum is shorter than the second's pendulum. Therefore it swings faster, with shorter period, and $n>18$.
Therefore, $n>18$ with $\gcd(18,n) = 1$. The smallest valid $n$ is $19$, which implies a period of
$$T = \frac{18s}{n} = \frac{18s}{19} \approx 0.947s \approx 0.9s$$
In principle the answer could also be $n=23, 25, 29, \dots$ . However, the question only offers one choice for $n>18$, i.e. $T<1s$, so that's the only choice.

You might say that the 'second's pendulum' has a period of $2s$. Unless the question specifically states that a second's pendulum has a period of $2s$, or if you were taught this specific fact, I think it is a coincidence that the term 'second's pendulum' refers to a pendulum with a specific period of $2s$; common parlance would assume it would have a period of $1s$.
If you insist on the $2s$, then we have
$$18 \times 2s = nT$$
with $\gcd(18,n) = 1$ and $n>18$.
The answers are the same, except multiplied by $2$.
For $n=19$ we have
$$ T \approx 1.89s \not \approx 1.8s$$
For $n=23$ we have
$$ T \approx 1.57s$$
...and subsequent choices will have a lower period $T$. There is one correct choice, which is $n=41$ which gives $T \approx 0.88s \approx 0.9s$ so, the answer is again A.
The only correct answer is A.
