Q:

Can SharePoint code interact with a remote SharePoint server

We plan on having some scheduled services run alongside our SharePoint environment.  These services include pulling data from a remote system into SharePoint, and sending out timed notifications based on SharePoint data.  Hence, the code in the service (either in a Windows service or a scheduled console application) will be interacting with the SharePoint server. 
Is it possible to run SharePoint code against a SharePoint server, with that code not residing on the SharePoint server itself.  The simple setup would look like this:

I ask this question, because I watched a tutorial recently that claimed the SharePoint code needed to reside on the SharePoint server itself (i.e. you couldn't connect to the SharePoint server remotely in the code)
The SharePoint installation is SharePoint 2013, on-premise. 

A:

The code needs to run in the SharePoint server only when it is written in Server Object Model code.  In SharePoint 2010 on wards a new api called client object model code was introduced.  This allows the code to run from non SharePoint server.  However, it is not as Powerful as server object model code.  Prior to SP 2010, this usually used to be achieved through SharePoint web services.