-
Notifications
You must be signed in to change notification settings - Fork 19
Expand file tree
/
Copy pathcatalog.yaml
More file actions
213 lines (210 loc) · 6.28 KB
/
catalog.yaml
File metadata and controls
213 lines (210 loc) · 6.28 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
concepts:
- slug: 01_hello
title: Hello, Go!
test_regex: ".*"
hints:
- Implement Hello() to return 'Hello, Go!'
- slug: 02_values
title: Values
test_regex: ".*"
hints:
- Use fmt.Sprintf to format values.
- slug: 03_variables
title: Variables
test_regex: ".*"
hints:
- Use short declarations (:=) and return multiple values.
- slug: 04_constants
title: Constants
test_regex: ".*"
hints:
- Use math.Pi and constant expressions.
- slug: 05_for
title: For
test_regex: ".*"
hints:
- Accumulate a sum with a for loop.
- slug: 06_if_else
title: If/Else
test_regex: ".*"
hints:
- Handle negative, zero, and positive cases.
- slug: 07_switch
title: Switch
test_regex: ".*"
hints:
- Match multiple cases for weekend days.
- slug: 08_arrays
title: Arrays
test_regex: ".*"
hints:
- Iterate with range over a fixed-size array.
- slug: 09_slices
title: Slices
test_regex: ".*"
hints:
- Append values then compute a sum.
- slug: 10_maps
title: Maps
test_regex: ".*"
hints:
- Use strings.Fields and map[string]int for word counts.
- slug: 11_functions
title: Functions
test_regex: ".*"
hints:
- Pass a function and call it.
- slug: 12_multi_return
title: Multiple Return Values
test_regex: ".*"
hints:
- Return quotient, remainder, and an error for divide-by-zero.
- slug: 13_variadic
title: Variadic Functions
test_regex: ".*"
hints:
- Use '...' to accept any number of ints and sum them.
- slug: 14_closures
title: Closures
test_regex: ".*"
hints:
- Implement a function that returns a closure, capturing an outer variable.
- slug: 15_recursion
title: Recursion
test_regex: ".*"
hints:
- Implement a recursive factorial function.
- slug: 16_range_built_in
title: Range over Built-in Types
test_regex: ".*"
hints:
- Use range to iterate over a slice and a map.
- slug: 17_pointers
title: Pointers
test_regex: ".*"
hints:
- Write a function that takes a pointer, modifies the value, and returns the pointer.
- slug: 18_strings_runes
title: Strings and Runes
test_regex: ".*"
hints:
- Iterate over a string with range to count runes, and demonstrate string manipulation.
- slug: 19_structs
title: Structs
test_regex: ".*"
hints:
- Define a struct with fields for name and age, then create an instance.
- slug: 20_methods
title: Methods
test_regex: ".*"
hints:
- Add a method to a struct that calculates something based on its fields.
- slug: 21_interfaces
title: Interfaces
test_regex: ".*"
hints:
- Define an interface and implement it for a struct.
- slug: 22_enums
title: Enums
test_regex: ".*"
hints:
- Use iota to create a set of related constants as an enumeration.
- slug: 23_struct_embedding
title: Struct Embedding
test_regex: ".*"
hints:
- Embed one struct within another and access the inner struct's fields directly.
- slug: 24_generics
title: Generics
test_regex: ".*"
hints:
- Write a generic function that works with different types.
- slug: 25_range_iterators
title: Range over Iterators
test_regex: ".*"
hints:
- Implement a custom iterator and use range over it.
- slug: 26_errors
title: Errors
test_regex: ".*"
hints:
- Write a function that returns an error and handle it.
- slug: 27_custom_errors
title: Custom Errors
test_regex: ".*"
hints:
- Define a custom error type and return it from a function.
- slug: 37_xml
title: XML Encoding and Decoding
test_regex: ".*"
hints:
- Use encoding/xml package for marshaling and unmarshaling XML data.
- Add XML struct tags using `xml:"fieldname"` to map struct fields to XML elements.
- Use xml.Marshal to convert structs to XML bytes.
- Use xml.Unmarshal to parse XML bytes into structs.
projects:
- slug: 101_text_analyzer
title: Text Analyzer (Easy)
test_regex: ".*"
hints:
- Implement functions to count characters, words, and unique words in a given text.
- slug: 102_shape_calculator
title: Shape Area Calculator (Medium)
test_regex: ".*"
hints:
- Define structs for different shapes, implement methods to calculate their areas, and use an interface for common shape behavior.
- slug: 103_task_scheduler
title: Task Scheduler (Hard)
test_regex: ".*"
hints:
- Create a task scheduler with features like adding/removing tasks, a custom iterator, closures for task execution, and custom error handling.
- slug: 104_http_server
title: HTTP Server (Easy)
test_regex: ".*"
hints:
- Implement a basic HTTP server that responds to GET requests.
- slug: 105_cli_todo_list
title: CLI Todo List (Medium)
test_regex: ".*"
hints:
- Build a command-line tool to manage a todo list, including adding, listing, and completing tasks.
- slug: 106_simple_chat_app
title: Simple Chat Application (Medium)
test_regex: ".*"
hints:
- Create a basic client-server chat application.
- slug: 107_image_processing_utility
title: Image Processing Utility (Hard)
test_regex: ".*"
hints:
- Develop a command-line utility for basic image transformations like resizing or converting to grayscale.
- slug: 108_basic_key_value_store
title: Basic Key-Value Store (Hard)
test_regex: ".*"
hints:
- Implement an in-memory key-value store with basic CRUD operations and optional persistence.
- slug: 36_json
title: JSON
test_regex: ".*"
hints:
- Use the encoding/json package to work with JSON data.
- Implement MarshalPerson to convert a struct into JSON using json.Marshal.
- Implement UnmarshalPerson to convert a JSON string into a struct using json.Unmarshal.
- Handle and return errors properly in both functions.
- slug: 109_epoch
title: "Epoch Conversion"
difficulty: beginner
topics: ["time", "epoch", "unix"]
hints:
- "Use Go's `time.Unix()` to convert an epoch to time."
- "Use `t.Unix()` to convert time back to epoch."
- "Remember Go’s `time.Parse` can help parse date strings."
- slug: regular-expressions
title: Regular Expressions
test_regex: ".*"
hints:
- Use the regexp package from the standard library.
- Compile the pattern with regexp.Compile or regexp.MustCompile.
- Use MatchString to check if the input matches the pattern.
- Patterns like ^a.*z$ match strings starting with 'a' and ending with 'z'.
- See https://pkg.go.dev/regexp for more examples.