Jump to content

Code Cleanliness Ante Enti


GunturGongura

Recommended Posts


[font='Helvetica Neue']Please remember the coding portion of this test will be judged on code cleanliness, not just functionality. Write nice, clean code. If we suspect that your code has been plagiarized (we have a filter that detects this), this will result in an automatic fail and disqualification from any future consideration... So please make an honest effort![/font]


ela attempt cheyali

less loops use recursive be careful with the naming convention of variables and methods put all frequently called methods in utils class . Make utils a singleton inka chala vuntay
Link to comment
Share on other sites

  • Replies 64
  • Created
  • Last Reply

Top Posters In This Topic

  • GunturGongura

    12

  • chaikumar

    11

  • uncertainity

    10

  • puli_keka

    9

less loops use recursive be careful with the naming convention of variables and methods put all frequently called methods in utils class . Make utils a singleton inka chala vuntay

 

Bhayya, akkada 1-2 hrs coding test untundi. Andulo ila recursion lu, singleton lu, utils class lu ante time saripodu. Of course, some problems can be solved easily by recursion, then we can use it. Otherwise, there is no need to use recursion if it can be done easily with loops.

 

Clean code ante...ilanti coding tests lo easily readable/understandable code with appropriate variable names.

 

1 hour test ki max 2 functions rayochu. 2-3 hours test ki oka 3-4 functions. 

 

Getting a compilable solution and a working solution that works for all the testcases is more important. Then time complexity and space complexity are important. How many times you are looping over the input and how much extra space you are using ni optimize cheyyali.

Link to comment
Share on other sites

code cleanliness hacker rank antunav kadabti

proper comments

indentation

proper variable name 

avoid using too many variable creation example avoid strings when there are many string manipulation instead use sb 

Link to comment
Share on other sites

given input : {1,2,3,5}

 

subsets are print output:

{1}{2}{3}{5}

{1,2}{1,3}{1,5}{2,3}{2,5}{2,5}{3,5}

{1,2,3}{1,2,5}{1,3,5}{2,3,5}

{1,2,3,5}

================================================

 

sum vishayaniki vosthe .. prathi dhani sum print cheyal anthe.....

Link to comment
Share on other sites

given input : {1,2,3,5}

subsets are print output:
{1}{2}{3}{5}
{1,2}{1,3}{1,5}{2,3}{2,5}{2,5}{3,5}
{1,2,3}{1,2,5}{1,3,5}{2,3,5}
{1,2,3,5}
================================================

sum vishayaniki vosthe .. prathi dhani sum print cheyal anthe.....

Looks to me a variation of all combinations of a string
Link to comment
Share on other sites

given input : {1,2,3,5}

 

subsets are print output:

{1}{2}{3}{5}

{1,2}{1,3}{1,5}{2,3}{2,5}{2,5}{3,5}

{1,2,3}{1,2,5}{1,3,5}{2,3,5}

{1,2,3,5}

================================================

 

sum vishayaniki vosthe .. prathi dhani sum print cheyal anthe.....

ok ya …..kani python lo list untundi..like[1,2,3,5]

 

subsets are[1],[2]….[1,2,3,5]

 

e {1} notation ni emantaru python lo?

 

these flower brackets basically are dictionaries with key and value

Link to comment
Share on other sites

Its like to find Power Set actually..sorry if i confused few 

 

Power Set Power set P(S) of a set S is the set of all subsets of S. For example S = {a, b, c} then P(s) = {{}, {a}, {b}, {c}, {a,b}, {a, c}, {b, c}, {a, b, c}}.

Link to comment
Share on other sites

ok ya …..kani python lo list untundi..like[1,2,3,5]

 

subsets are[1],[2]….[1,2,3,5]

 

e {1} notation ni emantaru python lo?

 

these flower brackets basically are dictionaries with key and value

 

I didnot work in python... but ..the thing is use any language....

but print powerset ade problem try cheyi

Link to comment
Share on other sites

×
×
  • Create New...