Review an AI-written pull request
- Skill
- Code review
- Time
- About 30 min
- Access
- Full track
A teammate used an AI assistant to write three new API endpoints and opened this pull request. It runs, and the happy path works. Your job is the review.
AI-written code tends to look clean while hiding real problems: security holes, data leaks, missing error handling and slow queries. Review it the way a careful senior engineer would.
You can ask an AI to review it too, but don’t just paste its list. AI reviewers miss things and flag non-issues. Decide which comments actually matter.
Submit
Your review comments. For each one:
- Where it is (endpoint or line)
- What’s wrong and what could happen in production
- How serious it is: must fix, should fix or nice to have
- The fix, in a sentence or a code snippet
// routes/users.js// PR #214: "Add user search, email update and order history endpoints"const express = require('express');const router = express.Router();const db = require('../db'); const ADMIN_TOKEN = 'sk_live_9f8a7d6c5b4a3e2f'; // GET /users/search?q=ali&page=1router.get('/users/search', async (req, res) => { const { q, page = 1 } = req.query; const rows = await db.query( `SELECT id, name, email, password_hash FROM users WHERE name LIKE '%${q}%' LIMIT 20 OFFSET ${page * 20}` ); res.json(rows);}); // POST /users/:id/email { "email": "new@example.com" }router.post('/users/:id/email', async (req, res) => { const { email } = req.body; if (req.headers['x-admin-token'] !== ADMIN_TOKEN && req.user.id !== req.params.id) { return res.status(403).json({ error: 'Forbidden' }); } db.query('UPDATE users SET email = $1 WHERE id = $2', [email, req.params.id]); res.json({ ok: true });}); // GET /users/:id/ordersrouter.get('/users/:id/orders', async (req, res) => { const orders = await db.query('SELECT * FROM orders WHERE user_id = $1', [req.params.id]); for (const order of orders) { order.items = await db.query('SELECT * FROM order_items WHERE order_id = $1', [order.id]); } res.json(orders);}); module.exports = router;This task is in the full track
You can read the brief above. To submit it, unlock all 10 tasks for $9, once. Unlimited resubmissions, and a full refund within 7 days if it isn’t useful.
Create a free account to get your review
Your answer stays here. Reviews are saved to your account so you can come back to them.
Already have an account?