Autocoder

UBS interview questions with answers (technology graduates)

Last updated 2026-11-19

UBS hires technology graduates in India into software engineering and data roles. Candidates commonly describe a process with online assessments, possibly a recorded video interview, and technical and behavioural interviews. Technical questions tend to follow the resume (Java, Python, SQL, data pipelines) with some interest in how you think about finance and risk.

The thirteen questions below are practice in that style, with worked answers. They are not past questions. For the online assessment, see UBS coding round questions.

Typical rolesGraduate software engineer, data engineer (India)
Rounds, as commonly reportedOnline assessments, possibly a video interview, technical and HR interviews
Heavy topicsJava or Python, DSA, SQL, data pipelines, basic finance literacy
Hiring newsSee Hiring status below

Rounds as commonly reported

Candidates commonly report online tests, a recorded or live video interview, and one or more technical and behavioural interviews. The exact steps change by programme and year, so use your own invitation.

In the technical interview, expect to write code, discuss a project and answer SQL and data questions. Basic financial vocabulary is not required, but being able to explain a stock, a bond and an option in one sentence each can help show motivation.

What to prepare

Hiring status

There is no UBS hiring-news page on this site, and this page quotes no hiring numbers, dates or packages because none are sourced here. Check UBS's own careers site for current India graduate and technology roles, eligibility and dates, and apply only there.

UBS interview questions with answers (technology graduates): questions with worked answers

  1. 1

    Name useful features added in recent Java versions and show records and switch expressions.

    easy

    Records (Java 16) declare immutable data carriers with a compact syntax and generated equals, hashCode and toString. Switch expressions (Java 14) return a value, need no break and the compiler checks exhaustiveness for enums. Other widely used additions include var for local type inference (10), text blocks (15), sealed classes (17) and pattern matching for instanceof. Interviewers use this to check that you keep up, so mention what you have actually used. Long-term-support releases such as 17 and 21 are what most employers run.

    java
    record Trade(String id, double qty) {}
    class Demo {
        static String label(Trade t) {
            return switch ((int) Math.signum(t.qty())) {
                case 1 -> "buy";
                case -1 -> "sell";
                default -> "flat";
            };
        }
    }
  2. 2

    Explain the Builder pattern and when it is better than a long constructor.

    medium

    Builder constructs an object step by step through named setter-like methods and finishes with build(), which validates and returns an immutable object. It helps when there are many optional parameters, because telescoping constructors are unreadable and error-prone, and when the object must be immutable. Factory methods, by contrast, choose which class to create. Lombok or records with static factories reduce the boilerplate. Validation belongs in build(), so an invalid object can never exist.

    java
    final class Order {
        private final String id; private final int qty; private final String note;
        private Order(Builder b) { id = b.id; qty = b.qty; note = b.note; }
        static class Builder {
            private String id; private int qty = 1; private String note = "";
            Builder id(String v) { id = v; return this; }
            Builder qty(int v) { qty = v; return this; }
            Builder note(String v) { note = v; return this; }
            Order build() {
                if (id == null || qty <= 0) throw new IllegalStateException("invalid order");
                return new Order(this);
            }
        }
    }
  3. 3

    What are decorators and closures in Python, and what does the GIL mean for threads?

    medium

    A closure is an inner function that remembers variables from its enclosing scope. A decorator is a function that takes a function and returns a wrapped one, typically built from a closure; @decorator above a def is shorthand for f = decorator(f). Use functools.wraps to preserve the name and docstring. The Global Interpreter Lock lets only one thread run Python bytecode at a time in CPython, so threads do not speed up CPU-bound code but still help I/O-bound work; use multiprocessing or native extensions for CPU-bound parallelism.

    python
    import functools, time
    def timed(fn):
        @functools.wraps(fn)
        def wrapper(*args, **kwargs):
            t = time.perf_counter()
            try:
                return fn(*args, **kwargs)
            finally:
                print(fn.__name__, time.perf_counter() - t)
        return wrapper
  4. 4

    A system receives millions of trades and you must report the 10 largest at any time. Which data structure do you use?

    medium

    A min-heap of size 10: push each new trade, and if the heap grows beyond 10 pop the smallest. The root is the 10th largest, and the heap holds the top 10 at all times. Each trade costs O(log 10), effectively constant, with O(10) memory, instead of storing and sorting everything. A balanced BST also works if you need removals or range queries. If trades can be cancelled, you need a structure that supports deletion, such as a sorted container or a lazy-deletion heap.

  5. 5

    SQL: turn rows (year, quarter, revenue) into one row per year with a column for each quarter.

    medium

    Use conditional aggregation: SUM(CASE WHEN quarter = 'Q1' THEN revenue END) for each quarter, grouped by year. It works in every database, whereas PIVOT syntax is vendor-specific. Missing quarters give NULL, which you can wrap with COALESCE if zeros are wanted. This is the standard pattern for turning transactional rows into a report layout.

    sql
    SELECT year,
           SUM(CASE WHEN quarter = 'Q1' THEN revenue END) AS q1,
           SUM(CASE WHEN quarter = 'Q2' THEN revenue END) AS q2,
           SUM(CASE WHEN quarter = 'Q3' THEN revenue END) AS q3,
           SUM(CASE WHEN quarter = 'Q4' THEN revenue END) AS q4
    FROM Revenue
    GROUP BY year;
  6. 6

    Describe the SQL transaction isolation levels and the anomalies each prevents.

    hard

    Read uncommitted allows dirty reads (seeing uncommitted changes). Read committed prevents dirty reads but allows non-repeatable reads (a row changes between two reads in one transaction). Repeatable read prevents that but may allow phantoms (new rows matching a query appear), although some databases such as PostgreSQL prevent phantoms at this level using snapshots. Serialisable behaves as if transactions ran one after another, at the highest cost in locking or retries. Most systems default to read committed and raise the level only for specific operations.

  7. 7

    Explain recursion versus iteration using Fibonacci, and how memoisation changes the complexity.

    easy

    The naive recursive fib(n) = fib(n-1) + fib(n-2) recomputes the same subproblems, giving exponential time (about 1.6^n). Memoisation stores each result the first time it is computed, so each value is computed once: O(n) time and O(n) space. The iterative version keeps just two variables: O(n) time and O(1) space and no recursion limit. Python's functools.lru_cache applies memoisation with one line, but very deep recursion can still exceed the recursion limit.

  8. 8

    How would you evolve a REST API without breaking existing clients?

    medium

    Treat the API as a contract. Add new optional fields and new endpoints freely, since well-behaved clients ignore unknown fields; never remove or rename a field, or change its meaning, in place. When you must make a breaking change, introduce a new version (in the path or a header), run both versions, deprecate the old one with a published timeline, and monitor usage before removing it. Consumer-driven contract tests catch accidental breaks early.

  9. 9

    In simple terms, what are a stock, a bond and an option?

    easy

    A stock is a share of ownership in a company, with possible dividends and a price that moves with the company's prospects. A bond is a loan to a company or government that pays regular interest (the coupon) and returns the principal at maturity. An option gives the right, but not the obligation, to buy (call) or sell (put) an asset at a set price (the strike) before a set date, in exchange for a premium. Financial technology interviews do not expect you to be a trader, but a clear one-line understanding of each shows interest.

  10. 10

    What is the difference between ETL and ELT, and what data quality checks would you add to a pipeline?

    medium

    ETL extracts data, transforms it in a separate processing layer and then loads the cleaned result; ELT loads raw data into the warehouse first and transforms it there using the warehouse's compute, which suits modern cloud warehouses and keeps the raw data for reprocessing. Useful data quality checks: row counts against the source, null checks on key columns, uniqueness of keys, referential integrity, value ranges and freshness (the data arrived on time). Fail the load or quarantine bad rows, and alert someone.

  11. 11

    Why UBS, and what would you like to build there?

    easy

    Say what appeals to you in the problem space: a firm in wealth management and investment banking works with sensitive client data, long-lived systems and regulation, which makes reliability and security central. Then connect that to your own interests, such as data platforms or secure APIs, and to a project you have built. Be careful not to quote details about the firm that you cannot verify on its own website.

  12. 12

    How do you make sure the code you write is correct and maintainable?

    medium

    Describe concrete habits: writing tests for edge cases first or alongside the code, small functions with clear names, code reviews, running static analysis and linters, and keeping changes small. Give one example of a bug that a test caught. In regulated environments, mention traceability: clear commit messages and linking changes to a requirement.

  13. 13

    Tell me about working in a team with people from different backgrounds.

    medium

    Choose a real team, such as a college project with members from different branches or regions. Explain one difference in working style or communication, how you adapted (written summaries, agreed meeting times, explaining jargon), and the result. Show curiosity and respect rather than treating differences as obstacles. Global banks operate across cultures, so this question is practical.

Frequently asked questions

Do I need finance knowledge for a UBS technology interview?

You are not expected to be an expert. Understanding a few basics such as stocks, bonds and options shows interest and helps with domain questions.

Is there a video interview?

Some graduate processes are reported to include one. Check your invitation for the format and rules.

Which languages are common?

Java and Python are common, depending on the team. Prepare the language on your resume in depth.

Where can I see current openings?

Use UBS's own careers site. This page quotes no hiring numbers because none are sourced here.

Related guides

More in Company Interview Questions

See all in this section