Zoho L3 Coding Round June 15 2024 || Design Snake Game

Posted
21 Jun 2024
333 reads

Summary

I recently had my third round coding interview with Zoho, where I was tasked with designing a Snake Game.

How it went

Hi everyone, I recently had my third round interview with Zoho, and I wanted to share my experience and the question I encountered. I believe this could be helpful for those preparing for similar interviews. It was a challenging but fun problem that tested my understanding of data structures and algorithms.

Questions asked (1)

  1. 01

    Design Snake Game

    Data Structures & Algorithms · Hard

    You are tasked with designing a Snake game for a device with a screen size specified by the user (height x width). Here are the specifics: The snake starts at the top left corner (0, 0) with a length of 1 unit. You are given an array called food where food[i] = (ri, ci) represents the row and column position of a piece of food. The snake eats the food to grow and increase the score by 1. Food pieces appear sequentially on the screen, meaning the next piece of food will only appear after the current piece has been eaten. It is guaranteed that food will not appear on a block currently occupied by the snake. The game ends if the snake goes out of bounds (hits a wall) or if the snake's head collides with any part of its body. You need to implement the Snake Game based on these rules. Additional Details: Time to complete: 3 hours.

How they prepared

For future candidates, I'd recommend practicing implementing various game simulations. Focus on edge cases like boundary conditions and self-collision detection. Optimizing for efficiency, especially in updating the snake’s position and checking collisions, is also key.

Know someone preparing? Send it to them:WhatsAppLinkedInX

Interviewed at Zoho Corporation recently?

Write up your rounds while you still remember the questions. It helps the next person more than you would think.

Share your experience
Discussion 0

Questions for the author, or how your own interview compared.

Join the discussion

Sign in with Google to comment or ask the author a question.

No comments yet

Be the first to share your thoughts and start the discussion!