Coder Social home page Coder Social logo

kedatech-test1's Introduction

Tes Teknis 1 Frontend Developer Keda Tech

Selamat datang di submission saya untuk technical test 2 untuk posisi Frontend Developer di KedaTech. Repositori ini digunakan untuk mengerjakan uji unit menggunakan Jest. Tes ini akan fokus pada pengujian fungsi-fungsi yang melibatkan pengurutan array, menemukan jumlah maksimum subarray, dan menjumlahkan bilangan genap dalam nested objek.

Instruksi Test

  1. Pengurutan Array Angka:

    • Buatlah sebuah fungsi yang menerima input berupa array angka dan mengurutkan angka-angka dari yang terbesar ke yang terkecil secara manual tanpa menggunakan fungsi pengurutan bawaan JavaScript.
    • Input: [1, 2, 4, 3, 5, 3, 2, 1]
    • Hasil yang Diharapkan: [5, 4, 3, 3, 2, 2, 1, 1]
  2. Jumlah Maksimum Subarray:

    • Buatlah sebuah fungsi yang menerima input berupa array angka dan sebuah angka n, dan temukan jumlah maksimum dari n angka berurutan dalam array.
    • Input: ([100, 200, 300, 400], 2)
    • Hasil yang Diharapkan: 700 (dihitung dari 300 + 400)
    • Input: ([1, 4, 2, 10, 23, 3, 1, 0, 20], 4)
    • Hasil yang Diharapkan: 39 (dihitung dari 4 + 2 + 10 + 23)
    • Input: ([-3, 4, 0, -2, 6, -1], 2)
    • Hasil yang Diharapkan: 5 (dihitung dari 6 + -1)
  3. Jumlah Bilangan Genap dalam nested Objek:

    • Buatlah sebuah fungsi yang menerima input berupa objek bersarang dan menghitung jumlah semua bilangan genap dalam objek tersebut.
    • Input:
      {
        outer: 2,
        obj: {
          inner: 2,
          otherObj: {
            superInner: 2,
            notANumber: true,
            alsoNotANumber: "yup"
          }
        }
      }
    • Hasil yang Diharapkan: 6
    • Input:
      {
        a: 2,
        b: {b: 2, bb: {b: 3, bb: {b: 2}}},
        c: {c: {c: 2}, cc: 'ball', ccc: 5},
        d: 1,
        e: {e: {e: 4}, ee: 'car'}
      }
    • Hasil yang Diharapkan: 12

Memulai

  1. Clone repositori:

    git clone https://github.com/reshaditiya/kedatech-test1.git
  2. Pindah ke direktori repositori:

    cd kedatech-test1
  3. Install dependensi:

    npm install
  4. Jalankan uji dengan menggunakan Jest:

    npm run test

kedatech-test1's People

Contributors

reshaditiya avatar

Watchers

 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.