Pass by value or reference in C#, interview questions and answers


There are 3 ways a parameter can be passed into a function: value, reference (with keyword ref), and reference (with keyword out). This article reviews the differences of these three approaches, including sample C# code and review of code output.

What's included in the purchase

PDF file with the following:

  • Intro to differences between pass by value, reference (with keyword ref) and reference (with keyword out)
  • C/C++ source code
  • Explanation around differences in output


3 pages



About the author 

The author has over 15 years of experience as architect and engineering director for several Fortune 500 companies.  He loves programming interviews and writes frequently on the topic.  Here are some additional details about the author:

- Expert in C#, .NET, ASP.NET, XML, XSLT, enterprise JAVA and client side technologies

- Extensive experience in C, C++, VB.Net, ASP, UML, Design Patterns and SEO

- Proficient in major databases including Microsoft SQL Server and Oracle

- In-depth knowledge of cloud providers including Amazon AWS and Microsoft Azure

- Clear understanding of all 3 major mobile platforms – iOS, Android and Windows Phone