Network Engineer Interview Question

What is BGP used for, and how is it different from OSPF?

What the interviewer is probing, how to structure your answer, and a spoken example you can adapt.

Quick answer

BGP is the routing protocol of the internet. It exchanges routes between autonomous systems, such as an organisation and its internet providers, and is built for scale and policy rather than fast convergence. It is a path-vector protocol running over TCP port 179, choosing routes using attributes such as local preference, AS path length and MED. OSPF is a link-state protocol for routing inside one organisation, choosing paths by cost.

Why interviewers ask this

Entry- and mid-level engineers are not expected to be BGP experts, but they should know what it is for and how it differs from interior protocols. The interviewer is checking that you understand autonomous systems, the difference between external and internal BGP, and that BGP decisions are driven by policy. How an organisation uses BGP with two internet providers for resilience is a common practical follow-up.

How to structure your answer

  • Explain where BGP is used and what an autonomous system is.
  • Describe it as a path-vector protocol over TCP.
  • Explain attribute-based, policy-driven route selection.
  • Contrast it with OSPF and give a practical use.

Example answer

Spoken example, first person

BGP is how separate networks exchange routes. Each organisation or provider is an autonomous system with its own number, and BGP carries routes between them. It is a path-vector protocol: each route carries the list of autonomous systems it has passed through, which is used both to prevent loops and as a selection factor. Peers are configured manually and the sessions run over TCP port 179, so unlike OSPF there is no automatic neighbour discovery. External BGP runs between different autonomous systems and internal BGP within one. Route selection is driven by attributes, so engineers apply policy, for example raising local preference to make one provider the preferred exit, or prepending the AS path to make inbound traffic favour the other link. OSPF, by contrast, runs inside one network, finds neighbours itself and picks the lowest-cost path. The most common place I see BGP in an enterprise is dual homing to two internet providers, for automatic failover and some control over which link carries which traffic.

Walking into this interview soon? GhostPilot listens to your live call, spots the question the moment it is asked, and puts a structured answer on your screen in real time. Try it on your next mock, or grab a $29 Session Pass, no subscription, for the real thing.

See how it works

Follow-up questions to expect

  • How would you make inbound traffic prefer one of two providers?
  • Why do internal BGP peers usually need a full mesh or route reflectors?
  • What protects you from accepting bad routes from a provider?

Related network engineer questions

Your interviewer will ask their own version of this. Paste your actual job description into the free Question Predictor and get the 20 questions that role is most likely to ask, with what each one is really probing.

Predict my questions

Rehearse the hard questions before they are asked

Practise with a live copilot, then walk in ready. A $29 Session Pass gets you through the interview with no subscription and no lock-in.

Get GhostPilot