ByteDance backend engineer interviews typically focus on APIs, databases, system design, concurrency, caching, and data structures.
No verified questions yet for ByteDance.
JobScheduler with the following methods:JobScheduler() — Initializes a job scheduler.void scheduleJob(string jobId, int interval, function jobFn) — Schedules a job to run every interval milliseconds.void cancelJob(string jobId) — Cancels the job with the given jobId.JobScheduler(), scheduleJob("job1", 3000, jobFn), cancelJob("job1")1 <= interval <= 10000RateLimiter with the following methods:RateLimiter(int limitPerMinute): Constructor to set the limit on requests per user.bool isAllowed(string userId): Determine if a request from userId is allowed for the current minute.void recordRequest(string userId): Record that a request was made by userId.RateLimiter(5), isAllowed("user1") => true, recordRequest("user1"), isAllowed("user1") => true, recordRequest("user1") => true (repeats until limit reached)1 <= limitPerMinute <= 100Sign up for free to access walkthroughs, AI-generated questions, and more.
Get Started Free