Practical coding test for cPanel management panel development
Please provide your details to customize the assessment
Approximately 45-60 minutes depending on your experience level
Your progress is automatically saved in your browser
Test your code with real-time console output
Create responsive UI components using TailwindCSS with varying complexity
Complete 3 progressive coding challenges (20 minutes)
Array methods & basic filtering
Object validation & type checking
Problem solving & optimization
// Server status data
const servers = [
{ id: 'web-01', status: 'running', cpu: 45, memory: 67 },
{ id: 'db-02', status: 'stopped', cpu: 0, memory: 12 },
{ id: 'api-03', status: 'running', cpu: 78, memory: 89 },
{ id: 'cache-04', status: 'running', cpu: 23, memory: 45 }
];
// Task: Get names of running servers with CPU < 50%
// Use array methods (filter, map) and return array of server IDs
// Expected: ['web-01', 'cache-04']
function getHealthyServers(servers) {
// Your solution here
}
// Test it - console.log the result
console.log('Healthy servers:', getHealthyServers(servers));
// User account validation
function validateAccount(user) {
// Rules:
// 1. Username must be at least 3 characters
// 2. Email must contain '@' and '.'
// 3. Age must be 18 or older
// 4. Account must be active
// Return: { valid: boolean, errors: string[] }
// Your solution here
}
// Test cases
const tests = [
{ username: 'jo', email: 'jo@test.com', age: 25, active: true },
{ username: 'sarah', email: 'invalid-email', age: 17, active: true },
{ username: 'mike', email: 'mike@domain.com', age: 30, active: false }
];
tests.forEach((test, i) => {
console.log(`Test ${i + 1}:`, validateAccount(test));
});
// Website traffic calculator
const dailyVisits = [120, 150, 89, 167, 200, 145, 178, 190, 156, 134];
// Calculate:
// 1. Total visits
// 2. Average visits per day
// 3. Highest traffic day (day number, starting from 1)
// 4. Days with above-average traffic
// Return: { total, average, peakDay, aboveAverageDays }
function analyzeTraffic(visits) {
// Your solution here
}
console.log('Traffic Analysis:', analyzeTraffic(dailyVisits));
Analyze real production code and answer questions
// Real Angular service method from our cPanel management system
export class ServerManagementService {
constructor(private http: HttpClient, private notifier: NotificationService) {}
deploySSLCertificate(serverId: string, domain: string, certType: 'letsencrypt' | 'custom') {
const payload = {
server_id: serverId,
domain: domain,
cert_type: certType,
auto_renewal: certType === 'letsencrypt'
};
return this.http.post(`/api/v1/ssl/deploy`, payload).pipe(
tap(response => {
this.notifier.success(`SSL certificate deployed for ${domain}`);
this.updateServerCache(serverId);
}),
catchError(error => {
this.notifier.error(`Failed to deploy SSL: ${error.message}`);
return throwError(() => error);
})
);
}
private updateServerCache(serverId: string) {
this.http.get(`/api/v1/servers/${serverId}/status`).subscribe({
next: (status) => this.serverCache.set(serverId, status),
error: (err) => console.warn('Cache update failed:', err)
});
}
}
What happens when this method is called successfully? List the sequence of events.
How are errors handled in this code? What improvements would you suggest?
Explain what each field in the payload represents and why auto_renewal is conditional.
Identify potential issues and suggest 2-3 improvements to make this code more robust.
Your responses have been submitted successfully and will be reviewed by our team. Thank you for your time and effort in completing this assessment.