Interview Questions for Alibaba software's recruitment of senior Java engineers

Source: Internet
Author: User
1. The two objects have the same value (X. Equals (y) = true), but different hash codes are available, right? Why?
2. What is GC? Why does GC exist?
3. Could you briefly describe the hierarchy of Class Loader in J2EE applications?
4. Write a piece of code to implement the bank transfer function:
The interface is defined as follows:
Public interface itransfer {
/**
* For internal bank transfers, the transfer amount is deducted from the transfer-out account, and the transfer amount is added to the transfer-in account. The above two operations must be ensured.
* Either succeed at the same time or fail at the same time
* Fromaccountid: transfer out account
* Transfer outaccountid to the account
* Amount transfer amount
**/

Public void transferinner (string fromaccountid, string outaccountid,
Bigdecimal amount );
/**
* External transfer-transfer, deduct the transfer amount from the transfer account
* Fromaccountid: transfer out account
* Amount transfer amount
**/
Public void transferout (string fromaccountid, bigdecimal amount );
/**
* External transfer-transfer to add the transfer amount to the transfer account
* Transfer toaccountid to the account
* Amount transfer amount
Public void transerin (string toaccountid, bigdecimal amount );
}
Compile your implementation class to implement the above interface
Account table
Field: accountid, primary key varchar2 (32), user account
Field: amount, amount number)
5. "combination is better than inheritance". Do you agree to this sentence and describe your point of view.
6. Let's talk about the similarities and differences between the template mode and the Strategy Mode.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.