Topics | Search Log Out | Register | Edit Profile
Hide Clipart | Banned/Unbanned User Log | Moderator Login History | Thread Delete/Move Log | Last 30 mins | 1 | 2
Programming question

Chalanachithram.com DB » New TF Industry Related » Archive through June 15, 2016 » Programming question « Previous Next »
Author Message
 

Gotcha
Megastar
Username: Gotcha

Post Number: 24755
Registered: 02-2008
Posted From: 172.87.48.134

Rating: N/A
Votes: 0 (Vote!)

Posted on Wednesday, June 15, 2016 - 12:52 pm:       


Kuyyo_morro:


fibonacci serires ki algorith kuda aduguataru adi okati prepare avu
chess design ela chestaru in OOPS adi okati adugutaru.
...
 

Sannayi_nokkulu
Side Hero
Username: Sannayi_nokkulu

Post Number: 8991
Registered: 06-2014
Posted From: 68.100.234.172

Rating: N/A
Votes: 0 (Vote!)

Posted on Wednesday, June 15, 2016 - 12:07 pm:       

there are libraries for ex in python there is a prime number library where it maintians the list, gmpy2
sachipotava , avineethi ga batukutava okkate option ante alochinchakunda chachipotaa ane type cbn - OT
 

Sesani
Legend
Username: Sesani

Post Number: 42365
Registered: 08-2014
Posted From: 207.140.166.10

Rating: N/A
Votes: 0 (Vote!)

Posted on Wednesday, June 15, 2016 - 10:16 am:       


Thikka_sankara:

joke kaadu, you have to come up with a list of prime nbrs....


lol... infinity ante saripotundi kada :D
 

Digitalspy
Junior Artist
Username: Digitalspy

Post Number: 658
Registered: 08-2013
Posted From: 43.241.122.149

Rating: N/A
Votes: 0 (Vote!)

Posted on Wednesday, June 15, 2016 - 10:02 am:       


Kuyyo_morro:

How to find out if a number is a prime number or not. But using less memory for the application. i.e. for i=1 to (n-1) loop pettakunda edanna shortcut unda if we are running for a number in some millions.




loop till square root of n
 

Thikka_sankara
Megastar
Username: Thikka_sankara

Post Number: 28103
Registered: 02-2012
Posted From: 106.207.254.111

Rating: 
Votes: 1 (Vote!)

Posted on Wednesday, June 15, 2016 - 08:30 am:       


Sesani:

adi joke..


joke kaadu, you have to come up with a list of prime nbrs....
Perhaps nobody has changed the course of history as much as the historians. ~Franklin P. Jones"
 

Thikka_sankara
Megastar
Username: Thikka_sankara

Post Number: 28101
Registered: 02-2012
Posted From: 106.207.254.111

Rating: N/A
Votes: 0 (Vote!)

Posted on Wednesday, June 15, 2016 - 08:29 am:       

Ok understood the question wrong.... It's not about finding list of primes but identifying if a given nbr is prime or not....

Of course, this will also end up finding all primes till then....
Perhaps nobody has changed the course of history as much as the historians. ~Franklin P. Jones"
 

Sesani
Legend
Username: Sesani

Post Number: 42359
Registered: 08-2014
Posted From: 207.140.166.10

Rating: N/A
Votes: 0 (Vote!)

Posted on Wednesday, June 15, 2016 - 08:28 am:       


Rajin:



Boston_baba:



Balu_gani:


adi joke... :-)
 

Bingo
Junior Artist
Username: Bingo

Post Number: 404
Registered: 11-2012
Posted From: 66.177.22.105

Rating: N/A
Votes: 0 (Vote!)

Posted on Wednesday, June 15, 2016 - 08:25 am:       


Kuyyo_morro:

less memory for the application. i.e. for i=1 to (n-1) loop pettakunda edanna shortcut unda




less memory or less time? }
 

Thikka_sankara
Megastar
Username: Thikka_sankara

Post Number: 28100
Registered: 02-2012
Posted From: 106.207.254.111

Rating: N/A
Votes: 0 (Vote!)

Posted on Wednesday, June 15, 2016 - 08:07 am:       


Jujung:

Without using any sophisticated algos, you only need to check divisibility in a loop upto sqrt(n) to know if it is prime or not. (Break the loop whenever it's divisible)


you can write exceptions to it, to save processing time.... Like a number ending with 0/2/4/6/8 need not be subject to diviswi wbility test.... Similarly, you can devise more rules , probably build rules as the algorithm progresses....

In general, primes are subject matter of interest for some of the best mathematicians in the world
Perhaps nobody has changed the course of history as much as the historians. ~Franklin P. Jones"
 

Jujung
Junior Artist
Username: Jujung

Post Number: 469
Registered: 02-2010
Posted From: 73.199.35.27

Rating: N/A
Votes: 0 (Vote!)

Posted on Wednesday, June 15, 2016 - 07:50 am:       

Without using any sophisticated algos, you only need to check divisibility in a loop upto sqrt(n) to know if it is prime or not. (Break the loop whenever it's divisible)
The folly of mistaking a paradox for a discovery, a metaphor for a proof, a torrent of verbiage for a spring of capital truths, and oneself for an oracle, is inborn in us.- Paul Valery
 

Leader
Comedian
Username: Leader

Post Number: 1557
Registered: 12-2012
Posted From: 131.107.174.38

Rating: 
Votes: 1 (Vote!)

Posted on Tuesday, June 14, 2016 - 01:12 pm:       

Other Methods

https://en.wikipedia.org/wiki/AKS_primality_test
https://en.wikipedia.org/wiki/Sieve_of_Eratosthenes
http://cr.yp.to/primegen.html
 

Driverramudu
Hero
Username: Driverramudu

Post Number: 16377
Registered: 02-2009
Posted From: 166.170.5.118

Rating: N/A
Votes: 0 (Vote!)

Posted on Tuesday, June 14, 2016 - 01:08 pm:       

Kuyyo morro

I did not get your question clearly

U mean to ask without writing loop
Give list of prime numbers up to given upper range?
Or for given number find out whether it is prime or not ?

Be clear amma
Driving is my PASSION.
Ball or Bimmer does not matter.
 

Leader
Comedian
Username: Leader

Post Number: 1556
Registered: 12-2012
Posted From: 131.107.174.38

Rating: 
Votes: 1 (Vote!)

Posted on Tuesday, June 14, 2016 - 01:04 pm:       

Usually for loop takes O(N) for checking prime. I suggested to binary search approach, in every iteration you search is reduced to half. SO you can identify prime in O(Log N) time which is efficient than O(N).
Hope it helps
 

Rajin
Hero
Username: Rajin

Post Number: 13724
Registered: 05-2012
Posted From: 69.32.128.19

Rating: N/A
Votes: 0 (Vote!)

Posted on Tuesday, June 14, 2016 - 01:03 pm:       


Sesani:

Maintain a set or table with ALL the prime numbers...


 

Boston_baba
Side Hero
Username: Boston_baba

Post Number: 8044
Registered: 07-2012
Posted From: 108.171.159.47

Rating: N/A
Votes: 0 (Vote!)

Posted on Tuesday, June 14, 2016 - 01:03 pm:       


Sesani:

Maintain a set or table with ALL the prime numbers... If the number exist in the table or set, then its a prime number...

Naa laanti smart programmer undatam DB cheskunna adrustam..



prime number set is infinite...
http://www.thehindu.com/todays-paper/tp-national/tp-andhrapradesh/tdp-claims-denied-by-its-own-budget/article6336996.ece
http://www.newindianexpress.com/states/andhra_pradesh/article41814.ece
1991- AP debt 22% of GSDP, 2004 - 34% of GSDP, 2014 - 22% of GSDP.
 

Balu_gani
Junior Artist
Username: Balu_gani

Post Number: 97
Registered: 05-2015
Posted From: 204.74.159.3

Rating: N/A
Votes: 0 (Vote!)

Posted on Tuesday, June 14, 2016 - 01:02 pm:       


Sesani:


 

Rajin
Hero
Username: Rajin

Post Number: 13721
Registered: 05-2012
Posted From: 69.32.128.19

Rating: N/A
Votes: 0 (Vote!)

Posted on Tuesday, June 14, 2016 - 12:59 pm:       

elantivi kuda talvakapothe aa job kottatam kastam , so vallu chese kanna maname reject cheyytam bresttu
 

Kuyyo_morro
Megastar
Username: Kuyyo_morro

Post Number: 22244
Registered: 02-2011
Posted From: 169.133.140.6

Rating: N/A
Votes: 0 (Vote!)

Posted on Tuesday, June 14, 2016 - 12:46 pm:       

Oracle intvw lo adigadu ide question. Product Engineer role kosam. Database performance penchadaniki to counter Workday, NoSQL databases.

What if we store data as text files on a high performing server instead of storing on database ani adigadu. Daani valla vache differences enti ani.
 

Jambalahaart_raja
Side Hero
Username: Jambalahaart_raja

Post Number: 6674
Registered: 07-2008
Posted From: 64.125.177.124

Rating: N/A
Votes: 0 (Vote!)

Posted on Tuesday, June 14, 2016 - 12:41 pm:       


Asdf:

do you know the answer later?



ledhannai...
Google lo kooda dorakaledu...
Please enlighten!!
"Chill Bro.
I told you to let it go!!"
- The Budhha.
 

Asdf
Megastar
Username: Asdf

Post Number: 20013
Registered: 12-2014
Posted From: 205.157.66.4

Rating: N/A
Votes: 0 (Vote!)

Posted on Tuesday, June 14, 2016 - 12:38 pm:       


Jambalahaart_raja:




do you know the answer later?
Sesani lo inta hater dagi unada malli neetulu baga chebutadu, lol - Gotcha
 

Jambalahaart_raja
Side Hero
Username: Jambalahaart_raja

Post Number: 6672
Registered: 07-2008
Posted From: 64.125.177.124

Rating: N/A
Votes: 0 (Vote!)

Posted on Tuesday, June 14, 2016 - 12:35 pm:       

Ittanti dikkumalna koschen oka saari okadu adigaadu.. phone lo...
New York City lo mottam Blue Cars, irrespective of shade - navy blue, sky blue, sea blue etc etc.. all blue cars, irrespective of make and model elaa calculate chesthaav annaadu...

DMV ki poyi registration details aduguthaa annaa...

Appudu vonly registered cars vasthadi... Commuters sangathi enti ani adigaadu...

GPS systems vaadaalsinde... wide-angle large square footage finest format photo okati teesi.. GPS software lo load chesthey... blue cars yem kharma.. subway trains signals koodaa pin-point telisthaayi ani cheppaa...

Rejected!!!
"Chill Bro.
I told you to let it go!!"
- The Budhha.
 

Jambalahaart_raja
Side Hero
Username: Jambalahaart_raja

Post Number: 6671
Registered: 07-2008
Posted From: 64.125.177.124

Rating: N/A
Votes: 0 (Vote!)

Posted on Tuesday, June 14, 2016 - 12:29 pm:       

Rules Engine okati petti idi load cheyi...

https://en.wikipedia.org/wiki/Divisibility_rule


"Chill Bro.
I told you to let it go!!"
- The Budhha.
 

Simba
Megastar
Username: Simba

Post Number: 20688
Registered: 02-2008
Posted From: 206.210.17.33

Rating: 
Votes: 1 (Vote!)

Posted on Tuesday, June 14, 2016 - 12:14 pm:       


Kuyyo_morro:


invoke the method call like:
 
boolean ret = isPrime(n);


ask your team member to implement the method and send you the library:
 
public static boolean isPrime(int n) {
// TO DO
...
...
}
 

Asdf
Megastar
Username: Asdf

Post Number: 20011
Registered: 12-2014
Posted From: 205.157.66.4

Rating: N/A
Votes: 0 (Vote!)

Posted on Tuesday, June 14, 2016 - 12:12 pm:       


Kuyyo_morro:




oh vaake.

so for any number provided(it can be a mil or 10 mil), this prog has to run till that number?
Sesani lo inta hater dagi unada malli neetulu baga chebutadu, lol - Gotcha
 

Dreamcatcher
Side Hero
Username: Dreamcatcher

Post Number: 8508
Registered: 11-2009
Posted From: 100.36.47.83

Rating: N/A
Votes: 0 (Vote!)

Posted on Tuesday, June 14, 2016 - 12:10 pm:       


Kuyyo_morro:

ASDF, interview question idi in a product company (Oracle, Google). Prepare avthunna. Itlanti dikkumalina algorithm related questions unnai sample intvw questions lo




when ask questions like these, they are not expecting you to solve it then and there...they want to here ideas from you for a possible solution and see how you are thinking through about the problem...so, just speak your thoughts about how you might approach the problem. just my two cents.
 

Kuyyo_morro
Megastar
Username: Kuyyo_morro

Post Number: 22242
Registered: 02-2011
Posted From: 169.133.140.6

Rating: N/A
Votes: 0 (Vote!)

Posted on Tuesday, June 14, 2016 - 12:06 pm:       

ASDF, interview question idi in a product company (Oracle, Google). Prepare avthunna. Itlanti dikkumalina algorithm related questions unnai sample intvw questions lo
 

Sesani
Legend
Username: Sesani

Post Number: 42315
Registered: 08-2014
Posted From: 207.140.166.10

Rating: N/A
Votes: 0 (Vote!)

Posted on Tuesday, June 14, 2016 - 12:06 pm:       

Maintain a set or table with ALL the prime numbers... If the number exist in the table or set, then its a prime number...

Naa laanti smart programmer undatam DB cheskunna adrustam..
 

Asdf
Megastar
Username: Asdf

Post Number: 20009
Registered: 12-2014
Posted From: 205.157.66.4

Rating: N/A
Votes: 0 (Vote!)

Posted on Tuesday, June 14, 2016 - 12:02 pm:       

did you check if there are libraries for this already?
Sesani lo inta hater dagi unada malli neetulu baga chebutadu, lol - Gotcha
 

Kuyyo_morro
Megastar
Username: Kuyyo_morro

Post Number: 22240
Registered: 02-2011
Posted From: 169.133.140.6

Rating: N/A
Votes: 0 (Vote!)

Posted on Tuesday, June 14, 2016 - 11:57 am:       

How to find out if a number is a prime number or not. But using less memory for the application. i.e. for i=1 to (n-1) loop pettakunda edanna shortcut unda if we are running for a number in some millions.

2,3, 5 division check cheyochu. But what about 11, 13 etc prime numbers division testing and to what extent can we keep on writing those numbers if the number provided is in millions.

Add Your Message Here
Post:
Bold text Italics Underline Create a hyperlink Insert a clipart image HASH(0x9261268){Movie Clipart}
Show / hide regular icons selection options

Click on following links to open cliparts by Alphabetical Order

 A   B   C   D   E   F   G   H   I   J   K   L   M  

N   O   P   Q   R   S   T   U   V   W   X   Y   Z  

Show / Hide Filmy icons selection options

Click on following links to open cliparts by Alphabetical Order

  A   B   C   D   E   F   G   H   I   J   K   L   M  

N   O   P   Q   R   S   T   U   V   W   X   Y   Z  

Username: Posting Information:
This is a public posting area. Enter your username and password if you have an account. Otherwise, enter your full name as your username and leave the password blank. Your e-mail address is optional.
Password:
E-mail:
Options: Enable HTML code in message
Automatically activate URLs in message
Action: