Given a set of intervals on the real line, compute the largest subset of pairwise intersecting intervals (an interval in the subset must intersect with every other interval in the subset). Design a greedy algorithm that computes an optimal solution.
First, suppose the intervals $[l_1,r_1],\ldots,[l_n,r_n]$ are pairwise intersecting, then we have $l_i\le r_j$ for any $i,j$, which means for any $i$, $l_i\le\max_k l_k\le r_k$, i.e. all these intervals contain the point $\max_k l_k$.
The observation above leads to the algorithm mentioned in jaxa 9831's answer:
First, sort the intervals according to their left endpoints. Then at each left endpoint, check how many intervals cross that point. Finally, report the optimal one.
To efficiently find the point that maximum intervals cross, we can use an algorithm mentioned in GeeksforGeeks. Roughly speaking, we first sort all endpoints, and maintain a counter initialized with 0. We then travel these endpoints from left to right. Each time we come across a left endpoint, we increase the counter by 1, while each time we come across a right endpoint, we decrease the counter by 1. The maximum value of the counter represents the maximum number of pairwise intersecting intervals.