The most common obstacles are squared-off extensions into a room that, though of irregular lengths, are still cornered at the same right angles the room is. Just cut the moldings to size for these type of obstacles, leaving enough overhang to cut the edge of the moldings at the same 45-degree angles you use for room corners while keeping them flush where they join.
Some obstacles, such as a full-length bayed window area, are not set at typical right angles. To mold around these, size the moldings to fit, adjusting the angles at which you must cut them to keep them flush. Use a soft pencil to mark off the angle of the overhang you will cut to fit the ends of the moldings together at these edges.
If a wall has a curve or you have to mold around a cylindrical pillar, you have three common options. You can use a soft plastic-style molding that will form to fit the curve. In the case of a pillar, you can square off the area immediately around it and install a different type of flooring, such as tile, inside the squared-off area. Use laminate molding for the transition between the hardwood flooring and the tiled flooring in the square. Laminate molding is commonly used with hardwood floors as a transition between flooring types. The third option is wood molding, but it will have to be custom made from a wood shop after having the obstacle carefully measured.