Tests and more Go
Finally the end of the 3rd semester of my first year, for the past 2 weeks its been a roller coaster ride of emotions. First up it was my Database Design and Modelling (DDMG) Module exams, the questions covered the entire syllabus right from the start where there were questions about what Joins were Inner Joins, Outer Joins. Data dependency, Database Management Systems (DBMS) and Data Models. Focusing quite abit of questions on interpreting E-R Diagrams. First Normal Form (1NF), Second Normal Form (2NF) and Third Normal Form (3NF) how to normalize/denormalize data. The types of Entities and Relationships and what supertypes/subtypes, Software Development Lifecycle (SDLC) and Rapid Application Development (RAD) comparing the differences between the 2 development cycles.
It also covered MySQL commands on the DDL and DML aspects. Clauses, Queries, Keys and Operators. How you create a TABLE and link the key to another primary key of another table. Overall the exam was quite comprehensive as it covered most of the important points in a typical database.
Though the practical aspect of this module had only 8 contact hours of lab exercises. We managed to practice enough to understand how the MySQL commands worked. Creating tables, populating values into columns and setting the primary/foreign keys via command line instead of using the GUI.
Next up it will be my Introduction to Systems Organisation test in another 2 days. In my opinion, the topics is really a very general overview of Computer Architecture. I probably will only know the results next month as this lecturer don't seem to take responsibility to tell how well or bad you did on the tests / assignments. So its hard to gauge how well I will be doing for this module.
GoSchool started on the 10th to 16th, for Go Advanced we took a deeper dive into Golang. The first day was just an introduction for us to learn about what Algorithms are and what Data Structures are used for and its relation to Space-Time Complexity and Big-O Notation.
- Data Structures
- Error Handling
Credits to : GoSchool Lecturer - Kheng Hian for the examples.
The very basics of a linked list. You have a Node which stores your data and a next which points to the next item on the linkedlist, and a Head which references to the Node. This was the solution we were tasked to create for practice, what I like about Golang is that you can determine how you want to structure your data easily. Because you can put a map into a struct value or a slice to a struct and just manipulate it easily.
So back to Linked Lists, they are a very versatile data structure but the complexity is Big-O of O(n). The more data there is the longer it will take. But then you can solve this by creating a sorting algorithm perhaps by sorting it alphabetically and query using any of the sorting algorithm depending on the query. Theoretically it should improve right? I'm not sure as I'm one of those non-Comp Sci students in this course and I don't really fully understand how data structures work.
For a stack, its a data structure that is similar to how you stack boxes or books? First-In-Last-Out is what I can remember of it. Basically the first think that you put is at the top, the second thing you put becomes the new top and vice versa.
This was the solution that was half-complete. I couldn't figure out how to create a function to check for parentheses. Logically you need to check the stack for an open and a closing parentheses. But I struggled with it so this is my partial answer, the rest of my classmates were definitely better as some of them are fresh out of Uni and/or have been developing in a different type of language previously.
I feel so inferior right now heh...
On Day 2 we were taught what a Queue was, basically its the reverse of a Stack. Since a Stack is First-In-Last-Out, a Queue is First-In-First-Out. Like what it says a Queue is a "queue", like you queue for food and you are first in line. You get to choose first. All Singaporeans love to queue. No pun intended.
Here is the solution which is still not complete. In the assignment we were supposed to use the Queue data structure to check whether a word is a palindrome. A palindrome, is "A word, phrase, or sequence that reads the same backwards as forwards."
Its getting harder by the day... I need more help!
On the third day, we learnt about Binary Search Tree (BST). I think its mainly used for robotics, automation and natural language processing. So we learnt the different types of traversal, InOrder, PreOrder, PostOrder and Level Order. A typical BST has a left, right, root. Depending on the type of traversal you get different results. Because the sequence will be different.
It was pretty fun and quite easy to understand the concept. But the implementation and getting the right results were tough.
Yes to my understanding there are more data structures! Theres a doubly linked list, a heap, hash, graph. Though we didnt cover any of it. But its good to know perhaps.
So the entire course was a build-up to these topics. The main focus being Concurrency which is the whole idea why Golang is so efficient. Basically, Errors are just what you return to inform what went wrong in your program. Its always good to know why your program is not working right?
Errors can be used for tests and debugging. And you can use Panic, Defer, to control when it happens too! Thats amazing. The only major problem I had was understanding concurrency and the channels thingy. After reading online I basically get an understanding that you use channels via wg.Add() and then using go to print out concurrently the results. Of course you can see it in parallel because the command line prints line by line. But logically it will be run side by side?
For now I'm still learning and reading more about Golang from the stack of books i borrowed from the library. But none of it covers anything close to data structures which is what I worry about. Of course Google is your best friend, but it probably won't help me in a technical interview right. Really worried if I could even secure a job at all in this situation. Will the topics get more complex? Perhaps. But I hope that I can pull through this successfully and get start afresh in this attempt to career switch.