Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6147415
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T19:06:23+00:00 2026-05-23T19:06:23+00:00

This is an interview question & I’m looking wht experts can answer in a

  • 0

This is an interview question & I’m looking wht experts can answer in a better way…

How do you sort an array containing million numbers in Java?

Thanks!

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-23T19:06:23+00:00Added an answer on May 23, 2026 at 7:06 pm

    Interview questions never have the right answer.
    The interviewers taught to ask open-end questions to see how you think and reason about problem.
    You, in your turn, should show process of thinking and demonstrate that you can think in “software engineering way”.

    Something like that:

    1. Oh … 1 million numbers …
    2. I think they are simple long so 1 million will take about 4 megabytes of memory
    3. (Hm … might be I am wrong here and the long will take 8 bytes so it will be 8 Mbytes … – it’s not so important right now for that problem).
    4. We are able to load it to the memory and use ready algorith Arrays.sort(long[])
    5. (I do know my tools and core libs).
    6. It will be no extra memory and O(n*log(n)) complexity (6 000 000 operations btw).
    7. Can you do it faster ?
    8. Oh … I remember that I heard about Radix sort – that algorithm gives us o(k*n) complexity where the k is number of significant ditigs (for long it will be twice as integer (2 billion = 9 digits) = 18 digits) so it will be 18 * 1 million = oh … it will be 3 times slower and I am not sure how much additional memory the algorithm will require.
    9. If we have so much data that it will overflow the available memory?
    10. We will chop data into l chunks size of m so each of chunks will fit into memory
    11. We will sort each chunk separatedly and store results to files
    12. Merging of sorted files will be with o(m) speed
    13. And we will need to perform l-1 such merges
    14. etc.
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

This is an interview question There is an array of integers. The elements in
This was an interview question. Given Visual Studio 2008 and an icon saved as
I was browsing Scott Hanselman's Developer Interview question list , and ran across this
I was asked this question in a job interview. The interviewer and I disagreed
I was asked this question during an interview. They're both O(nlogn) and yet most
This was an job placement interview I faced. They asked whether we can realloc
This is also one of the interview question i have faced recently. Description :
I have faced this question in my Interview as well. I do have many
Two days ago I was asked this question in an interview for Data Analyst
I am preparing for my interview tomorrow -- I need the answer to this

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.