Sign in

Solutions to programming interview questions at some of the top companies in the world: cppcodingzen.com

Problem:

Solution:

  1. It doesn’t fit in any of the standard-bucket algorithmic techniques, like hashing, graph traversal, etc.
  2. The simplest/inefficient solutions can be easily found and coded, but…


Problem:


Problem:

  • “10”, a positive integer
  • “-10”, a negative integer
  • “10.1”, a positive real number
  • “-10.1”, a negative real number
  • “1e5”, a number in scientific notation
  • “a”
  • “x 1”
  • “a -2”
  • “-”

Solution:


Problem:


Problem:


Problem:

Input : arr[] = {4, 8, 12, 16} 
Output : Maximum AND value = 8
Input : arr[] = {4, 8, 16, 2}
Output : Maximum AND value = 0

Solution 1: Naive approach


Problem:

Solution 1: Pointer Management




Problem

CppCodingZen

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store