How to write a beautiful
code.

TARUN GOYAL
SOFTWARE ENGINEER
WALMARTLABS
Alien Spiral
Given size N output an N*N matrix where numbers
are arranged in a spiral.
Pattern:
1
2
3
4
5
6
7
8
28

29

30...
Puzzles and Programming
 Both have constraints.
 Have to devise a logic to solve them.
 Puzzles on paper, coding on com...
Learning Algorithms
Books:
 Algorithms by Sanjoy Dasgupta (link)
 Introduction to Algorithms 3 Edition (link)
Websites
Practice sites:
 Codechef: http://www.codechef.com
 Spoj: https://www.spoj.com
 Codeforces: http://codeforces....
Use Inbuilt Data Structures
 Standard template library in C++:

http://www.cplusplus.com/reference/stl/
 Collections in ...
Sample Problems
http://www.hackerearth.com/problem/algorithm/fin
ding-pairs-4/
http://www.hackerearth.com/problem/algorith...
Thank You !
Upcoming SlideShare
Loading in...5
×

Presentation

511

Published on

Published in: Technology, Education
0 Comments
1 Like
Statistics
Notes
  • Be the first to comment

No Downloads
Views
Total Views
511
On Slideshare
0
From Embeds
0
Number of Embeds
2
Actions
Shares
0
Downloads
15
Comments
0
Likes
1
Embeds 0
No embeds

No notes for slide

Presentation

  1. 1. How to write a beautiful code. TARUN GOYAL SOFTWARE ENGINEER WALMARTLABS
  2. 2. Alien Spiral Given size N output an N*N matrix where numbers are arranged in a spiral. Pattern: 1 2 3 4 5 6 7 8 28 29 30 31 32 33 34 9 27 48 49 50 51 52 35 10 26 47 60 61 62 53 36 11 25 46 59 64 63 54 37 12 24 45 58 57 56 55 38 13 23 44 43 42 41 40 39 14 22 21 20 19 18 17 16 15 Link: http://www.codechef.com/INSOM1/problems/INSOMA1
  3. 3. Puzzles and Programming  Both have constraints.  Have to devise a logic to solve them.  Puzzles on paper, coding on computer.  Solving puzzles can’t get you a job but coding can.
  4. 4. Learning Algorithms Books:  Algorithms by Sanjoy Dasgupta (link)  Introduction to Algorithms 3 Edition (link)
  5. 5. Websites Practice sites:  Codechef: http://www.codechef.com  Spoj: https://www.spoj.com  Codeforces: http://codeforces.com  Topcoder: http://www.topcoder.com Practice and hiring challenges  HackerEarth: http://www.hackerearth.com
  6. 6. Use Inbuilt Data Structures  Standard template library in C++: http://www.cplusplus.com/reference/stl/  Collections in java: http://docs.oracle.com/javase/7/docs/technotes/gui des/collections/  Example: sort (a,a+n) in c++ will sort an entire array of numbers.
  7. 7. Sample Problems http://www.hackerearth.com/problem/algorithm/fin ding-pairs-4/ http://www.hackerearth.com/problem/algorithm/ch ocolates-boxes-1/ http://www.hackerearth.com/problem/algorithm/sav e-girlfriend/
  8. 8. Thank You !
  1. A particular slide catching your eye?

    Clipping is a handy way to collect important slides you want to go back to later.

×