Skip to content

Instantly share code, notes, and snippets.

@c3budiman
Last active October 16, 2025 08:56
Show Gist options
  • Select an option

  • Save c3budiman/4a10124ab4399dcdb562d7baba5e921b to your computer and use it in GitHub Desktop.

Select an option

Save c3budiman/4a10124ab4399dcdb562d7baba5e921b to your computer and use it in GitHub Desktop.

Interview Question

Pembukaan (Wajib Bener salah satu)

  1. Frontend yang ini kode nya belum lengkap, tolong lengkapi.
const Waitlist = () => {
  const [name, setName] = useState('');
  const [waitlist, setWaitlist] = useState([]);
  const onSubmit = (e) => {
    e.preventDefault();
    
  };
  return (
    <div>
      <form onSubmit={onSubmit}>
        <label>
          Name: <input type="text" value={name} onChange={(e) => setName(e.target.value)} />
        </label>
        <button type="submit">Add to waitlist</button>
      </form>

      <ol>
        {waitlist.map((name) => (
          <li key={name}>{name}</li>
        ))}
      </ol>
    </div>
  );
};
  1. Backend Express spot error dan bagus nya gimana?
const app = express();

app.post("/blog", (req, res) => {
    const blog = ["Post saya", "Post Anda"]
    return blog
})
  1. Sql

Tabel: Penjualan

id barang harga tanggal_penjualan id_penjual
1 Kemeja Batik 150000 2025-10-01 1
2 Celana Jeans 250000 2025-10-05 2
3 Sepatu Sneakers 500000 2025-10-10 3

Tabel: Penjual

id nama
1 Budi Santoso
2 Siti Rahmawati
3 Andi Wijaya

spot error dan lengkapi query berikut

select
    pjl.id,
    pjl.barang,
    pjl.harga,
    p.pedagang,
from
    penjualan pjl
    left join penjual p on pjl.id = p.id
group by
    pjl.id,
    pjl.barang,
    pjl.harga
order by pjl.tanggal_penjualan

Hasil yg diharapkan

id barang harga nama penjual tanggal penjualan
1 Kemeja Batik 150000 Budi Santoso 2025-10-01
2 Celana Jeans 250000 Siti Rahmawati 2025-10-05
3 Sepatu Sneakers 500000 Andi Wijaya 2025-10-10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment