MockReal Logo
Home
BlogPricing
For Employers β†’
  1. Home
  2. Questions
  3. What is the difference between XOR and OR?

What is the difference between XOR and OR?

TechnicalSenior php developerPHP DeveloperWeb DeveloperSoftware Engineer

XOR and OR are both logical operators, but they function differently. OR returns true if at least one operand is true, while XOR returns true only if one operand is true and the other is false. For example, in a binary context:

  • 0 OR 0 = 0
  • 0 OR 1 = 1
  • 1 OR 1 = 1
  • 0 XOR 0 = 0
  • 0 XOR 1 = 1
  • 1 XOR 1 = 0

This distinction is crucial in programming, especially in conditions where exclusive choices are necessary.

More Questions

  • Can you give me an example of a problem that wasn't easily solved by a simple Google search, and how did you eventually resolve that problem?
  • Describe what late binding is and how it works in PHP.
  • Explain the difference between GET and POST HTTP methods.
  • How do sessions work internally?
  • How do you create a function that can work with different types of an object that share a parent class?
  • How do you explicitly cast an object to another type of object with the same parent class?
  • What are some ways to find a missing number in an array of 1 to 100?
  • What has been your most enjoyable project to date and why?
  • What is the difference between a class and an object?
  • What is the difference between single quotes and double quotes in PHP, and why use either one?
MockReal Logo

Spoken interview practice for technical professionals

Product

  • Pricing
  • Questions
  • Positions
  • Resumes
  • For Employers β†’

Company

  • Careers
  • About Us
  • Contact
  • Blog

Legal

  • Privacy Policy
  • Terms of Service
  • Cookie Policy

Β© 2025 MockReal. Spoken interview practice. All rights reserved.