Skip to content

Brain Station 23

Founding year2006
Company Websitehttp://www.brainstation-23.com/
Career Websitehttps://erp.bs-23.com/jobs
Technologies UsedAndroid, IOS, React, React-Native, Odoo, Xamarin, .Net, PHP, Python, Java, AEM, Sitecore, Flutter

Introduction

Brain Station 23 is at the forefront of global digital transformation, delivering state-of-the-art technology solutions designed to propel businesses into the future. With expertise spanning software development, cloud computing, enterprise-grade mobile applications, AI and machine learning, and blockchain technology, they offer bespoke solutions that drive innovation and efficiency.

Star Coder Interview Stages

Star Coder is an annual recruitment test for BS23. The program has 5 stages

  1. Online MCQ Exam: Everyone who applies for the program will be given the opportunity to sit for this round. Questions are asked from computer science subjects. The topics generally cover programming, data-algo, OOP, databases, etc. Those who do well in this exam are shortlisted for the next step.

  2. Onsite Exam: This round is onsite, a 2-3 hour written exam. Candidates have to take an online exam on problem solving, data algorithms, databases, etc. No internet access is given for this stage.

  3. Day long Assessment Test: This is an interesting round. There are various events throughout the day. Teamwork, idea generation, fun, etc. It is a lot like a hackathon. Presentations have to be given. It takes place in their office from morning to evening. Candidates are given a scenario and some questions. They have to come up with a solution and present it. The submissions are ERD, wireframe, SQL etc.

  4. Technical Interview: Candidates may be interviewed about the project they developed in Step 3. They may also be asked about problem solving and computer science fundamentals

  5. HR Interview

  6. Client Facing Interview: Sometimes candidates are tasked to conduct a real client facing interview. This stage is not applicable for everyone and only given occasionally.

The information presented here is collected from the LinkedIn post of Abdullah Al Hasan vaiya (with his permission, of course).

Online MCQ Round

The problems presented in this round are fairly basic. The format is multiple choice.

Topics Covered are:

  • Object-Oriented Programming (OOP)
  • Database
  • Data Structure & Algorithm
  • Problem-Solving
  • Output Tracing
  • Analytical Ability
  • Software Development Life Cycle (SDLC)

The questions provided here are collected from various online platforms such as Facebook and Glassdoor. No individual candidate has disclosed the questions verbatim.

Mr. Joy is planning to build a web browser. Now he is analyzing requirements for the navigation system of his web browser, which will preserve the browsing history. What is the appropriate data structure to use for the navigation system?

Show Answer

The appropriate data structure to use for the navigation system of a web browser is a Stack. A stack follows the Last In First Out (LIFO) principle, which is suitable for maintaining the browsing history.

In the following code snippet, what does the keyword 'this' refer to

java
class Employee {
    private String name;
        public Employee(String name) {
        this.name = name;
    }
}
Show Answer

The keyword 'this' refers to the current instance of the class. In this context, 'this.name' refers to the instance variable 'name' of the current Employee object.

In a bag , there is black and red balls. The ratio of black to red is 3:7 , if we add 20 more black balls to the bag then the ratio becomes 1:2. How many red balls are there?

Show Answer

Let the number of black balls be 3x and the number of red balls be 7x. After adding 20 more black balls, the ratio becomes 1:2. So, the number of black balls is 3x + 20 and the number of red balls is 7x. According to the given condition, (3x + 20) / 7x = 1 / 2. Solving this equation, we get x = 40. Therefore, the number of red balls is 7x = 280.

which of the following is false about RDBMS (Relational Database Management System)?

  • RDBMS supports concurrency control to handle multiple transactions simultaneously.
  • RDBMS uses tables to store data in rows and columns.
  • In RDBMS, a unique constraint prevents null values in a column.
  • RDBMS ensures data integrity using ACID properties.
Show Answer

The false statement about RDBMS is: In RDBMS, a unique constraint prevents null values in a column. A unique constraint ensures that all values in a column are unique, but it does not prevent null values.

A train leaves station A at 7 AM with the speed of 60 kmph, and another train leaves the A station at 8 AM with the speed of 90 kmph..when will the second train catch the first train?

The first train is already 60 km ahead and the second train is faster, so we calculate the relative speed: Relative Speed = Speed of Second Train − Speed of First Train = 90km/h − 60km/h = 30km/h Time = Distance / Relative Speed = 60km / 30km/h ​= 2hours Final answer = 8:00AM + 2hours = 10:00AM The second train will catch the first train at 10 AM

What will be the output of the following code?

cpp
#include <stdio.h>
int main() {
    int sum = 7 + 6 / 3 + 14 * 2;
    printf("%d", sum);
    return 0;
}
Show Answer

Division and multiplication have higher precedence than addition. So, the expression will be evaluated as 7 + 2 + 28 = 37

If the area of a rectangular region is equal to the area of a square, then the perimeter of the rectangular must be

In the context of the Software Development Life Cycle (SDLC), which model emphasizes the continuous iteration of the development and testing phases throughout the project, accommodating changes in requirements even late in the development process?

Show Answer

The correct answer is Agile Model. The Agile methodology is a project management approach that involves breaking the project into phases and emphasizes continuous collaboration and improvement. Teams follow a cycle of planning, executing, and evaluating.

Who is most likely to write unit tests in a software development project?

Show Answer

Developers are responsible for writing unit tests to ensure that individual units of code are functioning correctly. Unit tests are typically written to test the functionality of the code.

Once upon a time, a group of detectives were presented with a challenge to identify which of the 1000 candies was poisoned before it caused harm to any living species. They had to act fast, as the poison would take effect within an hour of consumption. The detectives knew they could use test subjects, but they needed to determine the minimum number required to solve the mystery in time. Can you help them find the solution before it's too late?

In the Agile Model, what is the primary purpose of a "sprint"?

Show Answer

In Agile methodology, a "sprint" is a short, time-boxed period where a team focuses on completing a specific set of work, essentially a dedicated cycle within a project where a defined amount of functionality is developed and ready for review.

What does the static keyword mean when used with a method?

Show Answer

When the static keyword is used with a method, it means that the method belongs to the class itself rather than an instance of the class. Static methods can be called without creating an instance of the class.
When we declare a field static, exactly a single copy of that field is created and shared among all instances of that class. Similar to static fields, static methods also belong to a class instead of an object. So, we can invoke them without instantiating the class.

Why are immutable objects often preferred in OOP design?

Show Answer

Immutable objects are often preferred in OOP design because they are thread-safe, meaning they can be shared between multiple threads without the risk of data corruption. Additionally, immutable objects are easier to reason about and can help prevent bugs related to mutable state changes.

You are given an undirected graph with weighted edges. Which algorithm would you use to find the Minimum Spanning Tree (MST)?

Show Answer

We can use Kruskal's algorithm or Prim's algorithm to find the Minimum Spanning Tree (MST) of an undirected graph with weighted edges.

What is the time complexity of searching for an element in a balanced binary search tree?

Show Answer

The time complexity of searching for an element in a balanced binary search tree is O(log n), where n is the number of nodes in the tree.

There are 100 light bulbs and 100 people. Initially, all bulbs are off. Person 1 flips every bulb (1, 2, 3, 4, …). Person 2 flips every 2nd bulb (2, 4, 6, …). Person 3 flips every 3rd bulb (3, 6, 9, …), and so on, until all 100 people have acted. How many people would have flipped bulb number 72?

Show Answer

We need to find the factors of 72 to determine how many people would have flipped bulb number 72. The factors of 72 are 1, 2, 3, 4, 6, 8, 9, 12, 18, 24, 36, 72. Therefore, 12 people would have flipped bulb number 72.

A circular queue has a size of 5 and currently contains 3 elements. How many more elements can you insert?

Show Answer

We can insert 2 more elements into the circular queue, as it has a size of 5 and currently contains 3 elements.

You are given the head of a circular singly linked list and an integer n. How would you remove the nth node from the end of the list efficiently?

Show Hint Use the two-pointer technique.
Show Answer

Use two pointer; fast and slow. Move the fast pointer n steps ahead, then move both fast and slow until fast reaches the last node. Delete slow->next by updating slow->next = slow->next->next. Handle edge cases separately.

You are working with a binary search tree (BST) and need to find the lowest common ancestor (LCA) of two nodes, u and v. Which of the following is the most efficient approach for finding the LCA in a BST, assuming no additional balancing is applied?

Show Answer

The most efficient approach is to traverse the BST from the root, moving left if both u and v are smaller, right if both are larger, and stopping when the current node is between u and v (i.e., the LCA). Time Complexity: O(h), where h is the tree height. Provided the tree is balanced, the height is log(n).

What is the next term in the series: 1, 4, 9, 16, 25, __?

Show Answer

The next term in the series is 36. The series represents the squares of natural numbers: 1^2, 2^2, 3^2, 4^2, 5^2, 6^2.

In a many-to-many relationship between two database tables, which of the following is typically used to model the relationship?

Given a code, you have to determine which OOP features is not used in the code above?

Which of the option in a given list is NOT a valid SQL data type?

Given a list of statements, which of them is false for dynamic programming?

A game development team is working on a character system where all characters have a fight() method. Characters like Warrior, Mage, and Archer implement this method differently. Which concept ensures the correct method is executed based on the character type?

Show Answer

The concept of polymorphism ensures the correct method is executed based on the character type. Polymorphism allows objects of different classes to be treated as objects of a common superclass.

Read more about Java Polymorphism | W3 Schools

Given a list of situations, In which of them would a stack be most appropriate?

In a network of cities and roads, you are given n cities and m roads between them. Your task is to determine the minimum number of new roads required to ensure that there is a path between every pair of cities. What is the most suitable approach to solve this problem?

Show Answer

The most suitable approach is to create a connected graph using a Union-Find algorithm. The cities will be connected in multiple components. Each city in a component is connected to any other city in the same component using some series of roads. The minimum number of new roads required is the number of components minus one.

Given a graph in figure, What is the shortest path from a point A to point F using BFS?

Given a list of examples, which of them is an example of compile-time polymorphism?

Show Answer

Function overloading is an example of compile-time polymorphism. It allows multiple functions with the same name but different parameters to be defined in a class.

You are given a list of n unique room numbers belonging to guests at a hotel. These numbers are in the range [0, n], but one guest's room number is missing from the list. What is the best possible space complexity for solving this problem?

Show Answer

The best possible space complexity is O(1). We can use the XOR operation to find the missing room number without using additional space. XOR all the room numbers in a variable x. Then XOR x with the range [0, n] and the missing room number will be the result.

Identify the What type of casting is demonstrated in a code segment?

Given some figures of graph, identify which is not a bipartite graph?

Show Answer

A bipartite graph is a graph whose vertices can be divided into two disjoint sets such that no two vertices within the same set are adjacent. A graph that contains an odd-length cycle is not a bipartite graph.

What is the purpose of the final keyword in OOP?

Show Answer

The final keyword in OOP is used to restrict the user. It can be used with variables, methods, and classes. When a variable is declared with the final keyword, its value cannot be changed. When a method is declared with the final keyword, it cannot be overridden by subclasses. When a class is declared. with the final keyword, it cannot be subclassed.

Write a SQL query to retrieve the names of all customers who have placed an order with a total value greater than $1000. Orders are in the orders table and customer information is in the customers table.

Show Answer
sql
SELECT customers.name
FROM customers
JOIN orders ON customers.id = orders.customer_id
WHERE orders.total_value > 1000;

Given some statements about database keys, which of them is incorrect?

Onsite Coding Round

This round is a mixture of coding problems and MCQs. The topics are the same as the online MCQ round. On average, the number of coding problems given are 9-10 and the number of MCQs are around 30.

Given a number n, write a program to reverse the digits of the number.

💻 Submit Code

Show Answer
cpp
class Solution {
public:
    int reverse(int x) {
        int reverse = 0;
        while( x ) {
            if( reverse > INT_MAX/10 || reverse < INT_MIN/10  ) return 0;
            reverse = reverse * 10 + x % 10;
            x /= 10;
        }
        return reverse;
    }
};

Given a number n, write a program to find if the number is an armstrong number or not.

An Armstrong number is a number that is equal to the sum of its digits, each raised to the power of the number of digits in the number. For example, 153 is an Armstrong number because 1^3+5^3+3^3=153

Show Answer
cpp
class Solution {
public:
    bool armstrongNumber(int n) {
        int n_ = n;
        int a = 0;
        while( n > 0 ){
            int d = n % 10;
            a = a + d * d * d;
            n = n / 10;
        }
        if( n_ ==  a) return true;
        else return false;
    }
};

Write a program to print a string by removing

  • leading, trailing space,
  • if there's two or more space between two chars replace it with one space.
Show Answer
cpp
class Solution {
public:
    string removeSpaces(string s) {
        string trimmed = "";
        bool seenSpace = true;
        for(auto c:s){
            if (c != ' ') {
                result +=c;
                seenSpace = false;  // Reset space flag
            } else if (!seenSpace) {  // If it's the first space after a word
                trimmed += ' ';
                seenSpace = true;
            }
        }
        while( trimmed.size() and trimmed.back() == ' ' ) trimmed.pop_back();
        return trimmed;
    }
};

Write a program which will do the following for i = 1 to N .

  • if i is divisible by 3 then print 'Star',
  • if i is divisible by 5 'Coder'
  • if i is divisible by 3 and 5 both print 'StarCoder'
  • else just print the number
Show Answer
cpp
class Solution {
public:
    void fooBar(int n) {
        for( int i = 1; i <= n; i++ ) {
            string output = "";
            if( i % 3 == 0 ) output += "Star";
            if( i % 5 == 0 ) output += "Coder";
            if( output != "" ) cout << output << endl;
            else cout << i << endl;
        }
    }
};

Given an integer array nums, rotate the array to the right by k steps, where k is non-negative.

💻 Submit Code

Show Answer
cpp
class Solution {
public:
    void rotate(vector<int>& nums, int k) {
        int n = nums.size();
        k = k % n;
        reverse(nums.begin(), nums.end());
        reverse(nums.begin(), nums.begin() + k);
        reverse(nums.begin() + k, nums.end());
    }
};

Given a number n, print its factorial i.e. n!

Show Answer
cpp
class Solution {
public:
    void factorial(int n) {
        if( n < 0 ) return 0;
        if( n == 0 ) return 1;
        return n * factorial(n-1);
    }
};

Given an unsorted array of integers nums, return the length of the longest consecutive elements sequence.:

Ex: Input: 5 3 2 1 After Sort: 1 2 3 5 Ans: 3
Bonus: Write an algorithm that runs in O(n) time.

💻 Submit Code

Show Answer
cpp
class Solution {
public:
    int longestConsecutive(vector<int>& nums) {
        if( nums.size() == 0 )  return 0;
        sort(nums.begin(), nums.end());
        int seq_length = 1;
        int max_length = 1;
        for(int i = 1; i < nums.size(); i++){
            if( nums[i] == nums[i-1] ) continue;
            else if( nums[i] == nums[i-1] + 1 ) seq_length++;
            else seq_length = 1;
            max_length = max(max_length, seq_length);
        }
        return max_length;
    }
};

Given two integers N (upto 18 digits) and M(≤100): Digits of the New Number:

  • The new number should be formed by permuting the digits of N.
  • The new number must not have any leading zeros.
  • The new number must be divisible by M. find the num of numbers that match these conditions.
Input: 104 2
Output: 3
→104, 140, 410

Day long Assessment Test

Candidates need to stay in the office from morning to evening. They are presented with multiple tasks throughout the day. Most important of them are

  1. Written Exam
  2. Project Planning and Presentation
  3. Interview

Written Exam

The written exam have 3 segments

  1. Behavioural Test
  2. Aptitude Test
  3. Technical Test

It is taken first thing in the morning. Some of them are taken in sheet of papers and some are taken in external or internal websites.

Behavioural Test

The behavioural tests are quite similar to the ones standardized by Amazon. The situational judgment test (SJT) or behavioral assessment stage evaluates a candidate's decision-making and problem-solving skills in workplace scenarios. Candidates are presented with a situation and two possible responses, selecting their preference on a scale from strongly favoring one option to neutral or favoring the other. This helps employers assess traits like leadership, teamwork, and customer focus. Companies like Amazon use this method to identify candidates who align with their core values and work culture.

A customer reaches out with a complaint about a product they purchased. They are clearly frustrated, but the issue falls outside the company’s usual return policy.

Show Options

Options:
A) Stick to company policy and explain why you can’t help them.
B) Make an exception to satisfy the customer.

Scale:
1️⃣ Strongly Prefer A 2️⃣ Moderately Prefer A 3️⃣ Neutral 4️⃣ Moderately Prefer B 5️⃣ Strongly Prefer B

A customer reaches out with a complaint about a product they purchased. They are clearly frustrated, but the issue falls outside the company’s usual return policy.

Show Options

Options:
A) Stick to company policy and explain why you can’t help them.
B) Make an exception to satisfy the customer.

Scale:
1️⃣ Strongly Prefer A 2️⃣ Moderately Prefer A 3️⃣ Neutral 4️⃣ Moderately Prefer B 5️⃣ Strongly Prefer B

You and a coworker are working on a project together. They propose an approach that you don’t fully agree with, but they seem confident it will work.

Show Options

Options:
A) Trust their judgment and follow their lead.
B) Insist on discussing the approach further before moving forward.

Scale:
1️⃣ Strongly Prefer A 2️⃣ Moderately Prefer A 3️⃣ Neutral 4️⃣ Moderately Prefer B 5️⃣ Strongly Prefer B

Aptitude Test

Aptitude tests assess a candidate’s problem-solving ability, logical reasoning, numerical skills, and verbal comprehension. These tests are commonly used in hiring to evaluate a candidate's ability to think critically and process information efficiently. They are often timed and include questions on math, logic, patterns, and language. These tests are written or MCQ type questions. On average there are 30 questions like these.

If you had to choose 1 food to eat for the rest of your life, then what would it be? why?

Which actor do you like the most? why?

When do you feel sad the most?

Technical Test

This test is language dependent. You'll be asked to chose a language eg Java, JavaScript, Python etc and the questions will be based on that language. There are about 15 questions in this test.
The topics are from core language features, loop, time complexity, data structures, algorithm etc.

Give a description about your favourite project

Project Planning and Presentation

One of the tasks is to come up with a solution for a given scenario. The candidates are divided into groups and each group is assigned a mentor. The mentor will guide the group throughout the task. The groups need to present their solution at the end of the day. The presentation includes ERD, wireframe, SQL etc. Each one of the group members needs to present a part of the solution.

Create presentations on a ticket management system

Show Description

You are to design a system for a ticket management system. There are multiple employees in the system; admin, ticket master, cashier, checker, user. Each employee has different roles. For example, the ticker master can issue tickets. He can also edit or delete a ticket allocation. The cashier collects payment for the tickets. He can also issue ticket. The checker only checks the validity of the tickets. There can be multiple type of tickets based on the seat. Admin can create new type of tickets in the system. An user buys ticket from the system.

Show Deliverables

The candidates are to present

  1. Project Requirement Analysis
  2. Database Schema Design
  3. Class Diagram
  4. SQL for some specific queries
Each team is given a big presentation paper. They will need to present the whole system within that paper.

Individual Interview

Each candidate faces yet another interview at the end of the day. This stage is language independent and focues on general software development knowledges. Topics might include git, SDLC, data structures, algorithm etc.

Some situations are given, you'll need to provide which algoritm is best suited for solving the task.

Given some code, you'll need to figure out the time complexity of the code

Project Submission

This round is not present in the Star Coder program every year. But in some years, candidates are asked to submit a project. A scenario is given to the candidates through email. The project is chosen based on the candidates preferences presented in the previous rounds. The project is to be submitted within a week. The projects given are pretty basic, but the candidates are expected to follow best practices.

A sample project scenario is given below:

Create a simple system for a task management system.

Requirements

Authentication

  • User can sign up
  • User can sign in

Task Management

  • User can create a task
  • User can update a task
  • User can delete a task
  • User can view all tasks created by him
Best practices

Restful API

  • Follow the RESTful API guidelines
  • Use proper status codes
  • All the endpoints should be documented

Data validation

  • Use proper error handling
  • All the endpoints request should be validated

Database

  • Use a relational database to store the data
  • Use ORM to interact with the database

Testing

  • Write unit tests for the core logics
  • Handle both positive and negative test cases

Authentication

  • Use JWT for authentication
  • Use RBAC to manage the roles

Security

  • Store the password in a hashed format
  • Use proper sanitization to prevent SQL injection
  • Sanite user input to prevent XSS attack
  • Implement CSRF protection
Bonus

Implement additional features like pagination, search, filtering etc

Evaluation

The project will be evaluated based on the best practices followed, code quality, and the features implemented

  • Correctness and functionality of the system
  • Code quality
  • RESTful API guidelines
  • Security measures
  • Authentication and authorization
  • Frontend integration
  • Documentation
  • Testing
  • Bonus features
Deliverables

Codebase

Use version control to manage the codebase. The codebase should be hosted in a public repository.

Documentation

Provide a README file with setup instructions, API documentation, and any other necessary information.

Tests

Write unit tests for the core logics. Add instructions on how to run the tests.

Technical Round

This round is also language and stack specific. The language is chosen by the candidate during the day long assessment. Some sample questions from Java are given.

What is primitive and non primitive data types? How are they different? When can their values be changed?

Why are strings immutable in Java?

What are the 4 principles of OOP?

What is diamond problem?

Show Answer

Diamond Problem is a problem faced during Multiple Inheritance in Java. This problem occurs when a class inherits from two interfaces that both extend a common interface and define a method with the same name. The ambiguity arises because the class implementing these interfaces does not know which method to call when invoking the method by name.

How does Java tackle the multiple inheritence issue?

Show Answer

Java doesn't allow multiple inheritance to avoid the complexity and ambiguity associated with it, particularly the "diamond problem," where a class inherits from two classes that have a common ancestor, leading to conflicts in the inheritance of methods.

To resolve this ambiguity, you must override the conflicting method in the implementing class and explicitly specify which method you want to use.

java
interface A {
    default void foo() {
        System.out.println("A's foo");
    }
}

interface B extends A {
    default void foo() {
        System.out.println("B's foo");
    }
}

interface C extends A {
    default void foo() {
        System.out.println("C's foo");
    }
}

class D implements B, C {
    @Override
    public void foo() {
        B.super.foo(); // or C.super.foo();
    }
    
    public static void main(String[] args) {
        D d = new D();
        d.foo();
    }
}

In this example, the foo method is overridden in class D, and within the overridden method, we explicitly call the foomethod from either B or C using B.super.foo() or C.super.foo().

What features of Spring Boot have you used?

What is indexing in Database?

Describe ACID in RDBMS

Show Answer

ACID is a set of properties of database transactions intended to guarantee data validity despite errors, power failures, and other mishaps. Databases that support this are called ACID compliance. The properties are

  • Atomicity: Each statement in a transaction (to read, write, update or delete data) is treated as a single unit. Either the entire statement is executed, or none of it is executed.
  • Consistency: Ensures the databases remain consistent following some predefined business logic both before and after the transaction
  • Isolation: Each transaction executes in such a way that one is not affected by other s though they were occurring only one.
  • Durability: The data changes by a successfull transaction is saved even in the event of system failure

IMPORTANT

Atomicity, isolation and durability are properties of the database, whereas consistency is a property of the application. The C in ACID was tossed in to make the acronym work. [ref: Martin Kleppmann, Designing Data Intensive Applications]

Some questions might be asked from the projects added in resume. If github repository links are added then interviewer might check those out too.

Suppose you have to build a e-commerce site where you have multiple product listing. In the home page the products have some small information listed. When you click on any single product then full details of the product is shown. How would you design the database and system for this?