Practice Real Company Assessment Patterns • Latest 2025–2026 Mock Tests

Programming Exercises

Create a responsive grid layout where items rearrange based on screen size using only CSS.

Hard

Problem Statement

Create a responsive grid layout where items rearrange based on screen size using only CSS.

Sample Output

The items rearrange into a grid layout of two columns on larger screens and one column on smaller screens.

Limits

Time: 2s · Memory: 256 MB

Code Editor

Try your code in this preview. Submit marks it done.

<!DOCTYPE html> <html> <head> <style> /* Add CSS here to create the responsive grid layout */ </style> </head> <body> <div class="grid"> <div class="item">1</div> <div class="item">2</div> <div class="item">3</div> <div class="item">4</div> <div class="item">5</div> <div class="item">6</div> </div> </body> </html>

Document

To view the HTML changes, please type the code within the editor