Baidu developer interview questions (Summary)

Source: Internet
Author: User

My opinion on this question is that I cannot use advanced algorithms, that is, the idea is flexible, there are many ideas, and I have learned a lot from it. If this is the first time you read this article, please first read:Views on Baidu developer interview questions for 85% million interviewees eliminatedI also mentioned optimization. Many of my friends always make mistakes in the optimized code. I finally posted the optimized source code. Please referOne Baidu developer interview question (updated) that eliminated 85% million interviewers), I will also mention the classes used for optimization later. Please referStringBuilder and StringBuffer parsing (required for Baidu interview optimization)If you have previously written optimized code, see:Baidu developer interview questions (optimized)Today, we suddenly have another new idea. We only need to make two judgments, but the code is more intuitive. I will not say much about the other. I must have already made it clear before, if you have any questions, please feel free to discuss them ..

Public class Baidu5 {public static void main (String [] args) {StringBuilder result = new StringBuilder (); for (int I = 1; I <= 100; I ++) {result. append (I % 3 = 0? "*": ""); Result. append (I % 5 = 0? "#": ""); System. out. print (result. length ()> 0? I: ""); System. out. println (result); result. setLength (0 );}}}



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.