How to find if a number is a perfect square, interview questions and answers


A perfect square, or a square number, is a square of itself. This article reviews three example answers to this question, along with a detailed critique of each solution. Source code included.

What's included in the purchase

PDF file with the following:

  • Review of a poor response
  • Review of a mediocre response
  • Review of a good response
  • C/C++ source code for all examples


2 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