Giter Club home page Giter Club logo

winter-2024-exams's Introduction

Winter 2024 Exams for SEF1

  • You need github account, node.js and text editor or IDE installed
  • You can use any online materials, docs, FAQs, AI tools, Videos, etc. it is not important how can you get understanding of tasks and solutions, but we need understanding, not just solutions
  • Deadline for all students: 2024-01-15 14:00
  • Here is additional materials you may refer:
  • Seminars and lectures closely related to exams:
  • For those who have projects instead of this exams tasks:
    • You need to create screencast video presentation of codebase and project functionality: 15-30 minutes length
    • Upload it to Youtube, Google disk or other hosting with video support and add link to this video in your project repository
  • For those who want technical interview:
    • Write your request in our telegram group ASAP and I'll schedule call
  • Fork this repository: https://github.com/HowProgrammingWorks/Winter-2024-Exams
  • Clone this repository to your machine or you can do everything in Github interface or integrated VSCode IDE
  • Create branch exams
  • See directory /Tasks there are 38 tasks prepared in one of the worst possible implementation and style
  • You can select from 5 up to 10 tasks for exams (except difference.js and size.js) to refactor and optimize in a few steps (you may do all the tasks if you want but 10 is enough for "A")
  • Tasks code works and gives right results. You need to change files but do not break functionality covered by tests
  • To improve code style you may use:
  • Use tests from .tests.js files to check tasks functionality
    • For example run: node size.test.js to check size.js or npm t (to check all taks)
    • Output example: Test size.js: Passed: 11 of 11
    • If tests fails you will see something like: Case: size(23456789) -> "23 mb", expected: "123 mb"
  • Your task is to improve (respect list priority):
    • Code readability
    • Code style
    • Simplicity
    • Quality
    • Supportability
    • Reliability
    • Testability
  • I'd advice to find a few friends from the group and cross-review the code before exams
  • Here is a checklist of common problems we have in code:
    • Do not mutate function input parameters
    • Prefer arrow functions for JavaScript and lambda for Python
    • Preferably use for..of or for on a variable or Array/map, and avoid for..in and forEach
    • Use intermediate identifiers to separate long expressions
    • Prefer const and use let as a last resort, but never use var
    • Convert all magic values to constants
    • Follow the rules for naming identifiers
    • Think carefully about the names of identifiers so that when reading the code, everyone understands their contents
    • Don't make functions too long
    • Don't make a big stack of if statements, use arrays and objects instead
  • Hints:
    • Use eslint and prettier, fix all warnings
    • Follow code style and naming conventions from lectures and code examples
    • Respect 2 space indentation
    • Add empty line between semantic blocks for visual separation
    • Don't change incoming parameters
    • Decompose complex functions
    • Respect SRS (separation of concerns)
    • Respect SRP (single responsibility principle)
    • Prefer const, minimize let usage
    • Remove unneeded operations, calls, arguments, blocks, etc.
    • Prefer arrow functions
    • Use round brackets even for single argument lambda functions
    • Optimize loop invariant
    • Optimize lexical scope, minimize area of identifier visibility
    • Prefer for..of loops, sometimes use classical for, in a rare use .map(), try to avoid .forEach()
    • Use intermediate variables
    • Decompose long expressions
    • Return result of logical expression instead of return true; else return false;
  • If you prefer any other language instead of JavaScript then translate the code into your language as close as possible
  • Make each refactoring and optimization step a separate commit
  • It is important not to rewrite code from scratch but to improve it step by step
  • At the second seminar, I showed an example of how to optimize the code step by step
  • When you're done, make a pull request to my repository
  • Good luck!

winter-2024-exams's People

Contributors

tshemsedinov avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.