Step 1: Define variables and total travel time.
Rahul travels from 5 pm to 11 pm, so the total scheduled travel time is:
\[
6 \text{ hours}.
\]
Let:
\[
v = \text{initial speed (km/h)}, \quad S = \text{total distance (km)}.
\]
If he goes at constant speed \(v\) for 6 hours:
\[
S = 6v.
\]
Suppose he travels for \(t\) hours at speed \(v\) before stopping.
Step 2: First scenario (20-minute stop, speed increased by 3 km/h).
He:
travels for \(t\) hours at speed \(v\),
stops for 20 minutes \(= \dfrac{1}{3}\) hour,
then travels the remaining distance at speed \(v + 3\) km/h.
Distance covered before stop: \(vt\).
Remaining distance: \(S - vt = 6v - vt\).
Time for remaining distance:
\[
\frac{6v - vt}{v + 3}.
\]
Total time must still be 6 hours:
\[
t + \frac{1}{3} + \frac{6v - vt}{v + 3} = 6.
\]
Rewriting:
\[
\frac{6v - vt}{v + 3} = 6 - t - \frac{1}{3} = \frac{17}{3} - t. \quad \cdots (1)
\]
Step 3: Second scenario (30-minute stop, speed increased by 5 km/h).
Now he stops 10 minutes more, so the stop is 30 minutes \(= \dfrac{1}{2}\) hour, and then increases speed by 5 km/h (to \(v + 5\)).
Similarly,
\[
t + \frac{1}{2} + \frac{6v - vt}{v + 5} = 6
\Rightarrow
\frac{6v - vt}{v + 5} = 6 - t - \frac{1}{2} = \frac{11}{2} - t. \quad \cdots (2)
\]
Step 4: Use a common expression.
Let:
\[
K = v(6 - t) = 6v - vt.
\]
Then from (1) and (2):
\[
\frac{K}{v + 3} = \frac{17}{3} - t,
\qquad
\frac{K}{v + 5} = \frac{11}{2} - t.
\]
Equating the two expressions for \(K\):
\[
\left(\frac{17}{3} - t\right)(v + 3)
=
\left(\frac{11}{2} - t\right)(v + 5).
\]
Solving this equation for \(t\) in terms of \(v\) gives:
\[
t = \frac{21}{4} - \frac{v}{12}.
\]
Step 5: Substitute back to find \(v\).
Using (1) with \(K = v(6 - t)\) and the expression for \(t\), we get:
\[
v = 15.
\]
So the initial speed of Rahul was:
\[
\boxed{15 \text{ km/h}}.
\]