26 North America’s latest Barclays OA interview experience sharing | 240 minutes of real hard-core algorithms + simulation questions

27 Views

This time Barclays overall feeling about OA is that the time is quite long and the information density is quite high. If you have not been exposed to similar question types in advance, it is easy to be consumed in the middle and later stages.

OA is given a total of 240 minutes that seems to be plenty of time, but the topic description is long, there are many rules, and the boundaries are complex. After actually doing it, you will find that the time is actually very tight. This is not the kind of process that ends with just a few algorithm questions, but a test that is more of a "complete engineering thinking".

Barclays OA Basics Overview

This Barclays OA is a pure online programming test, combining the overall partial algorithm with simulation.

  • Total duration: 240 minutes
  • Question type: Coding + Rule Simulation
  • Optional languages: Java/C++/Python
  • Key inspections: complex rule understanding, status management, and boundary processing capabilities

The overall difficulty lies not in how difficult the algorithm itself is, but in the fact that the description of the question is quite long and requires high details and execution.

Barclays OA real question sharing and in-depth analysis

Topic 1: Robot Cleaner

The main idea of ​​the title: Give you a room map (Grid),# It's a wall,. It's an open space,* Is your starting point. You need to write an algorithm to control the robot to move up, down, left, and right, and scan all accessible open spaces in the room.
Notice: The output is not the number of steps, but a complete sequence of movement instructions (such as ">>v<^...").

26 North America’s latest Barclays OA interview experience sharing | 240 minutes of real hard-core algorithms + simulation questions
26 North America’s latest Barclays OA interview experience sharing | 240 minutes of real hard-core algorithms + simulation questions

Ideas for solving the problem (knocking on the blackboard): Don’t even think about using BFS (Breadth First) for this question, because robots can’t teleport! It has to actually be walked over and back again. The most stable solution is DFS (one road goes to black):

  1. Walk away silently: Choose a direction, and as long as you don’t hit the wall and haven’t been there, keep walking, and record the instructions at the same time (such as >).
  2. What should I do if I hit a wall? When there is no way to go, backtrack.
  3. Big pitfalls : Many students only remember to go in recursively and forget to record the way back!
    • For example, you just turned to the right > When you reach a dead end and return recursively, you must add a left direction to the path string. < The command allows the robot to return to the previous intersection so that it can explore other roads.

Topic 2: Minimum Chairs

The main idea of ​​the title: This is much simpler. Give you a string of characters S, representing a bunch of people coming in and out:

  • 'S' (Start) = Someone comes in
  • 'E' (End) = One person left. How many people are there at most in the room at the same time? (That is, at least a few chairs need to be prepared).

Ideas for solving the problem: This is a simple simulation/greedy question. Just imagine a counter in your mind:

  • See S At once +1, and see if the current number is the highest in history. If so, update the record.
  • See E At once -1.
  • Finally, just output the "historical highest value".

Reference code (Java):

Class Solution {
    public int solution(String S) {
        int maxChairs = 0; // Historical peak value
        int currentPeople = 0; // Current number of people

        for (char event : S.toCharArray()) {
            if (event == 'S') {
                currentPeople++;
                // Only when there are more people do you need to check whether there are enough chairs
                maxChairs = Math.max(maxChairs, currentPeople);
            } else if (event == 'E') {
                currentPeople--;
            }
        }
        
        return maxChairs;
    }
}

OA strategy experience

To be honest, Barclays' OA tests more on your ability to handle complex rules and states, not just the algorithm itself. My experience is that when you encounter a problem, don’t rush to start writing code. First understand the meaning of the problem thoroughly before starting. For a question like Robot Cleaner, first mark the starting point, wall and open space on the paper, clarify the possible actions of the robot at each step, and figure out the boundary conditions first. This is much more stable than writing DFS directly.

When doing simulation questions, status management is critical. Every step you take or backtrack must be recorded clearly in your mind or code, otherwise it is easy to miss the path or double-count. Even if time is tight, you must first ensure that the logic is correct before considering optimization - after all, the focus of OA inspection is execution and completeness, rather than the pursuit of ultimate performance from the beginning.

Time management advice

240 minutes sounds like a lot, but if you actually do it, you will find that the amount of information in the questions is quite large, especially the rule simulation questions that are easily consumed by the rhythm in the middle and later stages. My experience is to start with easy questions then difficult ones: take simple questions like Minimum Chairs first, get a sure score quickly, and then focus on complex questions like Robot Cleaner.

When doing the questions, you can mentally time yourself in chunks. For example, set aside one to one and a half hours for Robot Cleaner, 30 minutes for Minimum Chairs, and leave the remaining time for inspection and debugging. It is best to check the simulation questions while writing. Do not leave it to the last breath to check the whole situation, otherwise it will be difficult to find the mistakes.

Common pitfalls

The biggest pitfall of this type of OA is actually the details. For example, in Robot Cleaner, if the backtracking path forgets to add the return action, the entire movement instruction will be wrong; in Minimum Chairs, if the counter is not updated properly, the historical peak value will be wrong. There are also some small details, such as the input may be empty, the starting point of the robot is surrounded by a wall, or the output requirement is an action sequence instead of a number of steps. These are easy points to step on.

So, when doing the questions, be slower but more careful, and ensure that every step is completely established in your mind or code and it is more reliable than blindly chasing speed.

Remote assist experience sharing

In fact, many students' rhythm is easily disrupted in this kind of long-term OA with complex rules. If you want to keep your thinking clear during the exam and grasp the key points of the questions, the remote assistance service provided by Programhelp will be very helpful:

Real-time voice reminder: When you encounter boundaries or rules that are easy to ignore, you will be prompted with the direction of your thinking as soon as possible.

Code assistance: Provide templates and key ideas to help you complete complex simulation questions within a limited time

OA ghostwriting/tutoring: Hands-on throughout the entire process, covering complete guidance from problem analysis to code implementation

VO & interview assistance: Not only OA, but also behavioral/VO interviews can get voice prompts and answer strategies

If you also want to maintain the rhythm in Barclays or other long-term OA with complex rules without being slowed down by details, you might as well try Programhelp Remote assist. Whether it is OA question analysis, code implementation, or VO/Behavioral interview question answering strategies, you can get real-time guidance and voice reminders, so that you can calm down at critical moments and exert your greatest strength.

author avatar
Jory Wang Amazon Senior Software Development Engineer
Amazon senior engineer, focusing on the research and development of infrastructure core systems, with rich practical experience in system scalability, reliability and cost optimization. Currently focusing on FAANG SDE interview coaching, helping 30+ candidates successfully obtain L5/L6 Offers within one year.
END