Old PC vs New AI: Can a 2015 Desktop Actually Run Gemma 4? (2B vs 4B Benchmark)
Benchmarking Gemma 4 E2B and E4B models running locally with Ollama on a 2015 desktop — speed, reasoning, code generation, structured output, and instruction following.
Old PC vs New AI: Can a 2015 Desktop Actually Run Gemma 4? (2B vs 4B Benchmark)
Running modern AI models locally on older hardware sounds almost impossible. But with smaller models like Gemma 4 and tools like Ollama, local AI is starting to become surprisingly accessible even on aging machines.
I still have my old desktop computer, bought back in 2015. It is still fast enough for development and even for playing some of my favorite games. At this point, it feels like a member of the family (it’s actually older than my oldest kid).
The only thing it could never really handle was running AI models locally. But now, models seem to be getting much more friendly toward older CPUs, GPUs, and limited RAM, so I finally decided to give it a try with Gemma 4.
I want to create a whole series around Gemma 4. First, I’ll explore how to run Gemma 4 locally on older hardware and benchmark it to see whether it is actually usable and which model variants work best for my specific setup. Then, I want to build something useful where Gemma 4 becomes the core of the application.
So, let’s dive in.
Table of Contents
- Old PC vs New AI: Can a 2015 Desktop Actually Run Gemma 4? (2B vs 4B Benchmark)
Choosing right Gemma 4 Variation
Before choosing the right variant, let’s take a look at my old setup:
| Component | Value |
|---|---|
| CPU | Intel(R) Core(TM) i5-6400 CPU @ 2.70GHz Core |
| RAM | 24 GB |
| GPU | NVIDIA GeForce GTX 950 2GB VRAM |
What does this tell us?
We should stay realistic and focus on the smaller models. Based on some recommendations online:
Gemma 4 Memory Requirements
| Model Variant | Minimum RAM/VRAM | Ideal RAM/VRAM |
|---|---|---|
| Gemma 4 E2B | 4 GB | 8 GB |
| Gemma 4 E4B | 6 GB | 12 GB |
| Gemma 4 26B (MoE) | 18 GB | 24 GB |
| Gemma 4 31B (Dense) | 22 GB | 32 GB |
With 24 GB of RAM and i5-6400 CPU, I should be able to run E2B and E4B quite comfortably. The 26B model is likely beyond what this system can realistically handle, and the 31B variant is out of reach for this setup.
Basic Gemma 4 Knowledge
For anyone wondering what terms like E2B or E4B mean:
- The “B” stands for billions of parameters, which describes the size of the model.
- The “E” stands for effective parameters.
These models are designed for edge and local deployment, meaning they are optimized to run efficiently on consumer hardware.
In simple terms, parameters are the internal values the model learns during training. They represent patterns in data that the model uses to generate responses.
You can think of parameters as the model’s capacity to learn and generalize patterns, rather than stored factual knowledge.
Examples:
- 2B → ~2 billion parameters
- 4B → ~4 billion parameters
- 26B → ~26 billion parameters
Installing and Running Gemma 4
First, we need to download Ollama, which will act as our local “AI server”. Ollama handles model downloading, hardware optimization, and model management, so the only thing we really need to focus on is prompting.
It is probably the easiest way to bridge the gap between “having a computer” and “having a private local ChatGPT”.
After installing Ollama, we can run the following commands to download and start both Gemma 4 models:
ollama run gemma4:e2b
ollama run gemma4:e4b
Finished installation of E2B:
ollama run gemma4:e2b
pulling manifest
pulling 4e30e2665218: 100% ▕██████████████████████████████████████████████████████████▏ 7.2 GB
pulling 7339fa418c9a: 100% ▕██████████████████████████████████████████████████████████▏ 11 KB
pulling 56380ca2ab89: 100% ▕██████████████████████████████████████████████████████████▏ 42 B
pulling c6bc3775a3fa: 100% ▕██████████████████████████████████████████████████████████▏ 473 B
verifying sha256 digest
writing manifest
success
Finished installation of E4B:
PS C:\Users\dbalc> ollama run gemma4:e4b
pulling manifest
pulling 4c27e0f5b5ad: 100% ▕██████████████████████████████████████████████████████████▏ 9.6 GB
pulling 7339fa418c9a: 100% ▕██████████████████████████████████████████████████████████▏ 11 KB
pulling 56380ca2ab89: 100% ▕██████████████████████████████████████████████████████████▏ 42 B
pulling f0988ff50a24: 100% ▕██████████████████████████████████████████████████████████▏ 473 B
verifying sha256 digest
writing manifest
success
In total, you will need around 6.5 GB for Ollama itself, plus an additional 7.2 GB or 9.6 GB depending on which model you install.
Once the model is downloaded, you can immediately start chatting directly in the terminal:
>>> Send a message (/? for help)
The next time you run:
ollama run gemma4:e2b
or
ollama run gemma4:e4b
Ollama will simply load the already downloaded model, and you can start chatting immediately.
Note: Ollama also allows you to use local models directly inside VS Code Copilot Chat. Simply run:
PowerShell ollama launch vscodeplaintext Then select your local model in VS Code. More details: Ollama VS Code Integration
Benchmarks
I want to benchmark these models to see how much CPU, RAM, and GPU resources they actually consume on my old machine across different prompt categories. I also want to compare response quality and generation speed between both models.
To avoid mixing unrelated metrics, I split evaluation into focused benchmark categories.
Each benchmark table is designed to measure one specific aspect of the model’s behavior, instead of trying to evaluate everything at once.
This is important because different aspects of an AI model behave very differently:
- Performance (tokens per second, TPS) tells us how fast the model generates text.
- Reasoning quality tells us how well the model solves problems and follows logic.
- Structured output reliability tells us how consistently the model can follow strict formats like JSON.
Combining these metrics into a single benchmark would produce misleading results. For example, a JSON task might look “slow” just because the output is longer, not because the model is actually slower.
That’s why each table uses carefully designed prompts that match the metric being measured:
- Speed tests use similar, comparable prompts to fairly measure token generation throughput (tokens per second).
- Reasoning tests use multi-step logic and problem-solving tasks to evaluate correctness and reasoning quality, not speed.
- Structured output tests enforce strict JSON formatting rules to measure schema adherence and output reliability.
- Code generation tests evaluate correctness, compilability, and code structure in practical C# and .NET scenarios.
- Knowledge tests assess factual recall and basic understanding of geographic or general domain knowledge.
- Instruction following tests measure how well models comply with explicit constraints such as word limits and language restrictions.
Each benchmark section includes full model outputs, allowing readers to independently review and verify the results.
System metrics such as CPU and RAM usage were measured during sustained model sessions, while response-specific metrics were recorded individually for each prompt execution.
Before each benchmark, I performed a warm-up phase by sending 4 prompts to the model. This ensures the model is already loaded into memory, allowing Ollama to utilize CPU, RAM, and GPU resources more consistently during testing.
All benchmarks were run using Ollama version 0.23.2 with default model settings in PowerShell terminal.
Speed Benchmark
Ollama exposes detailed runtime metrics for each inference request by setting verbose level:
/set verbose
After each prompt, Ollama outputs detailed runtime metrics such as:
total duration: 1m56.4241285s #This represents full request lifecycle latency.
load duration: 1m6.4841917s #This primarily represents model initialization overhead and is most visible during cold starts or after the model has been unloaded from memory.
# This measures input ingestion speed (how quickly the model encodes and understands the prompt before generating output).
prompt eval count: 19 token(s)
prompt eval duration: 912.2499ms
prompt eval rate: 20.83 tokens/s
# This is the model’s output generation speed, measured in tokens per second. It is the primary indicator of inference performance.
eval count: 357 token(s)
eval duration: 48.4355362s
eval rate: 7.37 tokens/s
Load duration represents model initialization time, while total duration includes the full request lifecycle.
Prompt evaluation measures input processing speed, and evaluation rate represents token generation throughput.
In this benchmark, evaluation rate is used as the primary performance indicator, while other metrics provide context for system overhead.
For clarity, the benchmark tables rename these metrics slightly:
Prompt Tokens/s = prompt eval rate
Generation Tokens/s = eval rate
To improve result consistency, I will run each prompt four times for every model and calculate the average values.
Prompts
| Task | Prompt |
|---|---|
| REST API explanation | Explain what a REST API is in one paragraph. |
| Docker summary | Summarize Docker in exactly 3 sentences. |
2B Outputs
REST API explanation
Click to expand REST API explanation
```PowerShell A REST API (Representational State Transfer) is an architectural style that defines a set of rules for how software components should communicate over the internet. It functions as a standardized interface, allowing different applications to interact with each other by focusing on **resources** (like users or products) identified by unique URLs. Communication between the client and the server is typically done using standard HTTP methods—such as GET (to retrieve data), POST (to submit new data), PUT (to update data), and DELETE (to remove data)—making the communication efficient, scalable, and stateless. ```Docker summary
Click to expand Docker summary
```PowerShell Docker is a platform that uses containerization technology to package applications and all their dependencies into standardized, isolated units called containers. These containers ensure that an application runs consistently and predictably across any computing environment, solving the common problem of environmental incompatibility. This portability makes deploying and scaling applications significantly easier and more efficient across development and production systems. ```4B Outputs
REST API explanation
Click to expand REST API explanation
```PowerShell A REST API (Representational State Transfer Application Programming Interface) is essentially a set of rules and guidelines that dictates how two separate pieces of software communicate and exchange data over the internet, acting as a universal translator for web services. Instead of needing complex, proprietary methods, REST organizes all information into easily identifiable "resources" (like a user or a product) that are addressed via specific URLs. To interact with these resources, the system uses standard HTTP verbs: `GET` to read data, `POST` to create it, `PUT` to update it, and `DELETE` to remove it. Because it relies on these simple, standardized methods—and formats data like JSON or XML—REST makes the web highly modular and scalable, ensuring that any client application, regardless of its underlying language, can reliably and efficiently access and manipulate data from any server. ```Docker summary
Click to expand Docker summary
```PowerShell Docker is a platform that enables developers to containerize applications, bundling the code, runtime, libraries, and all dependencies into a single, portable unit called a container. These containers package an application into a consistent, isolated environment, which effectively solves the "it works on my machine" problem by ensuring the application runs identically regardless of the underlying operating system. This portability makes deployment immensely reliable and efficient, allowing developers to quickly build, test, and scale applications across any machine or cloud environment. ```Results
| Prompt | Model | Prompt Tokens/s (avg) | Generation Tokens/s (avg) | Total Time (avg) |
|---|---|---|---|---|
| REST API explanation | 2B | 473.86 | 6.91 | 64.00s |
| REST API explanation | 4B | 237.49 | 5.03 | 116.55s |
| Docker summary | 2B | 877.51 | 6.46 | 56.08s |
| Docker summary | 4B | 479.66 | 5.04 | 65.00s |
The 2B model completed both tasks noticeably faster, completing the Docker summary in 56 seconds and the REST API explanation in 64 seconds. The 4B model was slower, taking around 65 seconds for the Docker summary and nearly 2 minutes (116 seconds) for the REST API explanation.
Both the REST API explanation and Docker summary responses from the 2B model were technically correct. However, for non-technical users, the answers might feel too short and somewhat difficult to fully understand without additional context.
The 4B model consistently generated responses more slowly, although the performance gap varied significantly between prompts. For the REST API explanation it took nearly twice as long (116s vs 64s), while for the Docker summary the difference was much smaller (65s vs 56s). Output token generation also lagged behind, averaging around 5 TPS compared to the 2B’s ~6.7 TPS. Despite the lower throughput, the 4B model produced more detailed and easier-to-follow explanations for both topics.
Reasoning Benchmark
Reasoning performance was evaluated using simple logic and multi-step problem-solving tasks. In this section, correctness and reasoning quality are prioritized over execution speed.
| Task | Prompt |
|---|---|
| Logic puzzle | A car travels from City A to City B at 60 km/h and returns along the same route at 90 km/h. The total travel time for both trips is 5 hours. What is the total distance traveled? Show your reasoning step by step. |
| Trip budget check | You have €450 for a 4-day trip. Accommodation costs €70 per night (3 nights). Daily transport is €15. You plan to eat out twice a day at an average of €12 per meal. How much money is left for activities and shopping? Show your reasoning. |
2B Outputs
Logic puzzle
Click to expand Logic puzzle
```PowerShell This is a classic distance, rate, and time problem. We need to find the one-way distance first and then double it to find the total distance traveled. ### Step-by-Step Reasoning **1. Define the variables:** * Let $D$ be the distance between City A and City B (in km). * Speed from A to B ($v_1$): $60 \text{ km/h}$ * Speed from B to A ($v_2$): $90 \text{ km/h}$ * Total Time ($T$): $5 \text{ hours}$ **2. Express the time for each leg of the journey:** We use the formula: $\text{Time} = \frac{\text{Distance}}{\text{Speed}}$ * **Time for the trip from A to B ($t_1$):** $$t_1 = \frac{D}{60}$$ * **Time for the return trip from B to A ($t_2$):** $$t_2 = \frac{D}{90}$$ **3. Set up the equation for the total time:** The sum of the time for both trips equals the total travel time: $$t_1 + t_2 = T$$ $$\frac{D}{60} + \frac{D}{90} = 5$$ **4. Solve the equation for D:** To add the fractions on the left side, find a common denominator for 60 and 90. The Least Common Multiple (LCM) of 60 and 90 is 180. * Convert the fractions: $$\frac{D \times 3}{60 \times 3} + \frac{D \times 2}{90 \times 2} = 5$$ $$\frac{3D}{180} + \frac{2D}{180} = 5$$ * Combine the fractions: $$\frac{3D + 2D}{180} = 5$$ $$\frac{5D}{180} = 5$$ * Simplify the fraction $\frac{5}{180}$: $$\frac{D}{36} = 5$$ * Solve for $D$: $$D = 5 \times 36$$ $$D = 180$$ The one-way distance between City A and City B is $180 \text{ km}$. **5. Calculate the total distance traveled:** The total distance traveled is the distance from A to B plus the distance from B to A (the round trip). $$\text{Total Distance} = D + D = 2D$$ $$\text{Total Distance} = 2 \times 180$$ $$\text{Total Distance} = 360 \text{ km}$$ --- ### Answer: The total distance traveled is **360 km**. ```Trip budget check
Click to expand Trip budget check
```PowerShell This is how to calculate the remaining money: ### 1. Calculate Accommodation Costs * **Cost:** €70 per night * **Duration:** 3 nights (for a 4-day trip) * **Calculation:** $€70 \times 3 = €210$ ### 2. Calculate Transport Costs * **Cost:** €15 per day * **Duration:** 4 days * **Calculation:** $€15 \times 4 = €60$ ### 3. Calculate Food Costs * **Meals per day:** 2 meals * **Cost per meal:** €12 * **Daily food cost:** $2 \times €12 = €24$ * **Total food cost (4 days):** $€24 \times 4 = €96$ ### 4. Calculate Total Expenses * **Accommodation:** €210 * **Transport:** €60 * **Food:** €96 * **Total Expenses:** $€210 + €60 + €96 = €366$ ### 5. Calculate Remaining Money * **Starting Budget:** €450 * **Total Expenses:** €366 * **Remaining Money:** $€450 - €366 = €84$ *** **Answer:** You have **€84** left for activities and shopping. ```4B Outputs
Logic puzzle
Click to expand Logic puzzle
```PowerShell This problem requires using the relationship $\text{Time} = \frac{\text{Distance}}{\text{Rate}}$ and setting up an equation based on the total time spent traveling. ### Step 1: Define Variables Let $D$ be the distance between City A and City B (in km). * $R_{out}$ (Rate from A to B): $60 \text{ km/h}$ * $R_{return}$ (Rate from B to A): $90 \text{ km/h}$ * $T_{total}$ (Total time): $5 \text{ hours}$ ### Step 2: Express Time for Each Leg of the Journey We calculate the time taken for the outward trip ($T_{out}$) and the return trip ($T_{return}$). $$T_{out} = \frac{D}{R_{out}} = \frac{D}{60}$$ $$T_{return} = \frac{D}{R_{return}} = \frac{D}{90}$$ ### Step 3: Set Up the Total Time Equation The sum of the times must equal 5 hours: $$T_{out} + T_{return} = T_{total}$$ $$\frac{D}{60} + \frac{D}{90} = 5$$ ### Step 4: Solve for the One-Way Distance ($D$) To combine the fractions, find the Least Common Multiple (LCM) of 60 and 90. LCM$(60, 90) = 180$. Rewrite the equation using the common denominator: $$\frac{D \cdot 3}{180} + \frac{D \cdot 2}{180} = 5$$ Combine the terms: $$\frac{3D + 2D}{180} = 5$$ $$\frac{5D}{180} = 5$$ Simplify the fraction $\frac{5D}{180}$ to $\frac{D}{36}$: $$\frac{D}{36} = 5$$ Multiply both sides by 36 to solve for $D$: $$D = 5 \times 36$$ $$D = 180 \text{ km}$$ The one-way distance between City A and City B is 180 km. ### Step 5: Calculate the Total Distance Traveled The total distance traveled is the distance from A to B plus the distance from B to A. $$\text{Total Distance} = \text{Distance}_{A \to B} + \text{Distance}_{B \to A}$$ $$\text{Total Distance} = D + D = 2D$$ $$\text{Total Distance} = 2 \times 180 \text{ km}$$ $$\text{Total Distance} = 360 \text{ km}$$ *** ### Answer The total distance traveled is **360 km**. (Check: Time out = 180/60 = 3 hours. Time back = 180/90 = 2 hours. Total time = 3 + 2 = 5 hours. This matches the given information.) ```Trip budget check
Click to expand Trip budget check
```PowerShell This is a calculation of all fixed expenses to determine the remaining balance for discretionary spending. ### 💰 Calculation Breakdown **1. Accommodation Cost (3 Nights):** $$€70 \text{ per night} \times 3 \text{ nights} = €210$$ **2. Transport Cost (4 Days):** $$€15 \text{ per day} \times 4 \text{ days} = €60$$ **3. Food Cost (2 meals/day for 4 days):** $$€12 \text{ per meal} \times 2 \text{ meals} \times 4 \text{ days} = €96$$ **4. Total Expenses:** $$\text{Accommodation} + \text{Transport} + \text{Food}$$ $$€210 + €60 + €96 = €366$$ **5. Remaining Money (For Activities/Shopping):** $$\text{Total Budget} - \text{Total Expenses}$$ $$€450 - €366 = €84$$ *** **Answer:** You will have **€84** left for activities and shopping. ```Results
| Prompt | Model | Correct Answer (Y/N) |
|---|---|---|
| Logic puzzle | 2B | Y |
| Logic puzzle | 4B | Y |
| Trip budget check | 2B | Y |
| Trip budget check | 4B | Y |
Both models solved the reasoning tasks correctly and demonstrated reliable multi-step reasoning and calculation abilities. The 4B model generally produced more structured and polished explanations, particularly in the logic puzzle where the additional formatting and final validation step improved readability and reasoning transparency.
The 2B model, while less verbose, often delivered more direct and concise reasoning. In the trip budget scenario, its simpler breakdown arguably made the calculation easier to follow without unnecessary formatting or additional commentary.
Overall, the reasoning differences between the two models were relatively small for these benchmark tasks. The 4B model emphasized presentation, structure, and answer verification, while the 2B model prioritized brevity and efficiency.
Knowledge Benchmark
This benchmark evaluates how well the models retrieve factual information and apply that knowledge in practical travel-related scenarios.
The trip-planning task combines factual geographic knowledge with contextual recommendation quality, making it less deterministic than the coordinate retrieval task.
| Task | Prompt |
|---|---|
| Geographic knowledge | Give me the GPS coordinates of Brno, Czech Republic. |
| Trip planning | Suggest a family-friendly destination within 3 hours of Olomouc for a 3-day trip in May. Briefly explain why. |
2B Outputs
Geographic knowledge
Click to expand Geographic knowledge
```PowerShell The approximate GPS coordinates for Brno, Czech Republic are: **Latitude:** 49.1435° N **Longitude:** 16.5035° E ```Trip planning
Click to expand Trip planning
```PowerShell Based on your starting point in Olomouc, and the constraints (3 hours travel, family-friendly, 3 days in May), I suggest: ### Destination Suggestion: The Salzkammergut Region, Austria (Focusing on Salzburg/Hallstatt area) ### Why this destination is ideal: 1. **Travel Time:** The Salzkammergut region is easily accessible from Olomouc, typically requiring about **2.5 to 3 hours** of driving, fitting your travel window perfectly. 2. **Family Appeal & Activities:** This region is renowned for its stunning Alpine scenery, pristine lakes, charming villages, and rich history. It offers a perfect blend of nature, gentle hiking, and cultural stops that appeal to families. * **Activities:** Boat rides on the lakes, visiting famous lakes like Wolfgangsee, gentle hikes, and exploring historic castles (like those near Salzburg). 3. **May Timing:** May is an excellent time to visit. The crowds of peak summer are gone, meaning you can enjoy the beautiful landscapes and outdoor activities with fewer crowds and slightly more manageable temperatures than mid-July or August. 4. **3-Day Itinerary:** You can easily structure three days to focus on different areas: * **Day 1:** Explore a major town like Salzburg or a lakeside village. * **Day 2:** Focus on scenic activities (e.g., lake cruises or moderate hiking). * **Day 3:** Visit a unique, picturesque location (like the famous Hallstatt area, though slightly further, or explore the charming villages of the region). *** ### Alternative Suggestion (Closer/Easier): Bratislava, Slovakia If you prefer a slightly closer, more urban, and easily walkable trip, **Bratislava** is an excellent alternative. * **Pros:** Very easy travel (under 2.5 hours), charming Old Town, great riverside walks, and diverse food options. * **Cons:** Less focus on wide-open Alpine nature compared to the Austrian option. ```4B Outputs
Geographic knowledge
Click to expand Geographic knowledge
```PowerShell The approximate coordinates for Brno (the main city center) in the Czech Republic are: **Latitude:** 49.1919° N **Longitude:** 16.6904° E *(Note: Coordinates can vary slightly depending on the exact point within the city center, but these are accurate for the general urban center.)* ```Trip planning
Click to expand Trip planning
```PowerShell The best family-friendly destination for a 3-day trip from Olomouc in May, while staying within the 3-hour driving radius, is **Kraków, Poland**, or the surrounding Lesser Poland region. *** ### Why Kraków is Ideal for a May Family Trip: **1. Perfect Timing and Activities for May:** May is late spring—the weather is generally mild, the flowers are blooming, and the crowds are less intense than in high summer. This makes outdoor exploration (walking, cycling, visiting parks) ideal. **2. Manageable Size and Universal Appeal:** Kraków has a fantastic, walkable Old Town (Stare Miasto) that is visually captivating and easy for families to navigate. Unlike massive capital cities, it feels compact enough to explore thoroughly in 3 days without feeling rushed. **3. Excellent Family Diversification:** The trip offers a perfect blend of activities: * **Historical Exploration:** Visiting Wawel Royal Castle grounds (kids can explore the castle courtyard and gardens) and exploring the beautifully preserved main square. * **Nature & Parks:** The city is surrounded by beautiful parks and green spaces for running around after a long day of sightseeing. * **Day Trips:** You can easily plan a half-day trip to nearby locations like **Oświęcim** (for history lessons appropriate for older children) or explore the charming, smaller town of **Kazimierz** (the Jewish Quarter, which has unique markets and atmosphere). **Travel Note:** The drive is straightforward and typically takes between 2.5 to 3 hours, depending on traffic and border crossing. ```Results
| Prompt | Model | Accuracy | Quality (1–5) | Notes |
|---|---|---|---|---|
| Geographic knowledge | 2B | Approximate | 3 | Coordinates near Brno but noticeably offset |
| Geographic knowledge | 4B | High | 4 | Coordinates close to Brno city center |
| Trip planning | 2B | Partial | 3 | Main recommendation exceeded travel constraint |
| Trip planning | 4B | Partial | 4 | Recommendation closer to requested travel limit |
In the geographic knowledge task, both models returned approximate coordinates for Brno rather than exact city-center values. The 2B model produced coordinates that were noticeably offset from central Brno, while the 4B model returned a more accurate location closer to the city center.
The trip-planning task revealed a more significant limitation in constraint handling. The 2B model suggested the Salzburg region, which exceeds the requested 3-hour travel limit by a large margin. However, its alternative recommendation of Bratislava fit the travel constraint much better and remained relevant for a family-oriented trip.
The 4B model suggested Kraków, which was closer to the requested travel limit but still exceeded it slightly at roughly 3.5 hours by car. Despite the inaccurate travel estimation, both models generated generally relevant and family-friendly activity suggestions for their proposed destinations.
Overall, the 4B model demonstrated better factual precision and stronger constraint awareness, although neither model consistently satisfied all prompt requirements.
Code Generation
Code generation was evaluated using practical C# and .NET-focused tasks. The focus is on correctness, compilability, and structural quality of the generated code. Execution speed is optional, as output length varies depending on implementation detail.
| Task | Prompt |
|---|---|
| String reverse | Write a C# static method that reverses a string. |
| LINQ filtering | Write a LINQ query that filters travel destinations with price under 100 EUR and rating above 4. |
2B Outputs
C# string reverse
Click to expand C# string reverse
```csharp Here is the C# code for a static method that reverses a string, using the `StringBuilder` class for efficient string manipulation: using System.Text; public class StringReverser { ////// Reverses the characters of a given string. ///
/// The string to be reversed.</param> ///LINQ filtering