Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
CODE PROJECT For Those Who Code
  • Home
  • Articles
  • FAQ
Community
  1. Home
  2. General Programming
  3. C / C++ / MFC
  4. Challenging Interview Question

Challenging Interview Question

Scheduled Pinned Locked Moved C / C++ / MFC
algorithmsdata-structurestutorialquestioncareer
8 Posts 8 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • A Offline
    A Offline
    AryaSoft
    wrote on last edited by
    #1

    Write the code/algorithm for function "int* minChangeMac(int cents, int* cDenoms, int* cCounter)" where minChangeMac converts cents into elements of cDenoms and returns a pointer to an array cCounter such that sum of elements in cCounter array is the minimum possible number. example 1: if cents = 56 and cDenoms = [25, 10, 5, 1] then cCounter = [2, 0, 1, 1] example 2: if cents = 31 and cDenoms = [25, 10, 1] then cCounter should be [0, 3, 1] and not [1, 0, 6]

    T T R H C 6 Replies Last reply
    0
    • A AryaSoft

      Write the code/algorithm for function "int* minChangeMac(int cents, int* cDenoms, int* cCounter)" where minChangeMac converts cents into elements of cDenoms and returns a pointer to an array cCounter such that sum of elements in cCounter array is the minimum possible number. example 1: if cents = 56 and cDenoms = [25, 10, 5, 1] then cCounter = [2, 0, 1, 1] example 2: if cents = 31 and cDenoms = [25, 10, 1] then cCounter should be [0, 3, 1] and not [1, 0, 6]

      T Offline
      T Offline
      toxcct
      wrote on last edited by
      #2

      AryaSoft wrote:

      Write the code

      i generally don't like these kind of question, because they traduce a lazy person asking for other to do it's homework


      You don't know where to start ? ask a good friend

      [VisualCalc 3.0][Flags Beginner's Guide]

      D 1 Reply Last reply
      0
      • A AryaSoft

        Write the code/algorithm for function "int* minChangeMac(int cents, int* cDenoms, int* cCounter)" where minChangeMac converts cents into elements of cDenoms and returns a pointer to an array cCounter such that sum of elements in cCounter array is the minimum possible number. example 1: if cents = 56 and cDenoms = [25, 10, 5, 1] then cCounter = [2, 0, 1, 1] example 2: if cents = 31 and cDenoms = [25, 10, 1] then cCounter should be [0, 3, 1] and not [1, 0, 6]

        T Offline
        T Offline
        ThatsAlok
        wrote on last edited by
        #3

        AryaSoft wrote:

        Challenging Interview Question

        do you passed in that interview or not

        "Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow

        cheers, Alok Gupta VC Forum Q&A :- I/ IV Support CRY- Child Relief and you

        1 Reply Last reply
        0
        • A AryaSoft

          Write the code/algorithm for function "int* minChangeMac(int cents, int* cDenoms, int* cCounter)" where minChangeMac converts cents into elements of cDenoms and returns a pointer to an array cCounter such that sum of elements in cCounter array is the minimum possible number. example 1: if cents = 56 and cDenoms = [25, 10, 5, 1] then cCounter = [2, 0, 1, 1] example 2: if cents = 31 and cDenoms = [25, 10, 1] then cCounter should be [0, 3, 1] and not [1, 0, 6]

          R Offline
          R Offline
          Rajesh R Subramanian
          wrote on last edited by
          #4

          :zzz:

          1 Reply Last reply
          0
          • A AryaSoft

            Write the code/algorithm for function "int* minChangeMac(int cents, int* cDenoms, int* cCounter)" where minChangeMac converts cents into elements of cDenoms and returns a pointer to an array cCounter such that sum of elements in cCounter array is the minimum possible number. example 1: if cents = 56 and cDenoms = [25, 10, 5, 1] then cCounter = [2, 0, 1, 1] example 2: if cents = 31 and cDenoms = [25, 10, 1] then cCounter should be [0, 3, 1] and not [1, 0, 6]

            H Offline
            H Offline
            Hamid Taebi
            wrote on last edited by
            #5

            You can write your code and if you have any problem then ask


            WhiteSky


            1 Reply Last reply
            0
            • A AryaSoft

              Write the code/algorithm for function "int* minChangeMac(int cents, int* cDenoms, int* cCounter)" where minChangeMac converts cents into elements of cDenoms and returns a pointer to an array cCounter such that sum of elements in cCounter array is the minimum possible number. example 1: if cents = 56 and cDenoms = [25, 10, 5, 1] then cCounter = [2, 0, 1, 1] example 2: if cents = 31 and cDenoms = [25, 10, 1] then cCounter should be [0, 3, 1] and not [1, 0, 6]

              C Offline
              C Offline
              Christian Graus
              wrote on last edited by
              #6

              Sounds like fun, what was your answer ?

              Christian Graus - Microsoft MVP - C++ Metal Musings - Rex and my new metal blog

              1 Reply Last reply
              0
              • A AryaSoft

                Write the code/algorithm for function "int* minChangeMac(int cents, int* cDenoms, int* cCounter)" where minChangeMac converts cents into elements of cDenoms and returns a pointer to an array cCounter such that sum of elements in cCounter array is the minimum possible number. example 1: if cents = 56 and cDenoms = [25, 10, 5, 1] then cCounter = [2, 0, 1, 1] example 2: if cents = 31 and cDenoms = [25, 10, 1] then cCounter should be [0, 3, 1] and not [1, 0, 6]

                R Offline
                R Offline
                Rage
                wrote on last edited by
                #7

                :zzz:

                ~RaGE();

                I think words like 'destiny' are a way of trying to find order where none exists. - Christian Graus

                1 Reply Last reply
                0
                • T toxcct

                  AryaSoft wrote:

                  Write the code

                  i generally don't like these kind of question, because they traduce a lazy person asking for other to do it's homework


                  You don't know where to start ? ask a good friend

                  [VisualCalc 3.0][Flags Beginner's Guide]

                  D Offline
                  D Offline
                  David Crow
                  wrote on last edited by
                  #8

                  You have to give the guy points for being honest, however, that it was an interview question.


                  "Approved Workmen Are Not Ashamed" - 2 Timothy 2:15

                  "Judge not by the eye but by the heart." - Native American Proverb

                  1 Reply Last reply
                  0
                  Reply
                  • Reply as topic
                  Log in to reply
                  • Oldest to Newest
                  • Newest to Oldest
                  • Most Votes


                  • Login

                  • Don't have an account? Register

                  • Login or register to search.
                  • First post
                    Last post
                  0
                  • Categories
                  • Recent
                  • Tags
                  • Popular
                  • World
                  • Users
                  • Groups