Contribute OA questions
OAHelper
CompaniesProblemsTopicsInterview Experiences
Explore
G

Google

sde

Interview Date

17-08-2026

Result

Selected

Difficulty

Easy

Rounds

01

Drive Type

Off-Campus

Interview Date

17-08-2026

Result

Selected

Difficulty

Easy

Rounds

01

Drive Type

Off-Campus

Topics asked

dsa

Detailed experience

Part 1: Algorithmic Problem — Stacks & String Parsing ### Base Problem: Valid Parentheses You are given a string `s` containing just the characters `'('`, `')'`, `'{'`, `'}'`, `'['` and `']'`. Task:** Determine if the input string is valid. An input string is valid if open brackets are closed by the same type of brackets, and they are closed in the correct order. Why is a standard integer counter (incrementing for open, decrementing for close) insufficient when dealing with multiple *types* of brackets? How do you implement a **Stack** (LIFO - Last In, First Out data structure) to solve this? Explain the exact logic: What do you push onto the stack when you see an opening bracket, and how do you validate the stack when you encounter a closing bracket? What must be true about the stack when the loop finishes? - ### Follow-Up 1: Decode String You are given an encoded string. The encoding rule is: `k[encoded_string]`, where the `encoded_string` inside the square brackets is being repeated exactly `k` times. `k` is guaranteed to be a positive integer. Example:* `3[a2[c]]` decodes to `accaccacc`. Task:** Return the decoded string. Why does the presence of nested brackets strongly suggest a Stack or Recursive approach? How do you use **Two Stacks** (or a single stack of tuples/pairs) to keep track of the multiplier `k` and the current string being built? Walk through the logic: When you encounter a `]`, how do you pop the last string and multiplier from the stack, multiply your current string, and append it to the previously built string in $O(N)$ time? - ### Follow-Up 2: Basic Calculator II Given a string `s` which represents an expression, evaluate this expression and return its value. The integer division should truncate toward zero. The string contains integers, `+`, `-`, `*`, and `/` operators, and empty spaces. There are no parentheses. Example:* `" 3+5 / 2 "` evaluates to `5`. Task:** Solve this without using any built-in `eval()` functions. Since there are no parentheses, you only have to deal with the standard order of operations (PEMDAS/BODMAS), specifically processing multiplication and division before addition and subtraction. How do you use a **Stack of Integers** to manage precedence? Explain the logic: When you encounter a `+` or `-`, you push the number (or its negative) onto the stack. But what do you do *immediately* when you encounter a `*` or `/`? How does modifying the top element of the stack on the fly resolve operator precedence? - ## Part 2: AI & LLM Core Concepts (Very Light / Foundational) ### Question 1: System Prompt Leakage Imagine a company builds a customized AI customer service bot and gives it strict, secret instructions (e.g., *"You are the ACME bot. Never offer a refund greater than $50"*). What is **System Prompt Leakage**? How might an ordinary user interact with the chatbot to trick it into revealing those secret, behind-the-scenes instructions verbatim? ### Question 2: VRAM Bottleneck (Video RAM) When hardware enthusiasts discuss running AI locally, they obsess over **VRAM** (the memory built directly onto the graphics card). Why is the *amount* of VRAM often more critical than the sheer processing speed of the GPU? What happens mechanically if a developer tries to load a 10-Billion parameter model onto a graphics card that is just 1 Gigabyte short of the required memory? ### Question 3: LLM Routing (Cost Optimization) Using massive models like GPT-4o for every single user request is extremely expensive. In production software, developers often build an **LLM Router**. Conceptually, what does an LLM Router do? How does it use a very cheap, fast model to evaluate incoming questions and decide which questions actually deserve to be sent to the expensive, highly intelligent model? ### Question 4: Training "Epochs" When researchers describe the process of training a neural network, they will say something like, *"We trained the model for 3 Epochs."* In plain English, what is an Epoch? If showing the AI more data makes it smarter, why don't researchers just train the model for 500 Epochs on the exact same dataset to make it a super-genius?

Posted on - 25 Sept 2026
Company OAsAll ProblemsTopicsCompany InsightsOA CalendarInterview ExperiencesPremium
OAHelper

Built by students, for students - practice company-specific OAs, DSA sheets, and real interview experiences to land your dream role.

© 2026 OAHelper.in·Terms·Privacy·Refunds·Trust & Safety·Contact·
Ready to crack your next OA?

Practice company-specific questions trusted by thousands of students across India.

Start PracticingGo Premium
OA Practice·DSA·Placements

Disclaimer: OAHelper is an independent educational platform. We (oahelper.in) do not own the images or questions shown. Content is uploaded by users.