×

Loading...
Ad by
  • 推荐 OXIO 加拿大高速网络,最低月费仅$40. 使用推荐码 RCR37MB 可获得一个月的免费服务
Ad by
  • 推荐 OXIO 加拿大高速网络,最低月费仅$40. 使用推荐码 RCR37MB 可获得一个月的免费服务

there are two of problems when i got an interview.

hi, sailor,

do you think you can pass the interview by answering just like what you answered?Actually, there are the 2 questions that I am not sure I am right on.

I donot think your answers are enough. for example, the no1a) question. you didnot answer out the difference of structure.in an array, can you put a pointer type data and an interger data together? No need to speak, the pointer costs more memory.

the no 2 question, i mistook and thought that guy asked me the iterator template class. Could you give me another answer other than template class?

at last, you guess if i can passed the interview.

Thanks

Guest
Report

Replies, comments and Discussions:

  • 枫下家园 / 护照签证 / C++ questions
    hi, experts

    Who can answer the 2 questions?


    1)What is the difference between arrays and linked lists, in terms of:
    a.the relative memory locations of their elements?
    b.the kind of access allowed?
    c.the efficiency of insertions and deletions?
    d.the efficiency of traversing the entire container?

    2)What is an iterator?

    Thanks.
    • In my view, there are no experts at C++ for new immigrants . These questions are just basic problems. Maybe, all the C++ experts are in CHINA
      • I agree with you. C++ has many dark corners.
        But I don't think there are many C++ experts in China. Only those who contributed to the development of langauge can be counted as C++ expert.
    • Many C++ programmers know the answers, but few of them can give the full answer.
      Could you please offer us an answer by summarizing some book sections?
    • Let me try to answer the first one, based on my data stucture knowledge
      1,

      a,
      The elements of an array are stored together in consecutive addresses;

      The linked list members may be scattered in the variable area of the memory.

      b,
      Array allows you to access its elements randomly or consecutively; while no random access is available for linked lists' element.

      c,
      If you want to add new element into an array, you may probably use the "append" operation rather than "insert" --an insert-into-middle operation may take relatively long time;

      You can insert an element into a linked list in any place of the list, without big trouble.

      If you want to delete an element from an array --you caused a blackhole --or you have to spend big time to compress the array;

      To delete elements from linked list, it's very simple and easy and it takes a almost contant time.

      d,
      To traverse the whole container, it's faster in an array.
      • I discourage some questions
        In the job interview, you may be asked some boring questions such as

        1) What is an iterator?
        2) What is a cookie?
        3) What is a virtual function?
        4) What is a default constructor?
        5) Waht is polymorphism?
        6) What is EJB?
        7)What is URL Rewriting?
        ........

        If you are asked such questions, you had better search for answer from the books.
      • Sailor, you got 100. Why did you delete that guest's comments on my response? :-)-):
      • there are two of problems when i got an interview.
        hi, sailor,

        do you think you can pass the interview by answering just like what you answered?Actually, there are the 2 questions that I am not sure I am right on.

        I donot think your answers are enough. for example, the no1a) question. you didnot answer out the difference of structure.in an array, can you put a pointer type data and an interger data together? No need to speak, the pointer costs more memory.

        the no 2 question, i mistook and thought that guy asked me the iterator template class. Could you give me another answer other than template class?

        at last, you guess if i can passed the interview.

        Thanks

        Guest
        • I think it is not good to include current position in linkedlist.So it is better to have a class call iterator so a linkedlist can be share by multthreads which use a same linkedlist
          and the threads can insert or delete node in difference position of the linkedlist