Baidu interview questions (Summary + update)

Source: Internet
Author: User

I don't think I can use a deep Algorithm for Baidu interview questions, but I have a flexible idea. I have already posted the source code of five solutions on the front. I thought I could end up here, today, another student said a strange idea but a method that fits the meaning of the question .. Please refer to the comments on the Baidu developer interview questions about the elimination of 85% million interviewees, @ apollokk.

I have also discussed several methods after optimization. If you haven't read the article, you can take a look At Baidu developer interview questions (optimization). For a summary of this article, you can refer: baidu developers interview questions (Summary), of course, this question is still to post the complete code of the Apollo KK Method, because the idea is not difficult, I will not talk nonsense (by the way, the output results are unordered, but the results match the meaning of the question ..

See the source code below:

public class Baidu6{public static void main(String[] args){StringBuilder result=new StringBuilder();                for (int i = 3; i <= 100; i += 3)                {                    if (i % 5 != 0)                        result.append(i + "*\r\n");                }                for (int i = 5; i <= 100; i += 5)                {                    if (i % 3 == 0)                    {                        result.append(i+ "*#\r\n");                    }                    else                    {                        result.append(i+ "#\r\n");                    }                }                System.out.println(result);}}

I have also sorted out the complete questions on www.marksaas.com on my blog. If you want to see the complete 6 methods (I just wrote them separately on csdn ), you can go to marksaas. If you have any mistakes, please correct them ..

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.