Professional K (Kdb+) FAQ Questions and Answers

Welcome to our comprehensive Trivia Quiz and interview preparation guide. Below you will find a curated list of popular Trivia Questions and Answers specifically for K (Kdb+). Whether you are preparing for a technical interview or just testing your knowledge, these FAQ Questions will help you succeed.

What is Kdb+?

Kdb+ is a high-performance columnar database with a built-in programming language called Q, designed for time-series data analysis.

Who developed Kdb+?

Kdb+ was developed by Arthur Whitney and is maintained by KX Systems.

What is K language?

K is a terse, high-performance programming language used as the foundation of Q, the query language of Kdb+.

How is K different from Q?

K is lower-level and more concise, whereas Q is a more readable, SQL-like wrapper around K.

What are the key features of Kdb+?

Columnar storage, in-memory processing, vectorized operations, and efficient handling of time-series data.

What industries commonly use Kdb+?

Finance, telecommunications, IoT, and machine learning for real-time analytics.

What is the main data structure in K?

The table, which is a collection of columnar vectors.

How do you define a list in K?

L: (1;2;3;4)

How do you create a dictionary in K?

D: (abc)!(10 20 30)`

How do you create a table in K?

T: ([] sym:ABC; price:100 200 300)`

How do you query data in Kdb+?

Using select statements: select from T where sym=A`

What is a symbol in Kdb+?

A unique, interned string optimized for fast lookup.

What is the difference between a list and a vector in K?

A vector is a homogeneous list of the same type, while a list can be heterogeneous.

How do you perform a sum operation in K?

+/ 1 2 3 4 returns 10.

What does count do in K?

Returns the number of elements in a list or table column.

How do you define a function in K?

{x+y} defines an anonymous function adding two numbers.

What is an adverb in K?

An operator that modifies a function, such as / (each-right) and \ (each-left).

What is the purpose of the flip function?

Converts rows to columns and vice versa in a table.

How do you get unique elements from a list?

Using distinct: distinct 1 2 2 3 3 4 returns 1 2 3 4.

How do you join two tables in K?

Using lj (left join) or aj (asof join).

What is the default date format in Kdb+?

YYYY.MM.DD

How do you get the current date in Kdb+?

.z.D

How do you get the current time in Kdb+?

.z.T

What is a keyed table in Kdb+?

A table where one or more columns serve as unique keys for fast lookups.

How do you define a keyed table?

kt: sym xkey ([] sym:AB; price:100 200)`

What is a foreign key in Kdb+?

A reference to another table's primary key for relational integrity.

How do you filter data in Kdb+?

select from T where price>100

What is the group function used for?

Groups table rows by a specific column.

How do you concatenate lists in K?

1 2 3, 4 5 6 results in 1 2 3 4 5 6.

How do you check the type of a variable in K?

type function: type 42 returns -7 (integer type).

How does Kdb+ handle missing data?

Using :: (null values) or 0N (null numeric values).

How do you remove duplicates in K?

distinct list

What does exec do in Kdb+?

Extracts specific columns from a table.

How do you append a row to a table?

T,: (new_sym; new_price).

What does update do in K?

Modifies column values: update price:price*1.1 from T.

How do you drop a column from a table?

delete column_name from table_name.

What does except do in K?

Removes elements that match a given list.

What is where used for in Kdb+?

To filter rows based on conditions.

How do you create a time-series data column?

times: 10:00 + til 5.

What is the difference between til and asc?

til n generates numbers from 0 to n-1, while asc sorts in ascending order.

What is each used for in K?

Applies a function to each element in a list.

How do you define a rolling sum in K?

xsum each 1 2 3 4 results in 1 3 6 10.

What is fby in K?

Groups a list and applies a function per group.

What is parse used for?

Converts strings to K expressions.

How do you generate a range of dates in Kdb+?

2019.01.01 + til 10.

What is a partitioned database in Kdb+?

A method for storing large time-series datasets efficiently.

How does Kdb+ store large datasets?

Using splayed tables and partitioned databases.

How do you save a table in Kdb+?

.Q.dpft or .Q.fu functions.

How do you start a Kdb+ process?

q in the command line.

What is the advantage of Kdb+ over traditional databases?

It offers superior performance for time-series data through columnar storage and in-memory processing.